@@ -78,14 +78,10 @@ class SlabFCC : public FieldModifier {
7878 Vec3<int > high = decomp.get_inbox ().high ;
7979
8080 // auto Lx = w.Lx;
81- auto Ly = w.get_size ()[1 ];
82- auto Lz = w.get_size ()[2 ];
83- auto dx = w.get_spacing ()[0 ];
84- auto dy = w.get_spacing ()[1 ];
85- auto dz = w.get_spacing ()[2 ];
86- auto x0 = w.get_origin ()[0 ];
87- auto y0 = w.get_origin ()[1 ];
88- auto z0 = w.get_origin ()[2 ];
81+ auto Ly = get_size (w, 1 );
82+ auto Lz = get_size (w, 2 );
83+ auto [dx, dy, dz] = get_spacing (w);
84+ auto [x0, y0, z0] = get_origin (w);
8985
9086 std::vector<SeedFCC> seeds;
9187
@@ -117,13 +113,13 @@ class SlabFCC : public FieldModifier {
117113
118114 if (randomized) {
119115
120- std::cout << " Generating " << nseeds << " random seeds up to distance "
121- << X0 << " \n " ;
116+ std::cout << " Generating " << nseeds << " random seeds up to distance " << X0
117+ << " \n " ;
122118
123119 for (int j = 0 ; j < Ny; j++) {
124120 for (int k = 0 ; k < Nz; k++) {
125- const std::array<double , 3 > location = {
126- X0 + rt (re), Y0 + Dy * j + rt (re), Z0 + Dz * k + rt (re)};
121+ const std::array<double , 3 > location = {X0 + rt (re), Y0 + Dy * j + rt (re),
122+ Z0 + Dz * k + rt (re)};
127123 const std::array<double , 3 > orientation = {rr (re), rr (re), rr (re)};
128124 const SeedFCC seed (location, orientation, radius, rho, amplitude);
129125 seeds.push_back (seed);
@@ -136,8 +132,8 @@ class SlabFCC : public FieldModifier {
136132
137133 for (int j = 0 ; j < Ny; j++) {
138134 for (int k = 0 ; k < Nz; k++) {
139- const std::array<double , 3 > location = {
140- X0 + rt (re), Y0 + Dy * j + rt (re), Z0 + Dz * k + rt (re)};
135+ const std::array<double , 3 > location = {X0 + rt (re), Y0 + Dy * j + rt (re),
136+ Z0 + Dz * k + rt (re)};
141137 const std::array<double , 3 > orientation = orientations[j * Nz + k];
142138 const SeedFCC seed (location, orientation, radius, rho, amplitude);
143139 seeds.push_back (seed);
@@ -218,8 +214,7 @@ void from_json(const json ¶ms, SlabFCC &ic) {
218214 << std::endl;
219215 }
220216 if (!params.contains (" orientations" ) || !params[" orientations" ].is_array ()) {
221- std::cout << " No valid orientation vector detected, randomizing."
222- << std::endl;
217+ std::cout << " No valid orientation vector detected, randomizing." << std::endl;
223218 }
224219 int Nz = params[" Nz" ];
225220 int Ny = params[" Ny" ];
0 commit comments