From 73eee6a3181c3e955e9995b33a90354a2fbe42a1 Mon Sep 17 00:00:00 2001 From: Sam Reeve <6740307+streeve@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:43:08 -0400 Subject: [PATCH] Add temperature field --- src/CabanaPD_Particles.hpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/CabanaPD_Particles.hpp b/src/CabanaPD_Particles.hpp index 5ec97f1f..80da266c 100644 --- a/src/CabanaPD_Particles.hpp +++ b/src/CabanaPD_Particles.hpp @@ -99,9 +99,9 @@ class Particles using scalar_type = Cabana::MemberTypes; // no-fail. using int_type = Cabana::MemberTypes; - // type, W, v, rho, damage. + // v, W, rho, damage, temperature, type. using other_types = - Cabana::MemberTypes; + Cabana::MemberTypes; // Potentially needed later: body force (b), ID. // FIXME: add vector length. @@ -220,6 +220,7 @@ class Particles auto y = sliceCurrentPosition(); auto vol = sliceVolume(); auto nofail = sliceNoFail(); + auto temp = sliceNoFail(); auto created = Kokkos::View( Kokkos::ViewAllocateWithoutInitializing( "particle_created" ), @@ -260,6 +261,7 @@ class Particles type( pid ) = 0; nofail( pid ) = 0; rho( pid ) = 1.0; + temp( pid ) = 0.0; // Get the volume of the cell. int empty[3]; @@ -337,8 +339,8 @@ class Particles { return Cabana::slice<0>( _aosoa_vol, "volume" ); } - auto sliceType() { return Cabana::slice<0>( _aosoa_other, "type" ); } - auto sliceType() const { return Cabana::slice<0>( _aosoa_other, "type" ); } + auto sliceType() { return Cabana::slice<5>( _aosoa_other, "type" ); } + auto sliceType() const { return Cabana::slice<5>( _aosoa_other, "type" ); } auto sliceStrainEnergy() { return Cabana::slice<1>( _aosoa_other, "strain_energy" ); @@ -349,21 +351,29 @@ class Particles } auto sliceVelocity() { - return Cabana::slice<2>( _aosoa_other, "velocities" ); + return Cabana::slice<0>( _aosoa_other, "velocities" ); } auto sliceVelocity() const { - return Cabana::slice<2>( _aosoa_other, "velocities" ); + return Cabana::slice<0>( _aosoa_other, "velocities" ); } - auto sliceDensity() { return Cabana::slice<3>( _aosoa_other, "density" ); } + auto sliceDensity() { return Cabana::slice<2>( _aosoa_other, "density" ); } auto sliceDensity() const { - return Cabana::slice<3>( _aosoa_other, "density" ); + return Cabana::slice<2>( _aosoa_other, "density" ); } - auto sliceDamage() { return Cabana::slice<4>( _aosoa_other, "damage" ); } + auto sliceDamage() { return Cabana::slice<3>( _aosoa_other, "damage" ); } auto sliceDamage() const { - return Cabana::slice<4>( _aosoa_other, "damage" ); + return Cabana::slice<3>( _aosoa_other, "damage" ); + } + auto sliceTemperature() + { + return Cabana::slice<4>( _aosoa_other, "temperature" ); + } + auto sliceTemperature() const + { + return Cabana::slice<4>( _aosoa_other, "temperature" ); } auto sliceNoFail() {