From b7da9bae2607ccabcb68139ac520008976d6eaf8 Mon Sep 17 00:00:00 2001 From: Xiangyu Hu Date: Sun, 22 Sep 2024 14:29:43 +0000 Subject: [PATCH] to continue --- .../diffusion_NeumannBC.cpp | 2 +- tests/2d_examples/test_2d_stfb/stfb.cpp | 6 +++--- .../test_2d_stretching/stretching.cpp | 9 +++++---- .../test_2d_water_entry_exit.cpp | 9 ++++++--- .../windows_frame_diffusion_D4.cpp | 2 +- .../windows_frame_diffusion_D7.cpp | 2 +- .../beam_pulling_pressure_load.cpp | 3 ++- ...3d_bending_circular_plate_parametric_cvt.cpp | 5 +---- tests/3d_examples/test_3d_dambreak/dambreak.cpp | 4 ++-- .../test_3d_dambreak_elastic_plate_shell.cpp | 7 ++++--- .../3d_elasticSolid_shell_collision.cpp | 12 +++++++----- .../src/muscle_activation.cpp | 4 ++-- .../muscle_soft_body_contact.cpp | 14 ++++++++------ .../muscle_solid_contact.cpp | 17 +++++++++-------- tests/3d_examples/test_3d_network/network.cpp | 8 +++++--- .../passive_cantilever.cpp | 5 +++-- .../passive_cantilever_neohookean.cpp | 5 +++-- .../T_pipe_VIPO_shell.cpp | 5 ++--- .../test_2d_membrane/2d_membrane.cpp | 3 ++- .../mixed_poiseuille_flow.cpp | 2 +- .../test_2d_modified_T_flow/modified_T_flow.cpp | 2 +- .../pulsatile_poiseuille_flow.cpp | 2 +- .../passive_cantilever_LG.cpp | 5 +++-- .../test_particle_for_split.cpp | 8 ++++---- 24 files changed, 77 insertions(+), 64 deletions(-) diff --git a/tests/2d_examples/test_2d_diffusion_NeumannBC/diffusion_NeumannBC.cpp b/tests/2d_examples/test_2d_diffusion_NeumannBC/diffusion_NeumannBC.cpp index 724d4f15e2..71401236f4 100644 --- a/tests/2d_examples/test_2d_diffusion_NeumannBC/diffusion_NeumannBC.cpp +++ b/tests/2d_examples/test_2d_diffusion_NeumannBC/diffusion_NeumannBC.cpp @@ -53,7 +53,7 @@ int main(int ac, char *av[]) // Define the main numerical methods used in the simulation. // Note that there may be data dependence on the constructors of these methods. //---------------------------------------------------------------------- - + SimpleDynamics diffusion_body_normal_direction(diffusion_body, diffusion_body_shape); SimpleDynamics wall_boundary_normal_direction(wall_Neumann, wall_shape_Neumann); DiffusionBodyRelaxation temperature_relaxation( diff --git a/tests/2d_examples/test_2d_stfb/stfb.cpp b/tests/2d_examples/test_2d_stfb/stfb.cpp index 3fb2120146..4cdcec4e15 100644 --- a/tests/2d_examples/test_2d_stfb/stfb.cpp +++ b/tests/2d_examples/test_2d_stfb/stfb.cpp @@ -29,9 +29,9 @@ int main(int ac, char *av[]) wall_boundary.generateParticles(wall_boundary_shape); TransformShape structure_shape(Transform(structure_translation), structure_halfsize, "Structure"); - SolidBody structure(sph_system, structure_shape); + SolidBody structure(sph_system, structure_shape.getName()); structure.defineMaterial(rho_s); - structure.generateParticles(floating_structure_shape); + structure.generateParticles(structure_shape); ObserverBody observer(sph_system, "Observer"); observer.defineAdaptationRatios(1.15, 2.0); @@ -66,7 +66,7 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- SimpleDynamics structure_offset_position(structure, offset); SimpleDynamics wall_boundary_normal_direction(wall_boundary, wall_boundary_shape); - SimpleDynamics str_normal(structure); + SimpleDynamics str_normal(structure, structure_shape); Gravity gravity(Vecd(0.0, -gravity_g)); SimpleDynamics> constant_gravity(water_block, gravity); diff --git a/tests/2d_examples/test_2d_stretching/stretching.cpp b/tests/2d_examples/test_2d_stretching/stretching.cpp index 3e9b41f636..636c449dcc 100644 --- a/tests/2d_examples/test_2d_stretching/stretching.cpp +++ b/tests/2d_examples/test_2d_stretching/stretching.cpp @@ -184,14 +184,15 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating body, materials and particles. //---------------------------------------------------------------------- - SolidBody beam_body(system, makeShared("StretchingBody")); - beam_body.defineBodyLevelSetShape(); + Beam beam_body_shape("StretchingBody"); + SolidBody beam_body(system, beam_body_shape.getName()); + LevelSetShape level_set_shape(beam_body, beam_body_shape); beam_body.defineMaterial( rho0_s, Youngs_modulus, poisson, yield_stress, hardening_modulus, saturation_flow_stress, saturation_exponent); (!system.RunParticleRelaxation() && system.ReloadParticles()) ? beam_body.generateParticles(beam_body.getName()) - : beam_body.generateParticles(beam_body_shape); + : beam_body.generateParticles(level_set_shape); ObserverBody beam_observer(system, "BeamObserver"); beam_observer.generateParticles(observation_location); @@ -214,7 +215,7 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- using namespace relax_dynamics; SimpleDynamics beam_body_random_particles(beam_body); - RelaxationStepInner beam_body_relaxation_step_inner(beam_body_inner); + RelaxationStepInner beam_body_relaxation_step_inner(beam_body_inner, level_set_shape); //---------------------------------------------------------------------- // Output for particle relaxation. //---------------------------------------------------------------------- diff --git a/tests/2d_examples/test_2d_water_entry_exit/test_2d_water_entry_exit.cpp b/tests/2d_examples/test_2d_water_entry_exit/test_2d_water_entry_exit.cpp index 6e5ae353d2..3d8c7a124c 100644 --- a/tests/2d_examples/test_2d_water_entry_exit/test_2d_water_entry_exit.cpp +++ b/tests/2d_examples/test_2d_water_entry_exit/test_2d_water_entry_exit.cpp @@ -189,15 +189,18 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating bodies with corresponding materials and particles. //---------------------------------------------------------------------- - FluidBody water_block(sph_system, makeShared("WaterBody")); + WettingFluidBody water_block_shape("WaterBody"); + FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f, mu_f); water_block.generateParticles(water_block_shape); - SolidBody wall_boundary(sph_system, makeShared("WallBoundary")); + WettingWallBody wall_boundary_shape("WallBoundary"); + SolidBody wall_boundary(sph_system, wall_boundary_shape.getName()); wall_boundary.defineMaterial(); wall_boundary.generateParticles(wall_boundary_shape); - SolidBody cylinder(sph_system, makeShared("Cylinder")); + WettingCylinderBody cylinder_shape("Cylinder"); + SolidBody cylinder(sph_system, cylinder_shape.getName()); cylinder.defineAdaptationRatios(1.15, 1.0); LevelSetShape cylinder_shape_level_set(cylinder, cylinder_shape); cylinder.defineMaterial(rho0_s); diff --git a/tests/2d_examples/test_2d_windows_frame_diffusion_D4/windows_frame_diffusion_D4.cpp b/tests/2d_examples/test_2d_windows_frame_diffusion_D4/windows_frame_diffusion_D4.cpp index 709eae4a1a..ce71920bf3 100644 --- a/tests/2d_examples/test_2d_windows_frame_diffusion_D4/windows_frame_diffusion_D4.cpp +++ b/tests/2d_examples/test_2d_windows_frame_diffusion_D4/windows_frame_diffusion_D4.cpp @@ -51,7 +51,7 @@ int main(int ac, char *av[]) // Define the main numerical methods used in the simulation. // Note that there may be data dependence on the constructors of these methods. //---------------------------------------------------------------------- - + SimpleDynamics diffusion_body_normal_direction(diffusion_body, diffusion_body_shape); SimpleDynamics Robin_normal_direction_in(boundary_Robin_in, boundary_in_shape); SimpleDynamics Robin_normal_direction_ex(boundary_Robin_ex, boundary_ex_shape); diff --git a/tests/2d_examples/test_2d_windows_frame_diffusion_D7/windows_frame_diffusion_D7.cpp b/tests/2d_examples/test_2d_windows_frame_diffusion_D7/windows_frame_diffusion_D7.cpp index 90cc6c3615..027eac5a48 100644 --- a/tests/2d_examples/test_2d_windows_frame_diffusion_D7/windows_frame_diffusion_D7.cpp +++ b/tests/2d_examples/test_2d_windows_frame_diffusion_D7/windows_frame_diffusion_D7.cpp @@ -51,7 +51,7 @@ int main(int ac, char *av[]) // Define the main numerical methods used in the simulation. // Note that there may be data dependence on the constructors of these methods. //---------------------------------------------------------------------- - + SimpleDynamics diffusion_body_normal_direction(diffusion_body, diffusion_body_shape); SimpleDynamics Robin_normal_direction_in(boundary_Robin_in, boundary_in_shape); SimpleDynamics Robin_normal_direction_ex(boundary_Robin_ex, boundary_ex_shape); diff --git a/tests/3d_examples/test_3d_beam_pulling_pressure_load/beam_pulling_pressure_load.cpp b/tests/3d_examples/test_3d_beam_pulling_pressure_load/beam_pulling_pressure_load.cpp index 89f671cf87..345b49d929 100644 --- a/tests/3d_examples/test_3d_beam_pulling_pressure_load/beam_pulling_pressure_load.cpp +++ b/tests/3d_examples/test_3d_beam_pulling_pressure_load/beam_pulling_pressure_load.cpp @@ -117,7 +117,8 @@ int main(int ac, char *av[]) IOEnvironment io_environment(sph_system); /** Import a beam body, with corresponding material and particles. */ - SolidBody beam_body(sph_system, makeShared("beam")); + Beam beam_body_shape("Beam"); + SolidBody beam_body(sph_system, beam_body_shape.getName()); beam_body.defineMaterial(rho, Youngs_modulus, poisson_ratio); beam_body.generateParticles(beam_body_shape); diff --git a/tests/3d_examples/test_3d_bending_circular_plate_parametric_cvt/test_3d_bending_circular_plate_parametric_cvt.cpp b/tests/3d_examples/test_3d_bending_circular_plate_parametric_cvt/test_3d_bending_circular_plate_parametric_cvt.cpp index bfd949c59d..eb321c76db 100644 --- a/tests/3d_examples/test_3d_bending_circular_plate_parametric_cvt/test_3d_bending_circular_plate_parametric_cvt.cpp +++ b/tests/3d_examples/test_3d_bending_circular_plate_parametric_cvt/test_3d_bending_circular_plate_parametric_cvt.cpp @@ -230,13 +230,10 @@ return_data bending_circular_plate(Real dp_ratio) std::cout << "bb_system.first_: " << bb_system.first_ << std::endl; std::cout << "bb_system.second_: " << bb_system.second_ << std::endl; - // shell - auto shell_shape = makeShared("shell_shape" + std::to_string(int(dp_ratio * 1e3))); // keep all data for parameter study - // starting the actual simulation SPHSystem system(bb_system, dp); system.setIOEnvironment(false); - SolidBody shell_body(system, shell_shape); + SolidBody shell_body(system, "shell_shape" + std::to_string(int(dp_ratio * 1e3))); shell_body.defineMaterial(rho, E, mu); shell_body.generateParticles(obj_vertices, sym_vec, particle_area, thickness); auto shell_particles = dynamic_cast(&shell_body.getBaseParticles()); diff --git a/tests/3d_examples/test_3d_dambreak/dambreak.cpp b/tests/3d_examples/test_3d_dambreak/dambreak.cpp index ab9d01a8fa..696d5c8919 100644 --- a/tests/3d_examples/test_3d_dambreak/dambreak.cpp +++ b/tests/3d_examples/test_3d_dambreak/dambreak.cpp @@ -72,8 +72,8 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating bodies with corresponding materials and particles. //---------------------------------------------------------------------- - WaterBlock initial_water_block("WaterBody"); - FluidBody water_block(sph_system, initial_water_block.getName()); + WaterBlock water_block_shape("WaterBody"); + FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f); water_block.generateParticles(water_block_shape); diff --git a/tests/3d_examples/test_3d_dambreak_elastic_plate_shell/test_3d_dambreak_elastic_plate_shell.cpp b/tests/3d_examples/test_3d_dambreak_elastic_plate_shell/test_3d_dambreak_elastic_plate_shell.cpp index b12b7e97a7..8a1c58a156 100644 --- a/tests/3d_examples/test_3d_dambreak_elastic_plate_shell/test_3d_dambreak_elastic_plate_shell.cpp +++ b/tests/3d_examples/test_3d_dambreak_elastic_plate_shell/test_3d_dambreak_elastic_plate_shell.cpp @@ -172,9 +172,10 @@ int main(int ac, char *av[]) wall_boundary.defineMaterial(); wall_boundary.generateParticles(wall_boundary_shape); - SolidBody gate(sph_system, makeShared("Gate")); + MovingGate gate_shape("Gate"); + SolidBody gate(sph_system, gate_shape.getName()); gate.defineMaterial(); - gate.generateParticles(); + gate.generateParticles(gate_shape); SolidBody plate(sph_system, "Plate"); plate.defineAdaptation(1.15, resolution_ref / resolution_shell); @@ -216,7 +217,7 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // solid SimpleDynamics wall_boundary_normal_direction(wall_boundary, wall_boundary_shape); - SimpleDynamics gate_normal_direction(gate); + SimpleDynamics gate_normal_direction(gate, gate_shape); SimpleDynamics update_gate_position(gate); // Shell InteractionDynamics plate_corrected_configuration(plate_inner); diff --git a/tests/3d_examples/test_3d_elasticSolid_shell_collision/3d_elasticSolid_shell_collision.cpp b/tests/3d_examples/test_3d_elasticSolid_shell_collision/3d_elasticSolid_shell_collision.cpp index c50a2a98f6..2137c4a7ba 100644 --- a/tests/3d_examples/test_3d_elasticSolid_shell_collision/3d_elasticSolid_shell_collision.cpp +++ b/tests/3d_examples/test_3d_elasticSolid_shell_collision/3d_elasticSolid_shell_collision.cpp @@ -78,7 +78,10 @@ int main(int ac, char *av[]) shell.defineMaterial(); shell.generateParticles(); - SolidBody ball(sph_system, makeShared(ball_center, ball_radius, "BallBody")); + GeometricShapeBall ball_shape(ball_center, ball_radius, "BallBody"); + SolidBody ball(sph_system, ball_shape.getName()); + LevelSetShape level_set_shape(ball, ball_shape); + level_set_shape.writeLevelSet(sph_system); ball.defineMaterial(rho0_s, Youngs_modulus, poisson); if (!sph_system.RunParticleRelaxation() && sph_system.ReloadParticles()) { @@ -86,8 +89,7 @@ int main(int ac, char *av[]) } else { - ball.defineBodyLevelSetShape()->writeLevelSet(sph_system); - ball.generateParticles(); + ball.generateParticles(level_set_shape); } ObserverBody ball_observer(sph_system, "BallObserver"); @@ -106,7 +108,7 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- using namespace relax_dynamics; SimpleDynamics ball_random_particles(ball); - RelaxationStepInner ball_relaxation_step_inner(ball_inner); + RelaxationStepInner ball_relaxation_step_inner(ball_inner, level_set_shape); //---------------------------------------------------------------------- // Output for particle relaxation. //---------------------------------------------------------------------- @@ -143,7 +145,7 @@ int main(int ac, char *av[]) // Generally, we first define all the inner relations, then the contact relations. //---------------------------------------------------------------------- InnerRelation ball_inner(ball); - ShellSurfaceContactRelation ball_contact(ball, {&shell}); + ShellSurfaceContactRelation ball_contact(ball, level_set_shape, {&shell}); ContactRelation ball_observer_contact(ball_observer, {&ball}); //---------------------------------------------------------------------- // Define the main numerical methods used in the simulation. diff --git a/tests/3d_examples/test_3d_muscle_activation/src/muscle_activation.cpp b/tests/3d_examples/test_3d_muscle_activation/src/muscle_activation.cpp index 7ca8162c22..cf0b734624 100644 --- a/tests/3d_examples/test_3d_muscle_activation/src/muscle_activation.cpp +++ b/tests/3d_examples/test_3d_muscle_activation/src/muscle_activation.cpp @@ -66,9 +66,9 @@ int main(int ac, char *av[]) // Creating bodies with corresponding materials and particles. //---------------------------------------------------------------------- TransformShape muscle_body_shape(Transform(translation_myocardium), halfsize_myocardium, "MyocardiumMuscleBody"); - SolidBody muscle_body(sph_system, muscle_body_shape); + SolidBody muscle_body(sph_system, muscle_body_shape.getName()); muscle_body.defineMaterial>(rho0_s, bulk_modulus, fiber_direction, sheet_direction, a0, b0); - muscle_body.generateParticles(); + muscle_body.generateParticles(muscle_body_shape); //---------------------------------------------------------------------- // Define body relation map. // The contact map gives the topological connections between the bodies. diff --git a/tests/3d_examples/test_3d_muscle_soft_body_contact/muscle_soft_body_contact.cpp b/tests/3d_examples/test_3d_muscle_soft_body_contact/muscle_soft_body_contact.cpp index 740ed399d3..7b62cf10ef 100644 --- a/tests/3d_examples/test_3d_muscle_soft_body_contact/muscle_soft_body_contact.cpp +++ b/tests/3d_examples/test_3d_muscle_soft_body_contact/muscle_soft_body_contact.cpp @@ -62,14 +62,16 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating bodies with corresponding materials and particles. //---------------------------------------------------------------------- - SolidBody myocardium_body(sph_system, makeShared("MyocardiumBody")); + Myocardium myocardium_body_shape("MyocardiumBody"); + SolidBody myocardium_body(sph_system, myocardium_body_shape.getName()); myocardium_body.defineMaterial(rho0_s, Youngs_modulus, poisson); - myocardium_body.generateParticles(); + myocardium_body.generateParticles(myocardium_body_shape); - SolidBody moving_plate(sph_system, makeShared("MovingPlate")); + MovingPlate moving_plate_shape("MovingPlate"); + SolidBody moving_plate(sph_system, moving_plate_shape.getName()); moving_plate.defineAdaptationRatios(1.15, 1.5); moving_plate.defineMaterial(rho0_s, Youngs_modulus, poisson); - moving_plate.generateParticles(); + moving_plate.generateParticles(moving_plate_shape); //---------------------------------------------------------------------- // Define body relation map. // The contact map gives the topological connections between the bodies. @@ -78,8 +80,8 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- InnerRelation myocardium_body_inner(myocardium_body); InnerRelation moving_plate_inner(moving_plate); - SurfaceContactRelation myocardium_plate_contact(myocardium_body, {&moving_plate}); - SurfaceContactRelation plate_myocardium_contact(moving_plate, {&myocardium_body}); + SurfaceContactRelation myocardium_plate_contact(myocardium_body, myocardium_body_shape, {&moving_plate}); + SurfaceContactRelation plate_myocardium_contact(moving_plate, moving_plate_shape, {&myocardium_body}); //---------------------------------------------------------------------- // Define the numerical methods used in the simulation. // Note that there may be data dependence on the sequence of constructions. diff --git a/tests/3d_examples/test_3d_muscle_solid_contact/muscle_solid_contact.cpp b/tests/3d_examples/test_3d_muscle_solid_contact/muscle_solid_contact.cpp index 4eeb4b0cd6..79ccb4ac0e 100644 --- a/tests/3d_examples/test_3d_muscle_solid_contact/muscle_solid_contact.cpp +++ b/tests/3d_examples/test_3d_muscle_solid_contact/muscle_solid_contact.cpp @@ -62,13 +62,15 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating bodies with corresponding materials and particles. //---------------------------------------------------------------------- - SolidBody myocardium_body(sph_system, makeShared("MyocardiumBody")); + Myocardium myocardium_body_shape("MyocardiumBody"); + SolidBody myocardium_body(sph_system, myocardium_body_shape.getName()); myocardium_body.defineMaterial(rho0_s, Youngs_modulus, poisson); - myocardium_body.generateParticles(); + myocardium_body.generateParticles(myocardium_body_shape); - SolidBody moving_plate(sph_system, makeShared("MovingPlate")); + MovingPlate moving_plate_shape("MovingPlate"); + SolidBody moving_plate(sph_system, moving_plate_shape.getName()); moving_plate.defineMaterial(rho0_s, Youngs_modulus, poisson); - moving_plate.generateParticles(); + moving_plate.generateParticles(moving_plate_shape); //---------------------------------------------------------------------- // Define body relation map. // The contact map gives the topological connections between the bodies. @@ -76,8 +78,8 @@ int main(int ac, char *av[]) // Generally, we first define all the inner relations, then the contact relations. //---------------------------------------------------------------------- InnerRelation myocardium_body_inner(myocardium_body); - SurfaceContactRelation myocardium_plate_contact(myocardium_body, {&moving_plate}); - SurfaceContactRelation plate_myocardium_contact(moving_plate, {&myocardium_body}); + SurfaceContactRelation myocardium_plate_contact(myocardium_body, myocardium_body_shape, {&moving_plate}); + SurfaceContactRelation plate_myocardium_contact(moving_plate, moving_plate_shape, {&myocardium_body}); //---------------------------------------------------------------------- // Define the numerical methods used in the simulation. // Note that there may be data dependence on the sequence of constructions. @@ -117,8 +119,7 @@ int main(int ac, char *av[]) SimTK::GeneralForceSubsystem forces(MBsystem); SimTK::CableTrackerSubsystem cables(MBsystem); /** mass properties of the fixed spot. */ - TransformShape moving_plate_shape(Transform(translation_moving_plate), halfsize_moving_plate, "Plate"); - SimpleDynamics moving_plate_normal_direction(moving_plate); + SimpleDynamics moving_plate_normal_direction(moving_plate, moving_plate_shape); SolidBodyPartForSimbody plate_multibody(moving_plate, moving_plate_shape); /** Mass properties of the constrained spot. * SimTK::MassProperties(mass, center of mass, inertia) diff --git a/tests/3d_examples/test_3d_network/network.cpp b/tests/3d_examples/test_3d_network/network.cpp index 26984ed6fd..5a2611edde 100644 --- a/tests/3d_examples/test_3d_network/network.cpp +++ b/tests/3d_examples/test_3d_network/network.cpp @@ -51,9 +51,11 @@ int main(int ac, char *av[]) SPHSystem sph_system(system_domain_bounds, dp_0); sph_system.handleCommandlineOptions(ac, av)->setIOEnvironment(); /** Creat a body, corresponding material and particles. */ - TreeBody tree_on_sphere(sph_system, makeShared(Vec3d::Zero(), 1.0, "Sphere")); - tree_on_sphere.defineBodyLevelSetShape()->writeLevelSet(sph_system); - tree_on_sphere.generateParticles(starting_point, second_point, iteration_levels, grad_factor); + GeometricShapeBall ball_shape(Vec3d::Zero(), 1.0, "Sphere"); + TreeBody tree_on_sphere(sph_system, ball_shape.getName()); + LevelSetShape level_set_shape(tree_on_sphere, ball_shape); + level_set_shape.writeLevelSet(sph_system); + tree_on_sphere.generateParticles(ball_shape, starting_point, second_point, iteration_levels, grad_factor); /** Write particle data. */ BodyStatesRecordingToVtp write_states(sph_system); write_states.writeToFile(0); diff --git a/tests/3d_examples/test_3d_passive_cantilever/passive_cantilever.cpp b/tests/3d_examples/test_3d_passive_cantilever/passive_cantilever.cpp index 4e86c3aa8f..b1155a52d0 100644 --- a/tests/3d_examples/test_3d_passive_cantilever/passive_cantilever.cpp +++ b/tests/3d_examples/test_3d_passive_cantilever/passive_cantilever.cpp @@ -73,9 +73,10 @@ int main(int ac, char *av[]) SPHSystem sph_system(system_domain_bounds, resolution_ref); sph_system.handleCommandlineOptions(ac, av); /** create a Cantilever body, corresponding material, particles and reaction model. */ - SolidBody cantilever_body(sph_system, makeShared("CantileverBody")); + Cantilever cantilever_body_shape("CantileverBody"); + SolidBody cantilever_body(sph_system, cantilever_body_shape.getName()); cantilever_body.defineMaterial(rho0_s, bulk_modulus, fiber_direction, sheet_direction, a0, b0); - cantilever_body.generateParticles(); + cantilever_body.generateParticles(cantilever_body_shape); /** Define Observer. */ ObserverBody cantilever_observer(sph_system, "CantileverObserver"); cantilever_observer.generateParticles(observation_location); diff --git a/tests/3d_examples/test_3d_passive_cantilever_neohookean/passive_cantilever_neohookean.cpp b/tests/3d_examples/test_3d_passive_cantilever_neohookean/passive_cantilever_neohookean.cpp index 8df0a264aa..08610f6767 100644 --- a/tests/3d_examples/test_3d_passive_cantilever_neohookean/passive_cantilever_neohookean.cpp +++ b/tests/3d_examples/test_3d_passive_cantilever_neohookean/passive_cantilever_neohookean.cpp @@ -54,9 +54,10 @@ int main(int ac, char *av[]) #endif /** output environment. */ /** create a Cantilever body, corresponding material, particles and reaction model. */ - SolidBody cantilever_body(sph_system, makeShared("CantileverBody")); + Cantilever cantilever_body_shape("CantileverBody"); + SolidBody cantilever_body(sph_system, cantilever_body_shape.getName()); cantilever_body.defineMaterial(rho0_s, Youngs_modulus, poisson); - cantilever_body.generateParticles(); + cantilever_body.generateParticles(cantilever_body_shape); /** Define Observer. */ ObserverBody cantilever_observer(sph_system, "CantileverObserver"); cantilever_observer.generateParticles(observation_location); diff --git a/tests/extra_source_and_tests/test_2d_T_pipe_VIPO_shell/T_pipe_VIPO_shell.cpp b/tests/extra_source_and_tests/test_2d_T_pipe_VIPO_shell/T_pipe_VIPO_shell.cpp index 8aaa8ff2cb..48515c41b2 100644 --- a/tests/extra_source_and_tests/test_2d_T_pipe_VIPO_shell/T_pipe_VIPO_shell.cpp +++ b/tests/extra_source_and_tests/test_2d_T_pipe_VIPO_shell/T_pipe_VIPO_shell.cpp @@ -261,11 +261,10 @@ int main(int ac, char *av[]) FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f, mu_f); ParticleBuffer in_outlet_particle_buffer(0.5); - water_block.generateParticlesWithReserve(in_outlet_particle_buffer); + water_block.generateParticlesWithReserve(in_outlet_particle_buffer, water_block_shape); - SolidBody shell_body(sph_system, makeShared("ShellBody")); + SolidBody shell_body(sph_system, "ShellBody"); shell_body.defineAdaptation(1.15, resolution_ref / resolution_shell); - shell_body.defineBodyLevelSetShape(level_set_refinement_ratio)->writeLevelSet(sph_system); shell_body.defineMaterial(rho0_s, Youngs_modulus, poisson); shell_body.generateParticles(resolution_shell, BW); diff --git a/tests/extra_source_and_tests/test_2d_membrane/2d_membrane.cpp b/tests/extra_source_and_tests/test_2d_membrane/2d_membrane.cpp index 0ea65f3ae6..f7a3ebc47c 100644 --- a/tests/extra_source_and_tests/test_2d_membrane/2d_membrane.cpp +++ b/tests/extra_source_and_tests/test_2d_membrane/2d_membrane.cpp @@ -138,7 +138,8 @@ int main(int ac, char *av[]) //---------------------------------------------------------------------- // Creating body, materials and particles. //---------------------------------------------------------------------- - SolidBody beam_body(sph_system, makeShared("2dMembrane")); + Beam beam_body_shape("2dMembraneBase"); + SolidBody beam_body(sph_system, beam_body_shape.getName()); beam_body.defineMaterial( rho_0, Youngs_modulus, poisson, diffusivity_constant_, fluid_initial_density_, water_pressure_constant_); beam_body.generateParticles(beam_body_shape); diff --git a/tests/extra_source_and_tests/test_2d_mixed_poiseuille_flow/mixed_poiseuille_flow.cpp b/tests/extra_source_and_tests/test_2d_mixed_poiseuille_flow/mixed_poiseuille_flow.cpp index 1b680964c3..8dbc2d049b 100644 --- a/tests/extra_source_and_tests/test_2d_mixed_poiseuille_flow/mixed_poiseuille_flow.cpp +++ b/tests/extra_source_and_tests/test_2d_mixed_poiseuille_flow/mixed_poiseuille_flow.cpp @@ -153,7 +153,7 @@ int main(int ac, char *av[]) FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f, mu_f); ParticleBuffer in_outlet_particle_buffer(0.5); - water_block.generateParticlesWithReserve(in_outlet_particle_buffer); + water_block.generateParticlesWithReserve(in_outlet_particle_buffer, water_block_shape); WallBoundary wall_boundary_shape("WallBoundary"); SolidBody wall_boundary(sph_system, wall_boundary_shape.getName()); diff --git a/tests/extra_source_and_tests/test_2d_modified_T_flow/modified_T_flow.cpp b/tests/extra_source_and_tests/test_2d_modified_T_flow/modified_T_flow.cpp index 354e7b966f..297ae78282 100644 --- a/tests/extra_source_and_tests/test_2d_modified_T_flow/modified_T_flow.cpp +++ b/tests/extra_source_and_tests/test_2d_modified_T_flow/modified_T_flow.cpp @@ -154,7 +154,7 @@ int main(int ac, char *av[]) FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f, mu_f); ParticleBuffer in_outlet_particle_buffer(0.5); - water_block.generateParticlesWithReserve(in_outlet_particle_buffer); + water_block.generateParticlesWithReserve(in_outlet_particle_buffer, water_block_shape); WallBoundary wall_boundary_shape("WallBoundary"); SolidBody wall_boundary(sph_system, wall_boundary_shape.getName()); diff --git a/tests/extra_source_and_tests/test_2d_pulsatile_poiseuille_flow/pulsatile_poiseuille_flow.cpp b/tests/extra_source_and_tests/test_2d_pulsatile_poiseuille_flow/pulsatile_poiseuille_flow.cpp index a2c73e688d..f57c71b65d 100644 --- a/tests/extra_source_and_tests/test_2d_pulsatile_poiseuille_flow/pulsatile_poiseuille_flow.cpp +++ b/tests/extra_source_and_tests/test_2d_pulsatile_poiseuille_flow/pulsatile_poiseuille_flow.cpp @@ -136,7 +136,7 @@ int main(int ac, char *av[]) FluidBody water_block(sph_system, water_block_shape.getName()); water_block.defineMaterial(rho0_f, c_f, mu_f); ParticleBuffer in_outlet_particle_buffer(0.5); - water_block.generateParticlesWithReserve(in_outlet_particle_buffer); + water_block.generateParticlesWithReserve(in_outlet_particle_buffer, water_block_shape); WallBoundary wall_boundary_shape("WallBoundary"); SolidBody wall_boundary(sph_system, wall_boundary_shape.getName()); diff --git a/tests/extra_source_and_tests/test_3d_passive_cantilever_LG/passive_cantilever_LG.cpp b/tests/extra_source_and_tests/test_3d_passive_cantilever_LG/passive_cantilever_LG.cpp index 148e449045..e92c3698fd 100644 --- a/tests/extra_source_and_tests/test_3d_passive_cantilever_LG/passive_cantilever_LG.cpp +++ b/tests/extra_source_and_tests/test_3d_passive_cantilever_LG/passive_cantilever_LG.cpp @@ -73,11 +73,12 @@ int main(int ac, char *av[]) SPHSystem sph_system(system_domain_bounds, resolution_ref); sph_system.handleCommandlineOptions(ac, av); /** create a Cantilever body, corresponding material, particles and reaction model. */ - SolidBody cantilever_body(sph_system, makeShared("CantileverBody")); + Cantilever cantilever_body_shape("CantileverBody"); + SolidBody cantilever_body(sph_system, cantilever_body_shape.getName()); cantilever_body.defineAdaptationRatios(1.3, 1.0); cantilever_body.sph_adaptation_->resetKernel>(20); cantilever_body.defineMaterial(rho0_s, bulk_modulus, fiber_direction, sheet_direction, a0, b0); - cantilever_body.generateParticles(); + cantilever_body.generateParticles(cantilever_body_shape); /** Define Observer. */ ObserverBody cantilever_observer(sph_system, "CantileverObserver"); cantilever_observer.generateParticles(observation_location); diff --git a/tests/unit_tests_src/for_3D_build/meshes/test_3d_particle_for_split/test_particle_for_split.cpp b/tests/unit_tests_src/for_3D_build/meshes/test_3d_particle_for_split/test_particle_for_split.cpp index ef4c9264e4..ed6ac9d0e2 100644 --- a/tests/unit_tests_src/for_3D_build/meshes/test_3d_particle_for_split/test_particle_for_split.cpp +++ b/tests/unit_tests_src/for_3D_build/meshes/test_3d_particle_for_split/test_particle_for_split.cpp @@ -8,15 +8,15 @@ TEST(test_meshes, split_for) Real length = 10; Real dp = 1; - auto shape = makeShared(0.5 * length * Vec3d::Ones(), "Shape"); + GeometricShapeBox shape(0.5 * length * Vec3d::Ones(), "Shape"); - BoundingBox bb_system = shape->getBounds(); + BoundingBox bb_system = shape.getBounds(); SPHSystem system(bb_system, dp); - SolidBody body(system, shape); + SolidBody body(system, shape.getName()); body.defineMaterial(); - body.generateParticles(); + body.generateParticles(shape); auto &particles = body.getBaseParticles(); const auto pos = particles.registerStateVariable("Position"); auto quantity = particles.registerStateVariable("Quantity", [&](size_t i) -> Real