File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -83,8 +83,9 @@ int main()
8383 {{io::UnitDimension::M, 1 }});
8484 electrons[" displacement" ][" x" ].setUnitSI (1e-6 );
8585 electrons.erase (" displacement" );
86- electrons[" weighting" ][io::RecordComponent::SCALAR].makeConstant (
87- 1 .e -5 );
86+ electrons[" weighting" ][io::RecordComponent::SCALAR]
87+ .resetDataset ({io::Datatype::FLOAT, {1 }})
88+ .makeConstant (1 .e -5 );
8889 }
8990
9091 io::Mesh mesh = cur_it.meshes [" lowRez_2D_field" ];
Original file line number Diff line number Diff line change 9090 electrons ["displacement" ].unit_dimension = {Unit_Dimension .M : 1 }
9191 electrons ["displacement" ]["x" ].unit_SI = 1.e-6
9292 del electrons ["displacement" ]
93- electrons ["weighting" ][SCALAR ].make_constant (1.e-5 )
93+ electrons ["weighting" ][SCALAR ] \
94+ .reset_dataset (Dataset (np .dtype ("float32" ), extent = [1 ])) \
95+ .make_constant (1.e-5 )
9496
9597 mesh = cur_it .meshes ["lowRez_2D_field" ]
9698 mesh .axis_labels = ["x" , "y" ]
Original file line number Diff line number Diff line change 4444 # don't like it anymore? remove it with:
4545 # del electrons["displacement"]
4646
47- electrons ["weighting" ][SCALAR ].make_constant (1.e-5 )
47+ electrons ["weighting" ][SCALAR ] \
48+ .reset_dataset (Dataset (np .dtype ("float32" ), extent = [1 ])) \
49+ .make_constant (1.e-5 )
4850
4951 particlePos_x = np .random .rand (234 ).astype (np .float32 )
5052 particlePos_y = np .random .rand (234 ).astype (np .float32 )
You can’t perform that action at this time.
0 commit comments