From 20dad80da9676875a9631d87087f7c54496b50ab Mon Sep 17 00:00:00 2001 From: yencal Date: Wed, 7 Feb 2024 16:45:16 -0700 Subject: [PATCH] user has full control of state_vars now --- src/EVP/src/init_state_vars.cpp | 4 ++-- src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp | 3 ++- src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp | 3 ++- .../Material-Models/Ideal-Gas-Models/init_state_vars.cpp | 3 ++- .../Material-Models/User-Material-Models/init_state_vars.cpp | 3 ++- src/Parallel-Solvers/Material-Models/material_models.h | 2 +- .../Dynamic_Elastic_Solver/FEA_Module_Dynamic_Elasticity.cpp | 1 - .../Parallel-Explicit/SGH_Solver/FEA_Module_SGH.cpp | 1 - 8 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/EVP/src/init_state_vars.cpp b/src/EVP/src/init_state_vars.cpp index cb3d54b12..bf6154b32 100644 --- a/src/EVP/src/init_state_vars.cpp +++ b/src/EVP/src/init_state_vars.cpp @@ -32,7 +32,7 @@ std::vector split (std::string s, std::string delimiter); void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems) @@ -412,7 +412,7 @@ void init_state_vars( //}); } Kokkos::fence(); - //state_vars.update_host(); + state_vars.update_host(); printf("user_mat_init completed\n"); diff --git a/src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp b/src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp index 19d493a3c..f7cde4d41 100644 --- a/src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp +++ b/src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp @@ -6,7 +6,7 @@ using namespace mtr; void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems) @@ -20,6 +20,7 @@ void init_state_vars( state_vars.host(elem_gid,var) = 0.0; } } + state_vars.update_device(); return; } diff --git a/src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp b/src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp index 19d493a3c..f7cde4d41 100644 --- a/src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp +++ b/src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp @@ -6,7 +6,7 @@ using namespace mtr; void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems) @@ -20,6 +20,7 @@ void init_state_vars( state_vars.host(elem_gid,var) = 0.0; } } + state_vars.update_device(); return; } diff --git a/src/Parallel-Solvers/Material-Models/Ideal-Gas-Models/init_state_vars.cpp b/src/Parallel-Solvers/Material-Models/Ideal-Gas-Models/init_state_vars.cpp index 19d493a3c..f7cde4d41 100644 --- a/src/Parallel-Solvers/Material-Models/Ideal-Gas-Models/init_state_vars.cpp +++ b/src/Parallel-Solvers/Material-Models/Ideal-Gas-Models/init_state_vars.cpp @@ -6,7 +6,7 @@ using namespace mtr; void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems) @@ -20,6 +20,7 @@ void init_state_vars( state_vars.host(elem_gid,var) = 0.0; } } + state_vars.update_device(); return; } diff --git a/src/Parallel-Solvers/Material-Models/User-Material-Models/init_state_vars.cpp b/src/Parallel-Solvers/Material-Models/User-Material-Models/init_state_vars.cpp index 19d493a3c..f7cde4d41 100644 --- a/src/Parallel-Solvers/Material-Models/User-Material-Models/init_state_vars.cpp +++ b/src/Parallel-Solvers/Material-Models/User-Material-Models/init_state_vars.cpp @@ -6,7 +6,7 @@ using namespace mtr; void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems) @@ -20,6 +20,7 @@ void init_state_vars( state_vars.host(elem_gid,var) = 0.0; } } + state_vars.update_device(); return; } diff --git a/src/Parallel-Solvers/Material-Models/material_models.h b/src/Parallel-Solvers/Material-Models/material_models.h index 37c1e36e3..36bb996fb 100644 --- a/src/Parallel-Solvers/Material-Models/material_models.h +++ b/src/Parallel-Solvers/Material-Models/material_models.h @@ -143,7 +143,7 @@ struct strength_t { void init_state_vars( const DCArrayKokkos &material, const DViewCArrayKokkos &elem_mat_id, - const DCArrayKokkos &state_vars, + DCArrayKokkos &state_vars, const DCArrayKokkos &global_vars, const DCArrayKokkos &elem_user_output_vars, const size_t num_elems); diff --git a/src/Parallel-Solvers/Parallel-Explicit/Dynamic_Elastic_Solver/FEA_Module_Dynamic_Elasticity.cpp b/src/Parallel-Solvers/Parallel-Explicit/Dynamic_Elastic_Solver/FEA_Module_Dynamic_Elasticity.cpp index aab8dd9ce..e09c67741 100644 --- a/src/Parallel-Solvers/Parallel-Explicit/Dynamic_Elastic_Solver/FEA_Module_Dynamic_Elasticity.cpp +++ b/src/Parallel-Solvers/Parallel-Explicit/Dynamic_Elastic_Solver/FEA_Module_Dynamic_Elasticity.cpp @@ -1054,7 +1054,6 @@ void FEA_Module_Dynamic_Elasticity::setup(){ global_vars, elem_user_output_vars, rnum_elem); - state_vars.update_device(); // initialize strength model init_strength_model(elem_strength, diff --git a/src/Parallel-Solvers/Parallel-Explicit/SGH_Solver/FEA_Module_SGH.cpp b/src/Parallel-Solvers/Parallel-Explicit/SGH_Solver/FEA_Module_SGH.cpp index 0e0a388f6..f36f7c0f3 100644 --- a/src/Parallel-Solvers/Parallel-Explicit/SGH_Solver/FEA_Module_SGH.cpp +++ b/src/Parallel-Solvers/Parallel-Explicit/SGH_Solver/FEA_Module_SGH.cpp @@ -1094,7 +1094,6 @@ void FEA_Module_SGH::setup(){ global_vars, elem_user_output_vars, rnum_elem); - state_vars.update_device(); // initialize strength model init_strength_model(elem_strength,