Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
589317b
sync builds and regression tests pass, TLQS is currently bricked
gavinwhetstone Jun 11, 2026
1f749ef
finished syncing
gavinwhetstone Jun 11, 2026
814863c
removing a debug print loop
gavinwhetstone Jun 11, 2026
ff29d8f
updated post_process call in header file to be kokkos function
gavinwhetstone Jun 11, 2026
957c8d7
moving for all in driver to a function call
gavinwhetstone Jun 12, 2026
2cf037d
making mat pt write out device friendly
gavinwhetstone Jun 12, 2026
292cc2e
missed a .host call on last commit
gavinwhetstone Jun 12, 2026
2a097d9
missed another .host call on last commit
gavinwhetstone Jun 12, 2026
b64bfd5
added a .host for calling the host memory to write out
gavinwhetstone Jun 12, 2026
06cab23
added other 2 missing .host for calling the host memory to write out
gavinwhetstone Jun 12, 2026
80d2ddc
changing to kokkos inline to try and get rid of implicit capture of this
gavinwhetstone Jun 12, 2026
0b5ede3
reverting last commit as it broke the build
gavinwhetstone Jun 12, 2026
307e768
using solver name space to try and get rid of implicit capture of thi…
gavinwhetstone Jun 12, 2026
ffb1516
making function calls static to force it to not capture this
gavinwhetstone Jun 12, 2026
b0f0e2c
made post process a static function as well to get rid of final impli…
gavinwhetstone Jun 12, 2026
3a48c01
moving initial displacement calc to the correct place in TLQS for pip…
gavinwhetstone Jun 12, 2026
25a6935
added case that warns user to the case structure in region_fill to ge…
gavinwhetstone Jun 12, 2026
847bed5
added function for state dump that only dumps requested output, need …
gavinwhetstone Jun 16, 2026
2778ed3
adjusted state dump to be dynamic based on solver required state and …
gavinwhetstone Jun 17, 2026
0f7583a
added heat flux as an output option for viz and state
gavinwhetstone Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/multiphysics/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ include_directories(material_models/artificial_viscosity)
include_directories(material_models/eos)
include_directories(material_models/erosion)
include_directories(material_models/fracture)
include_directories(material_models/strength)
include_directories(material_models/transient_strength)
include_directories(material_models/quasi_static_strength)
include_directories(material_models/equilibration)
include_directories(material_models/equilibration/include)
include_directories(material_models/tabular/include)
Expand All @@ -75,8 +76,10 @@ add_subdirectory(material_models/tabular)
# Boundary conditions
message("\n ****** ADDING BOUNDARY CONDITIONS ******** \n ")
include_directories(boundary_conditions/velocity)
include_directories(boundary_conditions/displacement)
include_directories(boundary_conditions/temperature)
include_directories(boundary_conditions/stress)
include_directories(boundary_conditions/quasi_static_stress)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class SGH3D : public Solver
Material_t& Materials,
BoundaryCondition_t& Boundary,
swage::Mesh& mesh,
State_t& State) override;
State_t& State,
elements::fe_ref_elem_t& ref_elem) override;

/////////////////////////////////////////////////////////////////////////////
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void SGH3D::execute(SimulationParameters_t& SimulationParamaters,
Material_t& Materials,
BoundaryCondition_t& BoundaryConditions,
swage::Mesh& mesh,
State_t& State)
State_t& State,
elements::fe_ref_elem_t& ref_elem)
{

// Get MPI ranks and num ranks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ class SGHRZ : public Solver
Material_t& Materials,
BoundaryCondition_t& Boundary,
swage::Mesh& mesh,
State_t& State) override;
State_t& State,
elements::fe_ref_elem_t& ref_elem) override;

/////////////////////////////////////////////////////////////////////////////
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void SGHRZ::execute(SimulationParameters_t& SimulationParamaters,
Material_t& Materials,
BoundaryCondition_t& BoundaryConditions,
swage::Mesh& mesh,
State_t& State)
State_t& State,
elements::fe_ref_elem_t& ref_elem)
{

double fuzz = SimulationParamaters.DynamicOptions.fuzz;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ class SGTM3D : public Solver
Material_t& Materials,
BoundaryCondition_t& Boundary,
swage::Mesh& mesh,
State_t& State) override;
State_t& State,
elements::fe_ref_elem_t& ref_elem) override;

/////////////////////////////////////////////////////////////////////////////
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ void SGTM3D::execute(SimulationParameters_t& SimulationParamaters,
Material_t& Materials,
BoundaryCondition_t& BoundaryConditions,
swage::Mesh& mesh,
State_t& State)
State_t& State,
elements::fe_ref_elem_t& ref_elem)
{

double fuzz = SimulationParamaters.DynamicOptions.fuzz;
Expand Down
5 changes: 5 additions & 0 deletions apps/multiphysics/src/Solvers/TLQS_solver_3D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ message("\n ****** ADDING TLQS SOURCE FILES ******** \n ")

set(TLQS_3D_SRC_Files
${CMAKE_CURRENT_SOURCE_DIR}/src/boundary.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/elem_arrays.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/cgm_functions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tlqs_execute.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/time_integration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tlqs_setup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tlqs_initialize.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/post_process.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/qr_solver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/chebyshev_smoothing.cpp
PARENT_SCOPE
)
216 changes: 186 additions & 30 deletions apps/multiphysics/src/Solvers/TLQS_solver_3D/include/tlqs_solver_3D.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ namespace TLQS3D_State
static const std::vector<node_state> required_node_state =
{
node_state::coords,
node_state::coords_t0,
node_state::displacement,
node_state::mass
};

// Gauss point state to be initialized for the TLQS solver
Expand All @@ -70,14 +73,11 @@ namespace TLQS3D_State
static const std::vector<material_pt_state> required_material_pt_state =
{
material_pt_state::density,
material_pt_state::pressure,
material_pt_state::stress,
material_pt_state::specific_internal_energy,
material_pt_state::sound_speed,
material_pt_state::strain,
material_pt_state::mass,
material_pt_state::volume_fraction,
material_pt_state::eroded_flag,
material_pt_state::shear_modulii
};

// Material corner state to be initialized for the TLQS solver
Expand All @@ -98,27 +98,14 @@ namespace TLQS3D_State
// Node state that must be filled (setup) for the SGH solver
static const std::vector<fill_node_state> required_fill_node_state =
{
fill_node_state::velocity
//fill_node_state::displacement
};

// Material point state that must be filled (setup) for the SGH solver
// option A
static const std::vector<fill_gauss_state> required_optA_fill_material_pt_state =
static const std::vector<fill_gauss_state> required_fill_material_pt_state =
{
fill_gauss_state::density,
fill_gauss_state::specific_internal_energy
};
// option B
static const std::vector<fill_gauss_state> required_optB_fill_material_pt_state =
{
fill_gauss_state::density,
fill_gauss_state::internal_energy
};
// option C
static const std::vector<fill_gauss_state> required_optC_fill_material_pt_state =
{
fill_gauss_state::density,
fill_gauss_state::stress
fill_gauss_state::density
};
// -------------------------------------

Expand All @@ -127,13 +114,13 @@ namespace TLQS3D_State

/////////////////////////////////////////////////////////////////////////////
///
/// \class SGTM
/// \class TLQS
///
/// \brief Class for containing functions required to perform staggered grid
/// thermomechanical 3D Cartesian meshes.
/// \brief Class for containing functions required to perform Total Lagrangian
/// quasi-static 3D Cartesian meshes.
///
/// This class contains the requisite functions requited to perform
/// staggered grid thermomechanical heat transfer.
/// Total Lagrangian quasi-static mechanics.
///
/////////////////////////////////////////////////////////////////////////////
class TLQS3D : public Solver
Expand Down Expand Up @@ -202,7 +189,8 @@ class TLQS3D : public Solver
Material_t& Materials,
BoundaryCondition_t& Boundary,
swage::Mesh& mesh,
State_t& State) override;
State_t& State,
elements::fe_ref_elem_t& ref_elem) override;

/////////////////////////////////////////////////////////////////////////////
///
Expand All @@ -224,10 +212,15 @@ class TLQS3D : public Solver


// **** Functions defined in boundary.cpp **** //
void boundary_position(const swage::Mesh& mesh,
const BoundaryCondition_t& BoundaryConditions,
MPICArrayKokkos<double>& node_vel,
const double time_value) const;
void boundary_displacement(const swage::Mesh& mesh,
const BoundaryCondition_t& BoundaryConditions,
const CArrayKokkos<double>& K_elem,
const CArrayKokkos<double>& F_elem,
const CArrayKokkos<double>& displacement_step,
const double dt,
const double time_value,
const double time_start,
const double time_end) const;

// **** Functions defined in time_integration.cpp **** //
void timestep_init(
Expand All @@ -244,7 +237,170 @@ class TLQS3D : public Solver
const size_t num_nodes,
const size_t mat_id) const;


// **** Functions defined in elem_arrays.cpp **** //

// inputs: material_matrix, mesh map for nodes in the element, element id, node reference coordinates, node displacements, basis gradients wrt master element
// outputs: displacement gradient, inverse of jacobian, jacobian determinant, 2nd PK stress in current configuration
KOKKOS_FUNCTION
static void get_gradients(
const double material_matrix[6][6],
ViewCArrayKokkos <size_t>& nodes_in_elem,
const MPICArrayKokkos <double>& coords_t0,
const MPICArrayKokkos <double>& displacement,
const CArrayKokkos <double>& displacement_step,
ViewCArrayKokkos <double>& gauss_point_grad_basis,
double grad_u[3][3],
double inv_J[3][3],
double& det_J,
double PK2_curr_config[6]
);

// inputs: material_matrix, displacement gradient, inverse Jacobian, basis gradients wrt master element, current PK2 stress
// outputs: updated element stiffness matrix, updated element force vector
KOKKOS_FUNCTION
static void tally_elem_arrays(
const double material_matrix[6][6],
const double grad_u[3][3],
const double inv_J[3][3],
ViewCArrayKokkos <double>& gauss_point_grad_basis,
double gauss_point_weight,
const double PK2_curr_config[6],
ViewCArrayKokkos <double>& Kel,
ViewCArrayKokkos <double>& Fel,
const double vol_frac
);

// **** Functions defined in cgm_functions.cpp **** //

// inputs: mesh.num_nodes, mesh.elems_in_node, mesh.num_nodes_in_elem, mesh.nodes_in_elem, F_elem, K_elem, displacement_iter
// outputs: initial cgm residual: r0
void get_r0(
const size_t num_nodes,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const CArrayKokkos<double>& F_elem,
const CArrayKokkos<double>& K_elem,
const CArrayKokkos<double>& displacement_iter,
const CArrayKokkos<double>& r0
);

// inputs: mesh.num_nodes, mesh.elems_in_node, mesh.num_nodes_in_elem, mesh.nodes_in_elem, K_elem, rk, p
// outputs: alpha for cgm
double get_alpha(
const size_t num_nodes,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const CArrayKokkos<double>& K_elem,
const double rktrk,
const CArrayKokkos<double>& p
);

void get_rkp1(
const size_t num_nodes,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const CArrayKokkos<double>& K_elem,
const CArrayKokkos<double>& rk,
const CArrayKokkos<double>& p,
const double alpha,
const CArrayKokkos<double>& rkp1
);

// **** Functions defined in post_process.cpp **** //

// postprocessing function: updates stress and strain material point fields
KOKKOS_FUNCTION
static void post_process(
const double material_matrix[6][6],
ViewCArrayKokkos <size_t>& nodes_in_elem,
const MPICArrayKokkos <double>& coords_t0,
const MPICArrayKokkos <double>& displacement,
ViewCArrayKokkos <double>& gauss_point_grad_basis,
ViewCArrayKokkos <double>& stress,
ViewCArrayKokkos <double>& strain
);

// **** Functions defined in qr_solver.cpp **** //
void QR_backsub(const CArrayKokkos <double> &R,
const CArrayKokkos <double> &y,
DCArrayKokkos <double> &x
);

void QR_decompose(const CArrayKokkos <double> &A,
FArrayKokkos <double> &Q,
CArrayKokkos <double> &R
);

double QR_determinant(const FArrayKokkos <double> &Q,
const CArrayKokkos <double> &R
);

void QR_solver(const CArrayKokkos <double> &A,
const CArrayKokkos <double> &b,
DCArrayKokkos <double> &x
);

// **** Functions defined in additive_schwarz_preconditioning.cpp **** //
/* void get_z0(
const size_t num_nodes,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const CArrayKokkos<double>& K_elem,
const CArrayKokkos<double>& rk,
CArrayKokkos<double>& zk
);

void get_zkp1(
const size_t num_nodes,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const CArrayKokkos<double>& K_elem,
const CArrayKokkos<double>& rk,
CArrayKokkos<double>& zk
); */

// **** Functions defined in chebyshev_smoothing.cpp **** //
void apply_chebyshev_preconditioner(const CArrayKokkos<double>& rk,
const CArrayKokkos<double>& zkp1,
const CArrayKokkos<double>& D_inv,
const CArrayKokkos<double>& zk,
const CArrayKokkos<double>& delta_z,
const CArrayKokkos<double>& temporary,
const CArrayKokkos<double>& K_elem,
const size_t num_nodes,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
const double alpha,
const double beta,
const int degree
);

void get_diagonal_inverse(CArrayKokkos<double>& D_inv,
const CArrayKokkos<double>& K_elem,
const size_t num_nodes,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem
);

void get_chebyshev_bounds(double& alpha,
double& beta,
const CArrayKokkos<double>& D_inv,
const CArrayKokkos<double>& K_elem,
const size_t num_nodes,
const RaggedRightArrayKokkos<size_t>& elems_in_node,
const size_t num_nodes_in_elem,
const DCArrayKokkos<size_t>& nodes_in_elem,
CArrayKokkos<double>& v_scratch,
CArrayKokkos<double>& w_scratch,
const int max_iters
);

};


Expand Down
Loading