OGS
ProcessLib::EmbeddedAnchor< GlobalDim > Class Template Referencefinal

Detailed Description

template<int GlobalDim>
class ProcessLib::EmbeddedAnchor< GlobalDim >

Definition at line 18 of file EmbeddedAnchor.h.

#include <EmbeddedAnchor.h>

Inheritance diagram for ProcessLib::EmbeddedAnchor< GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::EmbeddedAnchor< GlobalDim >:
[legend]

Public Member Functions

 EmbeddedAnchor (MeshLib::Mesh const &bulk_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, std::size_t const source_term_mesh_id, MeshLib::Mesh const &st_mesh, const int variable_id)
void getShapeMatricesAndGlobalIndicesAndDisplacements (MeshLib::Element const *const anchor_element, std::array< std::size_t, 2 > &nodes_per_element, std::vector< Eigen::RowVectorXd > &shape_matrices, std::vector< GlobalIndexType > &global_indices, Eigen::Vector< double, 2 *GlobalDim > &local_x, GlobalVector const &x, ParameterLib::SpatialPosition &pos) const
void integrate (const double t, GlobalVector const &x, GlobalVector &b, GlobalMatrix *jac) const override
Public Member Functions inherited from ProcessLib::SourceTermBase
virtual ~SourceTermBase ()=default

Private Attributes

NumLib::LocalToGlobalIndexMap const & dof_table_bulk_
MeshLib::Mesh const & bulk_mesh_
std::size_t const source_term_mesh_id_
MeshLib::Mesh const & st_mesh_
int const variable_id_
std::array< int, GlobalDim > const component_ids_
MeshLib::PropertyVector< std::size_t > const * bulk_element_ids_ = nullptr
MeshLib::PropertyVector< double > const * natural_coordinates_ = nullptr
MeshLib::PropertyVector< double > const * maximum_anchor_stress_ = nullptr
MeshLib::PropertyVector< double > const * initial_anchor_stress_ = nullptr
MeshLib::PropertyVector< double > const * residual_anchor_stress_ = nullptr
MeshLib::PropertyVector< double > const * cross_sectional_area_ = nullptr
MeshLib::PropertyVector< double > const * anchor_stiffness_ = nullptr

Constructor & Destructor Documentation

◆ EmbeddedAnchor()

template<int GlobalDim>
ProcessLib::EmbeddedAnchor< GlobalDim >::EmbeddedAnchor ( MeshLib::Mesh const & bulk_mesh,
NumLib::LocalToGlobalIndexMap const & dof_table_bulk,
std::size_t const source_term_mesh_id,
MeshLib::Mesh const & st_mesh,
const int variable_id )
explicit

Definition at line 141 of file EmbeddedAnchor.cpp.

153 []
154 {
156 std::iota(arr.begin(), arr.end(), 0);
157 return arr;
158 }())
159{
160 DBUG("Create EmbeddedAnchor.");
161 std::string_view const bulk_element_ids_string = "bulk_element_ids";
163 st_mesh_.getProperties().template getPropertyVector<std::size_t>(
165
166 std::string_view const natural_coordinates_string = "natural_coordinates";
168 st_mesh_.getProperties().template getPropertyVector<double>(
170
172 "maximum_anchor_stress";
174 st_mesh_.getProperties().template getPropertyVector<double>(
176
178 "initial_anchor_stress";
180 st_mesh_.getProperties().template getPropertyVector<double>(
182
184 "residual_anchor_stress";
186 st_mesh_.getProperties().template getPropertyVector<double>(
188
190 "anchor_cross_sectional_area";
192 st_mesh_.getProperties().template getPropertyVector<double>(
194
195 std::string_view const anchor_stiffness_string = "anchor_stiffness";
197 st_mesh_.getProperties().template getPropertyVector<double>(
199}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
MeshLib::PropertyVector< double > const * maximum_anchor_stress_
MeshLib::Mesh const & st_mesh_
MeshLib::PropertyVector< double > const * cross_sectional_area_
MeshLib::PropertyVector< double > const * anchor_stiffness_
MeshLib::PropertyVector< double > const * residual_anchor_stress_
std::array< int, GlobalDim > const component_ids_
MeshLib::PropertyVector< std::size_t > const * bulk_element_ids_
std::size_t const source_term_mesh_id_
NumLib::LocalToGlobalIndexMap const & dof_table_bulk_
MeshLib::PropertyVector< double > const * natural_coordinates_
MeshLib::Mesh const & bulk_mesh_
MeshLib::PropertyVector< double > const * initial_anchor_stress_

References bulk_mesh_, component_ids_, dof_table_bulk_, source_term_mesh_id_, st_mesh_, and variable_id_.

Member Function Documentation

◆ getShapeMatricesAndGlobalIndicesAndDisplacements()

template<int GlobalDim>
void ProcessLib::EmbeddedAnchor< GlobalDim >::getShapeMatricesAndGlobalIndicesAndDisplacements ( MeshLib::Element const *const anchor_element,
std::array< std::size_t, 2 > & nodes_per_element,
std::vector< Eigen::RowVectorXd > & shape_matrices,
std::vector< GlobalIndexType > & global_indices,
Eigen::Vector< double, 2 *GlobalDim > & local_x,
GlobalVector const & x,
ParameterLib::SpatialPosition & pos ) const

Definition at line 202 of file EmbeddedAnchor.cpp.

211{
214 {
215 // used pos in integrate function will be of the last node in anchor
216 // element, i,e, only one uniform stiffness is supported
217 auto const bulk_element_id = (*bulk_element_ids_)[anchor_node_id];
218 pos.setElementID(bulk_element_id);
219
220 auto const& bulk_element = *bulk_mesh_.getElement(bulk_element_id);
221 nodes_per_element[node_idx] = bulk_element.nodes().size();
222
226 shape_matrices.push_back(std::move(N));
227
228 for (int component = 0; component < GlobalDim; ++component)
229 {
232
235
236 global_indices.insert(global_indices.cend(),
239
240 // this maps the displacement of each component of all nodes
241 // of the element to the desired anchor location in that element
242 // where all even local_x entries are for the first node and all odd
243 // local_x entries are for the second node
248 }
249 }
250}
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
Eigen::RowVectorXd computeShapeMatrix(MeshLib::Element const &bulk_element, std::span< double const, 3 > const nat_coords)

References bulk_mesh_, ProcessLib::computeShapeMatrix(), dof_table_bulk_, MathLib::EigenVector::get(), MeshLib::views::ids, natural_coordinates_, ProcessLib::nodeLocalIndices(), MeshLib::Element::nodes(), ParameterLib::SpatialPosition::setElementID(), NumLib::detail::shapeFunctionInterpolate(), MathLib::toVector(), and variable_id_.

Referenced by integrate().

◆ integrate()

template<int GlobalDim>
void ProcessLib::EmbeddedAnchor< GlobalDim >::integrate ( const double t,
GlobalVector const & x,
GlobalVector & b,
GlobalMatrix * jac ) const
overridevirtual

Implements ProcessLib::SourceTermBase.

Definition at line 253 of file EmbeddedAnchor.cpp.

257{
258 DBUG("Assemble EmbeddedAnchor.");
259
262
263 for (MeshLib::Element const* const anchor_element : st_mesh_.getElements())
264 {
265 auto const anchor_element_id = anchor_element->getID();
273 local_x, x, pos);
274
275 auto node_coords = [anchor_element](int const i)
276 { return anchor_element->getNode(i)->asEigenVector3d(); };
278 (node_coords(1) - node_coords(0)).template head<GlobalDim>();
279 double const l_original_norm = l_original.norm();
280
281 // Displacement in the two nodes.
282 auto u = [&local_x](int const i)
284 GlobalDimVector const l = l_original + u(1) - u(0);
285
286 double const K = (*cross_sectional_area_)[anchor_element_id] *
287 (*anchor_stiffness_)[anchor_element_id];
288 double const initial_force =
289 (*cross_sectional_area_)[anchor_element_id] *
290 (*initial_anchor_stress_)[anchor_element_id];
291 double const max_force = (*cross_sectional_area_)[anchor_element_id] *
292 (*maximum_anchor_stress_)[anchor_element_id];
293 double const residual_force =
294 (*cross_sectional_area_)[anchor_element_id] *
295 (*residual_anchor_stress_)[anchor_element_id];
296
297 double const strain = (l.norm() - l_original_norm) / l_original_norm;
298
303 GlobalDimVector const f =
304 ((f_elastic.norm() < max_force)) ? f_elastic : f_friction;
305
308 l.transpose() / l.norm() /
310 GlobalDimMatrix const Df =
312
315
317 if (jac)
318 {
320 }
321 }
322}
void getShapeMatricesAndGlobalIndicesAndDisplacements(MeshLib::Element const *const anchor_element, std::array< std::size_t, 2 > &nodes_per_element, std::vector< Eigen::RowVectorXd > &shape_matrices, std::vector< GlobalIndexType > &global_indices, Eigen::Vector< double, 2 *GlobalDim > &local_x, GlobalVector const &x, ParameterLib::SpatialPosition &pos) const
std::tuple< Eigen::VectorXd, Eigen::MatrixXd > assembleLocalBJac(Eigen::Vector< double, GlobalDim > const &f, Eigen::Matrix< double, GlobalDim, GlobalDim > const &Df, std::vector< Eigen::RowVectorXd > const &shape_matrices, std::size_t const num_dof, std::array< std::size_t, 2 > const &nodes_per_element)

References MathLib::EigenMatrix::add(), MathLib::EigenVector::add(), ProcessLib::assembleLocalBJac(), DBUG(), getShapeMatricesAndGlobalIndicesAndDisplacements(), ProcessLib::nodeLocalIndices(), and st_mesh_.

Member Data Documentation

◆ anchor_stiffness_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::anchor_stiffness_ = nullptr
private

Definition at line 52 of file EmbeddedAnchor.h.

◆ bulk_element_ids_

template<int GlobalDim>
MeshLib::PropertyVector<std::size_t> const* ProcessLib::EmbeddedAnchor< GlobalDim >::bulk_element_ids_ = nullptr
private

Definition at line 46 of file EmbeddedAnchor.h.

◆ bulk_mesh_

template<int GlobalDim>
MeshLib::Mesh const& ProcessLib::EmbeddedAnchor< GlobalDim >::bulk_mesh_
private

◆ component_ids_

template<int GlobalDim>
std::array<int, GlobalDim> const ProcessLib::EmbeddedAnchor< GlobalDim >::component_ids_
private

Definition at line 45 of file EmbeddedAnchor.h.

Referenced by EmbeddedAnchor().

◆ cross_sectional_area_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::cross_sectional_area_ = nullptr
private

Definition at line 51 of file EmbeddedAnchor.h.

◆ dof_table_bulk_

template<int GlobalDim>
NumLib::LocalToGlobalIndexMap const& ProcessLib::EmbeddedAnchor< GlobalDim >::dof_table_bulk_
private

◆ initial_anchor_stress_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::initial_anchor_stress_ = nullptr
private

Definition at line 49 of file EmbeddedAnchor.h.

◆ maximum_anchor_stress_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::maximum_anchor_stress_ = nullptr
private

Definition at line 48 of file EmbeddedAnchor.h.

◆ natural_coordinates_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::natural_coordinates_ = nullptr
private

Definition at line 47 of file EmbeddedAnchor.h.

Referenced by getShapeMatricesAndGlobalIndicesAndDisplacements().

◆ residual_anchor_stress_

template<int GlobalDim>
MeshLib::PropertyVector<double> const* ProcessLib::EmbeddedAnchor< GlobalDim >::residual_anchor_stress_ = nullptr
private

Definition at line 50 of file EmbeddedAnchor.h.

◆ source_term_mesh_id_

template<int GlobalDim>
std::size_t const ProcessLib::EmbeddedAnchor< GlobalDim >::source_term_mesh_id_
private

Definition at line 42 of file EmbeddedAnchor.h.

Referenced by EmbeddedAnchor().

◆ st_mesh_

template<int GlobalDim>
MeshLib::Mesh const& ProcessLib::EmbeddedAnchor< GlobalDim >::st_mesh_
private

Definition at line 43 of file EmbeddedAnchor.h.

Referenced by EmbeddedAnchor(), and integrate().

◆ variable_id_

template<int GlobalDim>
int const ProcessLib::EmbeddedAnchor< GlobalDim >::variable_id_
private

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