Skip to content

Commit

Permalink
Fix some of the bugs found by this check
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Feb 23, 2023
1 parent 0c24b07 commit f031bf8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions examples/7_extended_write_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ int main()
{{io::UnitDimension::M, 1}});
electrons["displacement"]["x"].setUnitSI(1e-6);
electrons.erase("displacement");
electrons["weighting"][io::RecordComponent::SCALAR].makeConstant(
1.e-5);
electrons["weighting"][io::RecordComponent::SCALAR]
.resetDataset({io::Datatype::FLOAT, {1}})
.makeConstant(1.e-5);
}

io::Mesh mesh = cur_it.meshes["lowRez_2D_field"];
Expand Down
4 changes: 3 additions & 1 deletion examples/7_extended_write_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@
electrons["displacement"].unit_dimension = {Unit_Dimension.M: 1}
electrons["displacement"]["x"].unit_SI = 1.e-6
del electrons["displacement"]
electrons["weighting"][SCALAR].make_constant(1.e-5)
electrons["weighting"][SCALAR] \
.reset_dataset(Dataset(np.dtype("float32"), extent=[1])) \
.make_constant(1.e-5)

mesh = cur_it.meshes["lowRez_2D_field"]
mesh.axis_labels = ["x", "y"]
Expand Down
4 changes: 3 additions & 1 deletion examples/9_particle_write_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
# don't like it anymore? remove it with:
# del electrons["displacement"]

electrons["weighting"][SCALAR].make_constant(1.e-5)
electrons["weighting"][SCALAR] \
.reset_dataset(Dataset(np.dtype("float32"), extent=[1])) \
.make_constant(1.e-5)

particlePos_x = np.random.rand(234).astype(np.float32)
particlePos_y = np.random.rand(234).astype(np.float32)
Expand Down

0 comments on commit f031bf8

Please sign in to comment.