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()
83
83
{{io::UnitDimension::M, 1 }});
84
84
electrons[" displacement" ][" x" ].setUnitSI (1e-6 );
85
85
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 );
88
89
}
89
90
90
91
io::Mesh mesh = cur_it.meshes [" lowRez_2D_field" ];
Original file line number Diff line number Diff line change 90
90
electrons ["displacement" ].unit_dimension = {Unit_Dimension .M : 1 }
91
91
electrons ["displacement" ]["x" ].unit_SI = 1.e-6
92
92
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 )
94
96
95
97
mesh = cur_it .meshes ["lowRez_2D_field" ]
96
98
mesh .axis_labels = ["x" , "y" ]
Original file line number Diff line number Diff line change 44
44
# don't like it anymore? remove it with:
45
45
# del electrons["displacement"]
46
46
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 )
48
50
49
51
particlePos_x = np .random .rand (234 ).astype (np .float32 )
50
52
particlePos_y = np .random .rand (234 ).astype (np .float32 )
You can’t perform that action at this time.
0 commit comments