13#include <Eigen/Eigenvalues>
31namespace SmallDeformation
33template <
int DisplacementDim>
42 bool const is_axially_symmetric,
52 unsigned const n_integration_points =
60 for (
unsigned ip = 0; ip < n_integration_points; ++ip)
69 DisplacementDim>::Zero();
75 int const integration_order)
77 if (integration_order !=
81 "Setting integration point initial conditions; The integration "
82 "order of the local assembler for element {:d} is different "
83 "from the integration order in the initial condition.",
87 if (name.starts_with(
"material_state_variable_"))
89 name.remove_prefix(24);
91 auto const& internal_variables =
93 if (
auto const iv = std::find_if(
94 begin(internal_variables), end(internal_variables),
95 [&name](
auto const& iv) {
return iv.name == name; });
96 iv != end(internal_variables))
98 DBUG(
"Setting material state variable '{:s}'", name);
103 DisplacementDim>::material_state_variables,
108 "Could not find variable {:s} in solid material model's "
109 "internal variables.",
122 double const ,
double const , Eigen::VectorXd
const& ,
123 Eigen::VectorXd
const& )
override
128 unsigned const n_integration_points =
132 Eigen::Matrix<double, 3, 3>::Zero());
134 for (
unsigned ip = 0; ip < n_integration_points; ip++)
141 Eigen::Matrix<double, 3, 3, 0, 3, 3>
const sigma_avg =
143 n_integration_points;
145 Eigen::SelfAdjointEigenSolver<Eigen::Matrix<double, 3, 3>> e_s(
148 Eigen::Map<Eigen::Vector3d>(
152 auto eigen_vectors = e_s.eigenvectors();
154 for (
auto i = 0; i < 3; i++)
156 Eigen::Map<Eigen::Vector3d>(
157 &(*
process_data_.principal_stress_vector[i])[elem_id * 3], 3) =
158 eigen_vectors.col(i);
176 std::function<std::span<double>(
178 MaterialStateVariables&)> const& get_values_span,
179 int const& n_components) const
184 get_values_span, n_components);
188 DisplacementDim>::MaterialStateVariables
const&
199 &Self::current_states_, &Self::output_data_);
208 std::vector<typename ConstitutiveRelations::StatefulData<DisplacementDim>>
214 std::vector<typename ConstitutiveRelations::OutputData<DisplacementDim>>
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
void WARN(fmt::format_string< Args... > fmt, Args &&... args)
std::size_t getID() const
Returns the ID of the element.
unsigned getIntegrationOrder() const
unsigned getNumberOfPoints() const
void setElementID(std::size_t element_id)
void setIntegrationPoint(unsigned integration_point)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, 3, 3 > kelvinVectorToTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
KelvinVectorType< DisplacementDim > tensorToKelvin(Eigen::Matrix< double, 3, 3 > const &m)
std::size_t reflectSetIPData(std::string_view const name, double const *values, std::vector< IPData > &ip_data_vector)
auto reflectWithoutName(Accessors &&... accessors)
std::size_t setIntegrationPointDataMaterialStateVariables(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span)
std::vector< double > getIntegrationPointDataMaterialStateVariables(IntegrationPointDataVector const &ip_data_vector, MemberType member, std::function< std::span< double >(MaterialStateVariables &)> get_values_span, int const n_components)