File tree Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Expand file tree Collapse file tree 3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 88
99#pragma once
1010
11+ #include "Conversion.h"
1112#include "NEML2TensorCompute.h"
1213#include "NEML2Utils.h"
1314
@@ -70,6 +71,7 @@ NEML2TensorCompute::NEML2TensorCompute(const InputParameters & params)
7071 const auto inputs = getParam < TensorInputBufferName , std ::string > ("swift_inputs ", "neml2_inputs ");
7172 std ::map < neml2 ::LabeledAxisAccessor , TensorInputBufferName > lookup_swift_name ;
7273 const auto model_inputs = _model .consumed_items ();
74+ mooseInfo ("Inputs: " , Moose ::stringify (model_inputs ));
7375
7476 // current inputs
7577 for (const auto & [swift_input_name , neml2_input_name ] : inputs )
@@ -98,7 +100,7 @@ NEML2TensorCompute::NEML2TensorCompute(const InputParameters & params)
98100
99101 // old state inputs
100102 for (const auto & neml2_input : model_inputs )
101- if (neml2_input .is_old_state ())
103+ if (neml2_input .is_old_state () || neml2_input . is_old_force () )
102104 {
103105 // check if we couple the current state
104106 auto it = lookup_swift_name .find (neml2_input .current ());
Original file line number Diff line number Diff line change @@ -27,5 +27,5 @@ TimeTensorCompute::TimeTensorCompute(const InputParameters & parameters)
2727void
2828TimeTensorCompute ::computeBuffer ()
2929{
30- _u = torch ::tensor ({_time }, MooseTensor ::floatTensorOptions ());
30+ _u = torch ::tensor ({_time }, MooseTensor ::floatTensorOptions ()). expand ( _domain . getShape ()) ;
3131}
Original file line number Diff line number Diff line change 1818 buffer = A
1919 real = 2
2020 []
21+ []
22+ [Solve]
23+ [time]
24+ type = TimeTensorCompute
25+ buffer = time
26+ []
2127 [dAdt]
2228 type = NEML2TensorCompute
2329 neml2_input_file = neml2_input.i
2430 neml2_model = rate
25- swift_inputs = ' A B '
26- neml2_inputs = ' forces/A forces/B '
31+ swift_inputs = ' A time '
32+ neml2_inputs = ' forces/A forces/t '
2733 neml2_outputs = ' state/dAdt'
2834 swift_outputs = ' dAdt'
2935 []
3036 []
31- [Solve]
32-
33- []
3437[]
3538
3639[Postprocessors]
3740 [dAdt]
3841 type = TensorAveragePostprocessor
3942 buffer = dAdt
43+ execute_on = ' TIMESTEP_END'
4044 []
4145[]
4246
You can’t perform that action at this time.
0 commit comments