From b29d9029e0135bb9676d72f9d2bb7e917bb9da60 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:38:22 -0400 Subject: [PATCH] DO NOT MERGE; test with KW --- examples/mechanics/kalthoff_winkler.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/mechanics/kalthoff_winkler.cpp b/examples/mechanics/kalthoff_winkler.cpp index 9da84ce1..856a349f 100644 --- a/examples/mechanics/kalthoff_winkler.cpp +++ b/examples/mechanics/kalthoff_winkler.cpp @@ -76,23 +76,26 @@ void kalthoffWinklerExample( const std::string filename ) CabanaPD::Prenotch<2> prenotch( v1, v2, notch_positions ); // ==================================================== - // Force model + // Force model options // ==================================================== - using model_type = CabanaPD::ForceModel; - model_type force_model( delta, K, G0 ); - // using model_type = - // CabanaPD::ForceModel; - // model_type force_model( delta, K, G, G0 ); + using model_type = CabanaPD::PMB; + using thermal_type = CabanaPD::TemperatureIndependent; // ==================================================== // Particle generation // ==================================================== // Does not set displacements, velocities, etc. auto particles = std::make_shared< - CabanaPD::Particles>( + CabanaPD::Particles>( exec_space(), low_corner, high_corner, num_cells, halo_width ); + std::array same_d = { delta, delta }; + std::array fake_K = { K, K * 1.2 }; + std::array fake_G0 = { G0, G0 * 1.8 }; + auto force_model = + createForceModel( model_type{}, CabanaPD::Fracture{}, thermal_type{}, + *particles, same_d, fake_K, fake_G0 ); + // ==================================================== // Boundary conditions // ==================================================== @@ -112,6 +115,7 @@ void kalthoffWinklerExample( const std::string filename ) auto x = particles->sliceReferencePosition(); auto v = particles->sliceVelocity(); auto f = particles->sliceForce(); + auto type = particles->sliceType(); double v0 = inputs["impactor_velocity"]; auto init_functor = KOKKOS_LAMBDA( const int pid ) @@ -122,6 +126,8 @@ void kalthoffWinklerExample( const std::string filename ) if ( x( pid, 1 ) > y_prenotch1 && x( pid, 1 ) < y_prenotch2 && x( pid, 0 ) < -0.5 * height + dx ) v( pid, 0 ) = v0; + if ( x( pid, 1 ) > 0.0 ) + type( pid ) = 1; }; particles->updateParticles( exec_space{}, init_functor );