Skip to content

Commit fba25b1

Browse files
committed
refactor(examples): Update diffusion example to use type-safe world API
Updated world creation to use type-safe API with strong types, wrapping Vec3 parameters in GridSize, PhysicalOrigin, and GridSpacing constructors. This demonstrates the pattern of converting Vec3 values to strong types when creating a world from configuration variables. Fixes deprecation warning in diffusion model example.
1 parent 17495b1 commit fba25b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/diffusion_model_with_custom_initial_condition.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ void run() {
8383
Vec3<int> dimensions{Lx, Ly, Lz};
8484
Vec3<double> origo{x0, y0, z0};
8585
Vec3<double> discretization{dx, dy, dz};
86-
World world = world::create(dimensions, origo, discretization);
86+
World world = world::create(GridSize(dimensions), PhysicalOrigin(origo),
87+
GridSpacing(discretization));
8788

8889
double t0 = 0.0;
8990
double t1 = 0.5874010519681994;

0 commit comments

Comments
 (0)