Loading [MathJax]/extensions/tex2jax.js
OGS
ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim > Class Template Reference

Detailed Description

template<typename ShapeFunction, int DisplacementDim>
class ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >

Local assembler of ThermoMechanics process.

In this assembler, the solid density can be expressed as an exponential function of temperature, if a temperature dependent solid density is assumed. The theory behind this is given below.

During the temperature variation, the solid mass balance is

\[ \rho_s^{n+1} V^{n+1} = \rho_s^n V^n, \]

with \(\rho_s\) the density, \(V\), the volume, and \(n\) the index of the time step. Under pure thermo-mechanics condition, the volume change along with the temperature change is given by

\[ V^{n+1} = V^{n} + \alpha_T dT V^{n} = (1+\alpha_T dT)V^{n}, \]

where \(\alpha_T\) is the volumetric thermal expansivity of the solid. This gives

\[ \rho_s^{n+1} + \alpha_T dT \rho_s^{n+1} = \rho_s^n. \]

Therefore, we obtain the differential expression of the temperature dependent solid density as

\[ \frac{d \rho_s}{d T} = -\alpha_T \rho_s. \]

The solution of the above ODE, i.e the density expression, is given by

\[ \rho_s = {\rho_0} \mathrm{exp} (- \alpha_T (T-T0)), \]

with reference density \(\rho_0\) at a reference temperature of \(T_0\).

An MPL property with the type of Exponential (see MaterialPropertyLib::Exponential) can be used for the temperature dependent solid property.

Definition at line 127 of file ThermoMechanicsFEM.h.

#include <ThermoMechanicsFEM.h>

Inheritance diagram for ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >:
[legend]
Collaboration diagram for ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >:
[legend]

Public Types

using ShapeMatricesType
 
using ShapeMatrices = typename ShapeMatricesType::ShapeMatrices
 
using GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType
 
using BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>
 
using Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>
 
using NodalForceVectorType = typename BMatricesType::NodalForceVectorType
 
using RhsVector
 
using JacobianMatrix
 
using IpData
 

Public Member Functions

 ThermoMechanicsLocalAssembler (ThermoMechanicsLocalAssembler const &)=delete
 
 ThermoMechanicsLocalAssembler (ThermoMechanicsLocalAssembler &&)=delete
 
 ThermoMechanicsLocalAssembler (MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ThermoMechanicsProcessData< DisplacementDim > &process_data)
 
std::size_t setIPDataInitialConditions (std::string_view const name, double const *values, int const integration_order) override
 Returns number of read integration points.
 
void assemble (double const, double const, std::vector< double > const &, std::vector< double > const &, std::vector< double > &, std::vector< double > &, std::vector< double > &) override
 
void assembleWithJacobianForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data) override
 
void assembleWithJacobian (double const t, double const dt, std::vector< double > const &local_x, std::vector< double > const &local_x_prev, std::vector< double > &local_rhs_data, std::vector< double > &local_Jac_data) override
 
void initializeConcrete () override
 
void setInitialConditionsConcrete (Eigen::VectorXd const local_x, double const t, int const process_id) override
 
void postTimestepConcrete (Eigen::VectorXd const &, Eigen::VectorXd const &, double const, double const, int const) override
 
Eigen::Map< const Eigen::RowVectorXd > getShapeMatrix (const unsigned integration_point) const override
 Provides the shape matrix at the given integration point.
 
- Public Member Functions inherited from ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >
- Public Member Functions inherited from ProcessLib::LocalAssemblerInterface
virtual ~LocalAssemblerInterface ()=default
 
virtual void setInitialConditions (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, double const t, int const process_id)
 
virtual void initialize (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
 
virtual void preAssemble (double const, double const, std::vector< double > const &)
 
virtual void assembleForStaggeredScheme (double const t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, int const process_id, std::vector< double > &local_M_data, std::vector< double > &local_K_data, std::vector< double > &local_b_data)
 
virtual void computeSecondaryVariable (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, double const t, double const dt, std::vector< GlobalVector * > const &x, GlobalVector const &x_prev, int const process_id)
 
virtual void preTimestep (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, double const t, double const delta_t)
 
virtual void postTimestep (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
void postNonLinearSolver (std::size_t const mesh_item_id, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_tables, std::vector< GlobalVector * > const &x, std::vector< GlobalVector * > const &x_prev, double const t, double const dt, int const process_id)
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< double > const &) const
 
virtual Eigen::Vector3d getFlux (MathLib::Point3d const &, double const, std::vector< std::vector< double > > const &) const
 Fits to staggered scheme.
 
virtual std::optional< VectorSegmentgetVectorDeformationSegment () const
 
- Public Member Functions inherited from NumLib::ExtrapolatableElement
virtual ~ExtrapolatableElement ()=default
 

Static Public Attributes

static int const KelvinVectorSize
 

Private Member Functions

void assembleWithJacobianForDeformationEquations (const double t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
void assembleWithJacobianForHeatConductionEquations (const double t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
 
std::size_t setSigma (double const *values)
 
std::vector< double > getSigma () const override
 
std::vector< double > const & getIntPtSigma (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::size_t setEpsilon (double const *values)
 
std::vector< double > getEpsilon () const override
 
std::vector< double > const & getIntPtEpsilon (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::vector< double > const & getIntPtEpsilonMechanical (const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
 
std::size_t setEpsilonMechanical (double const *values)
 
std::vector< double > getEpsilonMechanical () const override
 
unsigned getNumberOfIntegrationPoints () const override
 
int getMaterialID () const override
 
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & getMaterialStateVariablesAt (unsigned integration_point) const override
 

Private Attributes

ThermoMechanicsProcessData< DisplacementDim > & _process_data
 
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
 
NumLib::GenericIntegrationMethod const & _integration_method
 
MeshLib::Element const & _element
 
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
 
bool const _is_axially_symmetric
 

Static Private Attributes

static const int temperature_index = 0
 
static const int temperature_size = ShapeFunction::NPOINTS
 
static const int displacement_index = ShapeFunction::NPOINTS
 
static const int displacement_size
 

Member Typedef Documentation

◆ BMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::BMatricesType = BMatrixPolicyType<ShapeFunction, DisplacementDim>

Definition at line 138 of file ThermoMechanicsFEM.h.

◆ GlobalDimMatrixType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::GlobalDimMatrixType = typename ShapeMatricesType::GlobalDimMatrixType

Definition at line 137 of file ThermoMechanicsFEM.h.

◆ Invariants

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::Invariants = MathLib::KelvinVector::Invariants<KelvinVectorSize>

Definition at line 142 of file ThermoMechanicsFEM.h.

◆ IpData

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::IpData
Initial value:
IntegrationPointData<BMatricesType, ShapeMatricesType, DisplacementDim>

Definition at line 150 of file ThermoMechanicsFEM.h.

◆ JacobianMatrix

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::JacobianMatrix
Initial value:
typename ShapeMatricesType::template MatrixType<
ShapeFunction::NPOINTS + ShapeFunction::NPOINTS * DisplacementDim,
ShapeFunction::NPOINTS + ShapeFunction::NPOINTS * DisplacementDim>

Definition at line 147 of file ThermoMechanicsFEM.h.

◆ NodalForceVectorType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::NodalForceVectorType = typename BMatricesType::NodalForceVectorType

Definition at line 144 of file ThermoMechanicsFEM.h.

◆ RhsVector

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::RhsVector
Initial value:
typename ShapeMatricesType::template VectorType<
ShapeFunction::NPOINTS + ShapeFunction::NPOINTS * DisplacementDim>

Definition at line 145 of file ThermoMechanicsFEM.h.

◆ ShapeMatrices

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ShapeMatrices = typename ShapeMatricesType::ShapeMatrices

Definition at line 136 of file ThermoMechanicsFEM.h.

◆ ShapeMatricesType

template<typename ShapeFunction , int DisplacementDim>
using ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ShapeMatricesType

Constructor & Destructor Documentation

◆ ThermoMechanicsLocalAssembler() [1/3]

template<typename ShapeFunction , int DisplacementDim>
ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler ( ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim > const & )
delete

◆ ThermoMechanicsLocalAssembler() [2/3]

template<typename ShapeFunction , int DisplacementDim>
ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler ( ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim > && )
delete

◆ ThermoMechanicsLocalAssembler() [3/3]

template<typename ShapeFunction , int DisplacementDim>
ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::ThermoMechanicsLocalAssembler ( MeshLib::Element const & e,
std::size_t const ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
ThermoMechanicsProcessData< DisplacementDim > & process_data )

Definition at line 27 of file ThermoMechanicsFEM-impl.h.

34 : _process_data(process_data),
35 _integration_method(integration_method),
36 _element(e),
37 _is_axially_symmetric(is_axially_symmetric)
38{
39 unsigned const n_integration_points =
41
42 _ip_data.reserve(n_integration_points);
43 _secondary_data.N.resize(n_integration_points);
44
45 auto const shape_matrices =
47 DisplacementDim>(e, is_axially_symmetric,
49
51 _process_data.solid_materials, _process_data.material_ids, e.getID());
52
53 for (unsigned ip = 0; ip < n_integration_points; ip++)
54 {
55 _ip_data.emplace_back(solid_material);
56 auto& ip_data = _ip_data[ip];
57 ip_data.integration_weight =
59 shape_matrices[ip].integralMeasure * shape_matrices[ip].detJ;
60
61 static const int kelvin_vector_size =
63 // Initialize current time step values
64 ip_data.sigma.setZero(kelvin_vector_size);
65 ip_data.eps.setZero(kelvin_vector_size);
66
67 // Previous time step values are not initialized and are set later.
68 ip_data.sigma_prev.resize(kelvin_vector_size);
69 ip_data.eps_prev.resize(kelvin_vector_size);
70
71 ip_data.eps_m.setZero(kelvin_vector_size);
72 ip_data.eps_m_prev.setZero(kelvin_vector_size);
74 x_position.setElementID(_element.getID());
75 ip_data.N = shape_matrices[ip].N;
76 ip_data.dNdx = shape_matrices[ip].dNdx;
77
78 _secondary_data.N[ip] = shape_matrices[ip].N;
79 }
80}
constexpr double getWeight() const
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:91
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
void setElementID(std::size_t element_id)
SecondaryData< typename ShapeMatrices::ShapeType > _secondary_data
ShapeMatrixPolicyType< ShapeFunction, DisplacementDim > ShapeMatricesType
ThermoMechanicsProcessData< DisplacementDim > & _process_data
NumLib::GenericIntegrationMethod const & _integration_method
std::vector< IpData, Eigen::aligned_allocator< IpData > > _ip_data
auto & selectSolidConstitutiveRelation(SolidMaterialsMap const &constitutive_relations, MeshLib::PropertyVector< int > const *const material_ids, std::size_t const element_id)
constexpr int kelvin_vector_dimensions(int const displacement_dim)
Kelvin vector dimensions for given displacement dimension.
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > initShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, IntegrationMethod const &integration_method)
std::vector< ShapeMatrixType, Eigen::aligned_allocator< ShapeMatrixType > > N

References ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_element, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_integration_method, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_process_data, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_secondary_data, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), MathLib::WeightedPoint::getWeight(), NumLib::GenericIntegrationMethod::getWeightedPoint(), NumLib::initShapeMatrices(), MathLib::KelvinVector::kelvin_vector_dimensions(), ProcessLib::ThermoMechanics::SecondaryData< ShapeMatrixType >::N, MaterialLib::Solids::selectSolidConstitutiveRelation(), and ParameterLib::SpatialPosition::setElementID().

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assemble ( double const ,
double const ,
std::vector< double > const & ,
std::vector< double > const & ,
std::vector< double > & ,
std::vector< double > & ,
std::vector< double > &  )
inlineoverridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 170 of file ThermoMechanicsFEM.h.

176 {
177 OGS_FATAL(
178 "ThermoMechanicsLocalAssembler: assembly without jacobian is not "
179 "implemented.");
180 }
#define OGS_FATAL(...)
Definition Error.h:26

References OGS_FATAL.

◆ assembleWithJacobian()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobian ( double const t,
double const dt,
std::vector< double > const & local_x,
std::vector< double > const & local_x_prev,
std::vector< double > & local_rhs_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 149 of file ThermoMechanicsFEM-impl.h.

155{
156 auto const local_matrix_size = local_x.size();
157 assert(local_matrix_size == temperature_size + displacement_size);
158
159 auto T = Eigen::Map<typename ShapeMatricesType::template VectorType<
160 temperature_size> const>(local_x.data() + temperature_index,
162
163 auto u = Eigen::Map<typename ShapeMatricesType::template VectorType<
164 displacement_size> const>(local_x.data() + displacement_index,
166 bool const is_u_non_zero = u.norm() > 0.0;
167
168 auto T_prev = Eigen::Map<typename ShapeMatricesType::template VectorType<
169 temperature_size> const>(local_x_prev.data() + temperature_index,
171
173 local_Jac_data, local_matrix_size, local_matrix_size);
174
175 auto local_rhs = MathLib::createZeroedVector<RhsVector>(local_rhs_data,
176 local_matrix_size);
177
178 typename ShapeMatricesType::template MatrixType<displacement_size,
180 KuT;
182
185
188
189 unsigned const n_integration_points =
191
192 MPL::VariableArray variables;
193 MPL::VariableArray variables_prev;
195 x_position.setElementID(_element.getID());
196
197 auto const& medium = _process_data.media_map.getMedium(_element.getID());
198 auto const& solid_phase = medium->phase("Solid");
199
200 for (unsigned ip = 0; ip < n_integration_points; ip++)
201 {
202 auto const& w = _ip_data[ip].integration_weight;
203 auto const& N = _ip_data[ip].N;
204 auto const& dNdx = _ip_data[ip].dNdx;
205
206 ParameterLib::SpatialPosition const x_position{
207 std::nullopt, _element.getID(),
210 _element, N))};
211
212 auto const x_coord = x_position.getCoordinates().value()[0];
213 auto const& B =
214 LinearBMatrix::computeBMatrix<DisplacementDim,
215 ShapeFunction::NPOINTS,
217 dNdx, N, x_coord, _is_axially_symmetric);
218
219 auto& sigma = _ip_data[ip].sigma;
220 auto const& sigma_prev = _ip_data[ip].sigma_prev;
221
222 auto& eps = _ip_data[ip].eps;
223 auto const& eps_prev = _ip_data[ip].eps_prev;
224
225 auto& eps_m = _ip_data[ip].eps_m;
226 auto const& eps_m_prev = _ip_data[ip].eps_m_prev;
227
228 auto& state = _ip_data[ip].material_state_variables;
229
230 const double T_ip = N.dot(T); // T at integration point
231 double const T_prev_ip = N.dot(T_prev);
232
233 // Consider also anisotropic thermal expansion.
234 auto const solid_linear_thermal_expansivity_vector =
236 solid_phase
237 .property(
239 .value(variables, x_position, t, dt));
240
242 dthermal_strain =
243 solid_linear_thermal_expansivity_vector * (T_ip - T_prev_ip);
244
245 //
246 // displacement equation, displacement part
247 //
248 // For the restart computation, the displacement may not be
249 // reloaded but the initial strains are always available. For such case,
250 // the following computation is skipped.
251 if (is_u_non_zero)
252 {
253 eps.noalias() = B * u;
254 }
255
256 eps_m.noalias() = eps_m_prev + eps - eps_prev - dthermal_strain;
257
258 variables_prev.stress
260 sigma_prev);
261 variables_prev.mechanical_strain
263 eps_m_prev);
264 variables_prev.temperature = T_ip;
265 variables.mechanical_strain
267 eps_m);
268 variables.temperature = T_ip;
269
270 auto&& solution = _ip_data[ip].solid_material.integrateStress(
271 variables_prev, variables, t, x_position, dt, *state);
272
273 if (!solution)
274 {
275 OGS_FATAL("Computation of local constitutive relation failed.");
276 }
277
279 std::tie(sigma, state, C) = std::move(*solution);
280
281 local_Jac
282 .template block<displacement_size, displacement_size>(
284 .noalias() += B.transpose() * C * B * w;
285
286 typename ShapeMatricesType::template MatrixType<DisplacementDim,
288 N_u = ShapeMatricesType::template MatrixType<
289 DisplacementDim, displacement_size>::Zero(DisplacementDim,
291
292 for (int i = 0; i < DisplacementDim; ++i)
293 {
294 N_u.template block<1, displacement_size / DisplacementDim>(
295 i, i * displacement_size / DisplacementDim)
296 .noalias() = N;
297 }
298
299 auto const rho_s =
300 solid_phase.property(MPL::PropertyType::density)
301 .template value<double>(variables, x_position, t, dt);
302
303 auto const& b = _process_data.specific_body_force;
304 local_rhs.template block<displacement_size, 1>(displacement_index, 0)
305 .noalias() -=
306 (B.transpose() * sigma - N_u.transpose() * rho_s * b) * w;
307
308 //
309 // displacement equation, temperature part
310 // The computation of KuT can be ignored.
311 auto const alpha_T_tensor =
313 solid_linear_thermal_expansivity_vector);
314 KuT.noalias() += B.transpose() * (C * alpha_T_tensor) * N * w;
315
316 if (_ip_data[ip].solid_material.getConstitutiveModel() ==
318 {
319 auto const s = Invariants::deviatoric_projection * sigma;
320 double const norm_s = Invariants::FrobeniusNorm(s);
321 const double creep_coefficient =
322 _ip_data[ip].solid_material.getTemperatureRelatedCoefficient(
323 t, dt, x_position, T_ip, norm_s);
324 KuT.noalias() += creep_coefficient * B.transpose() * s * N * w;
325 }
326
327 //
328 // temperature equation, temperature part;
329 //
330 auto const lambda =
331 solid_phase
332 .property(
334 .value(variables, x_position, t, dt);
335
338
339 KTT.noalias() += dNdx.transpose() * thermal_conductivity * dNdx * w;
340
341 auto const c =
342 solid_phase
343 .property(
345 .template value<double>(variables, x_position, t, dt);
346 DTT.noalias() += N.transpose() * rho_s * c * N * w;
347 }
348
349 // temperature equation, temperature part
350 local_Jac
351 .template block<temperature_size, temperature_size>(temperature_index,
353 .noalias() += KTT + DTT / dt;
354
355 // displacement equation, temperature part
356 local_Jac
357 .template block<displacement_size, temperature_size>(displacement_index,
359 .noalias() -= KuT;
360
361 local_rhs.template block<temperature_size, 1>(temperature_index, 0)
362 .noalias() -= KTT * T + DTT * (T - T_prev) / dt;
363}
std::optional< MathLib::Point3d > const getCoordinates() const
MatrixType< _kelvin_vector_size, _number_of_dof > BMatrixType
typename ShapeMatricesType::GlobalDimMatrixType GlobalDimMatrixType
MathLib::KelvinVector::KelvinVectorType< GlobalDim > formKelvinVector(MaterialPropertyLib::PropertyDataType const &values)
A function to form a Kelvin vector from strain or stress alike property like thermal expansivity for ...
Eigen::Matrix< double, GlobalDim, GlobalDim > formEigenTensor(MaterialPropertyLib::PropertyDataType const &values)
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), 1, Eigen::ColMajor > KelvinVectorType
Eigen::Matrix< double, kelvin_vector_dimensions(DisplacementDim), kelvin_vector_dimensions(DisplacementDim), Eigen::RowMajor > KelvinMatrixType
Eigen::Map< Vector > createZeroedVector(std::vector< double > &data, Eigen::VectorXd::Index size)
Eigen::Map< Matrix > createZeroedMatrix(std::vector< double > &data, Eigen::MatrixXd::Index rows, Eigen::MatrixXd::Index cols)
std::array< double, 3 > interpolateCoordinates(MeshLib::Element const &e, typename ShapeMatricesType::ShapeMatrices::ShapeType const &N)
BMatrixType computeBMatrix(DNDX_Type const &dNdx, N_Type const &N, const double radius, const bool is_axially_symmetric)
Fills a B-matrix based on given shape function dN/dx values.
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
static double FrobeniusNorm(Eigen::Matrix< double, KelvinVectorSize, 1 > const &deviatoric_v)
Get the norm of the deviatoric stress.
static Eigen::Matrix< double, KelvinVectorSize, KelvinVectorSize > const deviatoric_projection

References ProcessLib::LinearBMatrix::computeBMatrix(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialLib::Solids::CreepBGRa, MaterialPropertyLib::formEigenTensor(), MaterialPropertyLib::formKelvinVector(), ParameterLib::SpatialPosition::getCoordinates(), NumLib::interpolateCoordinates(), MathLib::KelvinVector::kelvinVectorToSymmetricTensor(), MaterialPropertyLib::VariableArray::mechanical_strain, OGS_FATAL, ParameterLib::SpatialPosition::setElementID(), MaterialPropertyLib::specific_heat_capacity, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::VariableArray::temperature, MaterialPropertyLib::thermal_conductivity, and MaterialPropertyLib::thermal_expansivity.

◆ assembleWithJacobianForDeformationEquations()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForDeformationEquations ( const double t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
private

Assemble local matrices and vectors arise from the linearized discretized weak form of the residual of the momentum balance equation,

\[ \nabla (\sigma - \mathbf{D} \alpha_T (T-T_0) \mathrm{I}) = f \]

where \( \sigma\) is the effective stress tensor, \(\mathbf{D}\) is the tangential operator, \(T\) is the temperature, \(T_0\) is the initial temperature, \(\alpha_T\) is the linear thermal expansion, \(\mathrm{I}\) is the identity tensor, and \(f\) is the body force.

Parameters
tTime
dtTime increment
local_xNodal values of \(x\) of all processes of an element.
local_x_prevNodal values of \(x_{prev}\) of all processes of an element.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

Definition at line 388 of file ThermoMechanicsFEM-impl.h.

393{
394 auto const local_T =
395 local_x.template segment<temperature_size>(temperature_index);
396
397 auto const local_T_prev =
398 local_x_prev.template segment<temperature_size>(temperature_index);
399
400 auto const local_u =
401 local_x.template segment<displacement_size>(displacement_index);
402 bool const is_u_non_zero = local_u.norm() > 0.0;
403
404 auto local_Jac = MathLib::createZeroedMatrix<
405 typename ShapeMatricesType::template MatrixType<displacement_size,
407 local_Jac_data, displacement_size, displacement_size);
408
409 auto local_rhs = MathLib::createZeroedVector<
410 typename ShapeMatricesType::template VectorType<displacement_size>>(
411 local_b_data, displacement_size);
412
413 unsigned const n_integration_points =
415
416 MPL::VariableArray variables;
417 MPL::VariableArray variables_prev;
418 auto const& medium = _process_data.media_map.getMedium(_element.getID());
419 auto const& solid_phase = medium->phase("Solid");
420
421 for (unsigned ip = 0; ip < n_integration_points; ip++)
422 {
423 auto const& w = _ip_data[ip].integration_weight;
424 auto const& N = _ip_data[ip].N;
425 auto const& dNdx = _ip_data[ip].dNdx;
426
427 ParameterLib::SpatialPosition const x_position{
428 std::nullopt, _element.getID(),
431 _element, N))};
432
433 auto const x_coord = x_position.getCoordinates().value()[0];
434
435 auto const& B =
436 LinearBMatrix::computeBMatrix<DisplacementDim,
437 ShapeFunction::NPOINTS,
439 dNdx, N, x_coord, _is_axially_symmetric);
440
441 auto& sigma = _ip_data[ip].sigma;
442 auto const& sigma_prev = _ip_data[ip].sigma_prev;
443
444 auto& eps = _ip_data[ip].eps;
445 auto const& eps_prev = _ip_data[ip].eps_prev;
446
447 auto& eps_m = _ip_data[ip].eps_m;
448 auto const& eps_m_prev = _ip_data[ip].eps_m_prev;
449
450 auto& state = _ip_data[ip].material_state_variables;
451
452 const double T_ip = N.dot(local_T); // T at integration point
453 variables.temperature = T_ip;
454 double const dT_ip = T_ip - N.dot(local_T_prev);
455
456 //
457 // displacement equation, displacement part
458 //
459 // For the restart computation, the displacement may not be
460 // reloaded but the initial strains are always available. For such case,
461 // the following computation is skipped.
462 if (is_u_non_zero)
463 {
464 eps.noalias() = B * local_u;
465 }
466
467 // Consider also anisotropic thermal expansion.
468 auto const solid_linear_thermal_expansivity_vector =
470 solid_phase
471 .property(
473 .value(variables, x_position, t, dt));
474
476 dthermal_strain = solid_linear_thermal_expansivity_vector * dT_ip;
477
478 eps_m.noalias() = eps_m_prev + eps - eps_prev - dthermal_strain;
479
480 variables_prev.stress
482 sigma_prev);
483 variables_prev.mechanical_strain
485 eps_m_prev);
486 variables_prev.temperature = T_ip;
487 variables.mechanical_strain
489 eps_m);
490
491 auto&& solution = _ip_data[ip].solid_material.integrateStress(
492 variables_prev, variables, t, x_position, dt, *state);
493
494 if (!solution)
495 {
496 OGS_FATAL("Computation of local constitutive relation failed.");
497 }
498
500 std::tie(sigma, state, C) = std::move(*solution);
501
502 local_Jac.noalias() += B.transpose() * C * B * w;
503
504 typename ShapeMatricesType::template MatrixType<DisplacementDim,
506 N_u = ShapeMatricesType::template MatrixType<
507 DisplacementDim, displacement_size>::Zero(DisplacementDim,
509
510 for (int i = 0; i < DisplacementDim; ++i)
511 {
512 N_u.template block<1, displacement_size / DisplacementDim>(
513 i, i * displacement_size / DisplacementDim)
514 .noalias() = N;
515 }
516
517 auto const rho_s =
518 solid_phase.property(MPL::PropertyType::density)
519 .template value<double>(variables, x_position, t, dt);
520
521 auto const& b = _process_data.specific_body_force;
522 local_rhs.noalias() -=
523 (B.transpose() * sigma - N_u.transpose() * rho_s * b) * w;
524 }
525}

References ProcessLib::LinearBMatrix::computeBMatrix(), MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::formKelvinVector(), ParameterLib::SpatialPosition::getCoordinates(), NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::mechanical_strain, OGS_FATAL, MaterialPropertyLib::VariableArray::stress, MaterialPropertyLib::VariableArray::temperature, and MaterialPropertyLib::thermal_expansivity.

◆ assembleWithJacobianForHeatConductionEquations()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForHeatConductionEquations ( const double t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
private

Assemble local matrices and vectors arise from the linearized discretized weak form of the residual of the energy balance equation,

\[ \rho c_p \cdot{T} - \nabla (\mathbf{K} (\nabla T) = Q_T \]

where \( rho\) is the solid density, \( c_p\) is the specific heat capacity, \( \mathbf{K} \) is the thermal conductivity, and \( Q_T\) is the source/sink term.

Parameters
tTime
dtTime increment
local_xNodal values of \(x\) of all processes of an element.
local_x_prevNodal values of \(x_{prev}\) of all processes of an element.
local_b_dataRight hand side vector of an element.
local_Jac_dataElement Jacobian matrix for the Newton-Raphson method.

Definition at line 528 of file ThermoMechanicsFEM-impl.h.

533{
534 auto const local_T =
535 local_x.template segment<temperature_size>(temperature_index);
536
537 auto const local_T_prev =
538 local_x_prev.template segment<temperature_size>(temperature_index);
539
540 auto local_Jac = MathLib::createZeroedMatrix<
541 typename ShapeMatricesType::template MatrixType<temperature_size,
543 local_Jac_data, temperature_size, temperature_size);
544
545 auto local_rhs = MathLib::createZeroedVector<
546 typename ShapeMatricesType::template VectorType<temperature_size>>(
547 local_b_data, temperature_size);
548
551
552 typename ShapeMatricesType::NodalMatrixType laplace;
553 laplace.setZero(temperature_size, temperature_size);
554
555 unsigned const n_integration_points =
557
558 auto const& medium = _process_data.media_map.getMedium(_element.getID());
559 auto const& solid_phase = medium->phase("Solid");
560 MPL::VariableArray variables;
561
562 for (unsigned ip = 0; ip < n_integration_points; ip++)
563 {
564 auto const& w = _ip_data[ip].integration_weight;
565 auto const& N = _ip_data[ip].N;
566 auto const& dNdx = _ip_data[ip].dNdx;
567
568 ParameterLib::SpatialPosition const x_position{
569 std::nullopt, _element.getID(),
572 _element, N))};
573
574 const double T_ip = N.dot(local_T); // T at integration point
575 variables.temperature = T_ip;
576
577 auto const rho_s =
578 solid_phase.property(MPL::PropertyType::density)
579 .template value<double>(variables, x_position, t, dt);
580 auto const c_p =
581 solid_phase.property(MPL::PropertyType::specific_heat_capacity)
582 .template value<double>(variables, x_position, t, dt);
583
584 mass.noalias() += N.transpose() * rho_s * c_p * N * w;
585
586 auto const lambda =
587 solid_phase
588 .property(
590 .value(variables, x_position, t, dt);
591
594
595 laplace.noalias() += dNdx.transpose() * thermal_conductivity * dNdx * w;
596 }
597 local_Jac.noalias() += laplace + mass / dt;
598
599 local_rhs.noalias() -=
600 laplace * local_T + mass * (local_T - local_T_prev) / dt;
601}

References MathLib::createZeroedMatrix(), MathLib::createZeroedVector(), MaterialPropertyLib::formEigenTensor(), NumLib::interpolateCoordinates(), MaterialPropertyLib::VariableArray::temperature, and MaterialPropertyLib::thermal_conductivity.

◆ assembleWithJacobianForStaggeredScheme()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::assembleWithJacobianForStaggeredScheme ( double const t,
double const dt,
Eigen::VectorXd const & local_x,
Eigen::VectorXd const & local_x_prev,
int const process_id,
std::vector< double > & local_b_data,
std::vector< double > & local_Jac_data )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 366 of file ThermoMechanicsFEM-impl.h.

373{
374 // For the equations with pressure
375 if (process_id == _process_data.heat_conduction_process_id)
376 {
378 t, dt, local_x, local_x_prev, local_b_data, local_Jac_data);
379 return;
380 }
381
382 // For the equations with deformation
383 assembleWithJacobianForDeformationEquations(t, dt, local_x, local_x_prev,
384 local_b_data, local_Jac_data);
385}
void assembleWithJacobianForHeatConductionEquations(const double t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)
void assembleWithJacobianForDeformationEquations(const double t, double const dt, Eigen::VectorXd const &local_x, Eigen::VectorXd const &local_x_prev, std::vector< double > &local_b_data, std::vector< double > &local_Jac_data)

◆ getEpsilon()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getEpsilon ( ) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 647 of file ThermoMechanicsFEM-impl.h.

648{
649 constexpr int kelvin_vector_size =
651
653 [this](std::vector<double>& values)
654 { return getIntPtEpsilon(0, {}, {}, values); });
655}
std::vector< double > const & getIntPtEpsilon(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override
std::vector< double > transposeInPlace(StoreValuesFunction const &store_values_function)

References MathLib::KelvinVector::kelvin_vector_dimensions(), and ProcessLib::transposeInPlace().

◆ getEpsilonMechanical()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getEpsilonMechanical ( ) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 691 of file ThermoMechanicsFEM-impl.h.

692{
693 constexpr int kelvin_vector_size =
695
697 [this](std::vector<double>& values)
698 { return getIntPtEpsilonMechanical(0, {}, {}, values); });
699}
std::vector< double > const & getIntPtEpsilonMechanical(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References MathLib::KelvinVector::kelvin_vector_dimensions(), and ProcessLib::transposeInPlace().

◆ getIntPtEpsilon()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > const & ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getIntPtEpsilon ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 659 of file ThermoMechanicsFEM-impl.h.

664{
666 _ip_data, &IpData::eps, cache);
667}
std::vector< double > const & getIntegrationPointKelvinVectorData(IntegrationPointDataVector const &ip_data_vector, MemberType IpData::*const member, std::vector< double > &cache)

References ProcessLib::getIntegrationPointKelvinVectorData().

◆ getIntPtEpsilonMechanical()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > const & ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getIntPtEpsilonMechanical ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overrideprivatevirtual

◆ getIntPtSigma()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > const & ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getIntPtSigma ( const double t,
std::vector< GlobalVector * > const & x,
std::vector< NumLib::LocalToGlobalIndexMap const * > const & dof_table,
std::vector< double > & cache ) const
overrideprivatevirtual

◆ getMaterialID()

template<typename ShapeFunction , int DisplacementDim>
int ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getMaterialID ( ) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 710 of file ThermoMechanicsFEM-impl.h.

711{
712 return _process_data.material_ids == nullptr
713 ? 0
714 : (*_process_data.material_ids)[_element.getID()];
715}

◆ getMaterialStateVariablesAt()

template<typename ShapeFunction , int DisplacementDim>
MaterialLib::Solids::MechanicsBase< DisplacementDim >::MaterialStateVariables const & ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getMaterialStateVariablesAt ( unsigned integration_point) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 720 of file ThermoMechanicsFEM-impl.h.

722{
723 return *_ip_data[integration_point].material_state_variables;
724}

◆ getNumberOfIntegrationPoints()

template<typename ShapeFunction , int DisplacementDim>
unsigned ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getNumberOfIntegrationPoints ( ) const
overrideprivatevirtual

◆ getShapeMatrix()

template<typename ShapeFunction , int DisplacementDim>
Eigen::Map< const Eigen::RowVectorXd > ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getShapeMatrix ( const unsigned integration_point) const
inlineoverridevirtual

Provides the shape matrix at the given integration point.

Implements NumLib::ExtrapolatableElement.

Definition at line 246 of file ThermoMechanicsFEM.h.

248 {
249 auto const& N = _secondary_data.N[integration_point];
250
251 // assumes N is stored contiguously in memory
252 return Eigen::Map<const Eigen::RowVectorXd>(N.data(), N.size());
253 }

References ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_secondary_data, and ProcessLib::ThermoMechanics::SecondaryData< ShapeMatrixType >::N.

◆ getSigma()

template<typename ShapeFunction , int DisplacementDim>
std::vector< double > ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::getSigma ( ) const
overrideprivatevirtual

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 614 of file ThermoMechanicsFEM-impl.h.

615{
616 constexpr int kelvin_vector_size =
618
620 [this](std::vector<double>& values)
621 { return getIntPtSigma(0, {}, {}, values); });
622}
std::vector< double > const & getIntPtSigma(const double t, std::vector< GlobalVector * > const &x, std::vector< NumLib::LocalToGlobalIndexMap const * > const &dof_table, std::vector< double > &cache) const override

References MathLib::KelvinVector::kelvin_vector_dimensions(), and ProcessLib::transposeInPlace().

◆ initializeConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::initializeConcrete ( )
inlineoverridevirtual

Set initial stress from parameter.

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 194 of file ThermoMechanicsFEM.h.

195 {
196 unsigned const n_integration_points =
198 for (unsigned ip = 0; ip < n_integration_points; ip++)
199 {
200 auto& ip_data = _ip_data[ip];
201
202 ParameterLib::SpatialPosition const x_position{
203 std::nullopt, _element.getID(),
205 NumLib::interpolateCoordinates<ShapeFunction,
207 _element, ip_data.N))};
208
210 if (_process_data.initial_stress != nullptr)
211 {
212 ip_data.sigma =
214 DisplacementDim>((*_process_data.initial_stress)(
215 std::numeric_limits<
216 double>::quiet_NaN() /* time independent */,
217 x_position));
218 }
219
220 double const t = 0; // TODO (naumov) pass t from top
221 ip_data.solid_material.initializeInternalStateVariables(
222 t, x_position, *ip_data.material_state_variables);
223
224 ip_data.pushBackState();
225 }
226 }
Eigen::Matrix< double, Eigen::MatrixBase< Derived >::RowsAtCompileTime, 1 > symmetricTensorToKelvinVector(Eigen::MatrixBase< Derived > const &v)

References ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_element, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_integration_method, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_ip_data, ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_process_data, MeshLib::Element::getID(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), NumLib::interpolateCoordinates(), and MathLib::KelvinVector::symmetricTensorToKelvinVector().

◆ postTimestepConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::postTimestepConcrete ( Eigen::VectorXd const & ,
Eigen::VectorXd const & ,
double const ,
double const ,
int const  )
inlineoverridevirtual

◆ setEpsilon()

template<typename ShapeFunction , int DisplacementDim>
std::size_t ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setEpsilon ( double const * values)
private

Definition at line 638 of file ThermoMechanicsFEM-impl.h.

640{
642 values, _ip_data, &IpData::eps);
643}
std::size_t setIntegrationPointKelvinVectorData(double const *values, IntegrationPointDataVector &ip_data_vector, MemberType IpData::*const member)

References ProcessLib::setIntegrationPointKelvinVectorData().

◆ setEpsilonMechanical()

template<typename ShapeFunction , int DisplacementDim>
std::size_t ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setEpsilonMechanical ( double const * values)
private

◆ setInitialConditionsConcrete()

template<typename ShapeFunction , int DisplacementDim>
void ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setInitialConditionsConcrete ( Eigen::VectorXd const local_x,
double const t,
int const process_id )
overridevirtual

Reimplemented from ProcessLib::LocalAssemblerInterface.

Definition at line 83 of file ThermoMechanicsFEM-impl.h.

87{
88 unsigned const n_integration_points =
90 auto const local_u =
91 local_x.template segment<displacement_size>(displacement_index);
92
93 for (unsigned ip = 0; ip < n_integration_points; ip++)
94 {
95 auto const& N = _ip_data[ip].N;
96 auto const& dNdx = _ip_data[ip].dNdx;
97
98 ParameterLib::SpatialPosition const x_position{
99 std::nullopt, _element.getID(),
102 _element, N))};
103
104 auto const x_coord = x_position.getCoordinates().value()[0];
105
106 auto const& B =
107 LinearBMatrix::computeBMatrix<DisplacementDim,
108 ShapeFunction::NPOINTS,
110 dNdx, N, x_coord, _is_axially_symmetric);
111
112 _ip_data[ip].eps.noalias() = B * local_u;
113 }
114}

References ProcessLib::LinearBMatrix::computeBMatrix(), ParameterLib::SpatialPosition::getCoordinates(), and NumLib::interpolateCoordinates().

◆ setIPDataInitialConditions()

template<typename ShapeFunction , int DisplacementDim>
std::size_t ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setIPDataInitialConditions ( std::string_view const name,
double const * values,
int const integration_order )
overridevirtual

Returns number of read integration points.

Implements ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssemblerInterface< DisplacementDim >.

Definition at line 117 of file ThermoMechanicsFEM-impl.h.

121{
122 if (integration_order !=
123 static_cast<int>(_integration_method.getIntegrationOrder()))
124 {
125 OGS_FATAL(
126 "Setting integration point initial conditions; The integration "
127 "order of the local assembler for element {:d} is different from "
128 "the integration order in the initial condition.",
129 _element.getID());
130 }
131
132 if (name == "sigma")
133 {
134 return setSigma(values);
135 }
136 if (name == "epsilon")
137 {
138 return setEpsilon(values);
139 }
140 if (name == "epsilon_m")
141 {
142 return setEpsilonMechanical(values);
143 }
144
145 return 0;
146}

References OGS_FATAL.

◆ setSigma()

template<typename ShapeFunction , int DisplacementDim>
std::size_t ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::setSigma ( double const * values)
private

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _is_axially_symmetric

template<typename ShapeFunction , int DisplacementDim>
bool const ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::_is_axially_symmetric
private

Definition at line 357 of file ThermoMechanicsFEM.h.

◆ _process_data

◆ _secondary_data

◆ displacement_index

template<typename ShapeFunction , int DisplacementDim>
const int ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::displacement_index = ShapeFunction::NPOINTS
staticprivate

Definition at line 361 of file ThermoMechanicsFEM.h.

◆ displacement_size

template<typename ShapeFunction , int DisplacementDim>
const int ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::displacement_size
staticprivate
Initial value:
=
ShapeFunction::NPOINTS * DisplacementDim

Definition at line 362 of file ThermoMechanicsFEM.h.

◆ KelvinVectorSize

template<typename ShapeFunction , int DisplacementDim>
int const ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::KelvinVectorSize
static
Initial value:

Definition at line 140 of file ThermoMechanicsFEM.h.

◆ temperature_index

template<typename ShapeFunction , int DisplacementDim>
const int ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::temperature_index = 0
staticprivate

Definition at line 359 of file ThermoMechanicsFEM.h.

◆ temperature_size

template<typename ShapeFunction , int DisplacementDim>
const int ProcessLib::ThermoMechanics::ThermoMechanicsLocalAssembler< ShapeFunction, DisplacementDim >::temperature_size = ShapeFunction::NPOINTS
staticprivate

Definition at line 360 of file ThermoMechanicsFEM.h.


The documentation for this class was generated from the following files: