Skip to content

Commit

Permalink
Merge pull request #162 from yencal/main
Browse files Browse the repository at this point in the history
Bug fix and enhancement
  • Loading branch information
nathanielmorgan authored Feb 8, 2024
2 parents 4bfb34c + 20dad80 commit 772fc5b
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/EVP/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
set(SRC_Files UserEOSModel.cpp UserStrengthModel.cpp init_state_vars.cpp chg_basis.cpp evpal.cpp)
add_library(user_material_models OBJECT ${SRC_Files})
target_include_directories(user_material_models PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(user_material_models Elements)
4 changes: 2 additions & 2 deletions src/EVP/src/init_state_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::vector<std::string> split (std::string s, std::string delimiter);
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems)
Expand Down Expand Up @@ -412,7 +412,7 @@ void init_state_vars(
//});
}
Kokkos::fence();
//state_vars.update_host();
state_vars.update_host();

printf("user_mat_init completed\n");

Expand Down
3 changes: 2 additions & 1 deletion src/EVPFFT/src/Fierro-EVPFFT-Link/init_state_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using namespace mtr;
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems)
Expand All @@ -20,6 +20,7 @@ void init_state_vars(
state_vars.host(elem_gid,var) = 0.0;
}
}
state_vars.update_device();

return;
}
3 changes: 2 additions & 1 deletion src/LS-EVPFFT/src/Fierro-LS-EVPFFT-Link/init_state_vars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using namespace mtr;
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems)
Expand All @@ -20,6 +20,7 @@ void init_state_vars(
state_vars.host(elem_gid,var) = 0.0;
}
}
state_vars.update_device();

return;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using namespace mtr;
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems)
Expand All @@ -20,6 +20,7 @@ void init_state_vars(
state_vars.host(elem_gid,var) = 0.0;
}
}
state_vars.update_device();

return;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using namespace mtr;
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems)
Expand All @@ -20,6 +20,7 @@ void init_state_vars(
state_vars.host(elem_gid,var) = 0.0;
}
}
state_vars.update_device();

return;
}
2 changes: 1 addition & 1 deletion src/Parallel-Solvers/Material-Models/material_models.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct strength_t {
void init_state_vars(
const DCArrayKokkos <material_t> &material,
const DViewCArrayKokkos <size_t> &elem_mat_id,
const DCArrayKokkos <double> &state_vars,
DCArrayKokkos <double> &state_vars,
const DCArrayKokkos <double> &global_vars,
const DCArrayKokkos <double> &elem_user_output_vars,
const size_t num_elems);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 772fc5b

Please sign in to comment.