OGS
ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim > Class Template Referencefinal

Detailed Description

template<typename ShapeFunctionDisplacement, int GlobalDim>
class ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >

Definition at line 51 of file NormalTractionBoundaryConditionLocalAssembler.h.

#include <NormalTractionBoundaryConditionLocalAssembler.h>

Inheritance diagram for ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >:
[legend]

Public Types

using ShapeMatricesType
 
using GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType
 
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
 

Public Member Functions

 NormalTractionBoundaryConditionLocalAssembler (MeshLib::Element const &e, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, ParameterLib::Parameter< double > const &pressure)
 
void assemble (std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &, GlobalMatrix *, GlobalVector &local_rhs, GlobalMatrix *) override
 
- Public Member Functions inherited from ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssemblerInterface
virtual ~NormalTractionBoundaryConditionLocalAssemblerInterface ()=default
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Private Attributes

NumLib::GenericIntegrationMethod const & _integration_method
 
ParameterLib::Parameter< double > const & _pressure
 
std::vector< IntegrationPointData< ShapeMatricesType >, Eigen::aligned_allocator< IntegrationPointData< ShapeMatricesType > > > _ip_data
 
ShapeMatricesType::template VectorType< displacement_size_local_rhs
 
MeshLib::Element const & _element
 

Static Private Attributes

static const int displacement_size
 

Member Typedef Documentation

◆ GlobalDimVectorType

template<typename ShapeFunctionDisplacement , int GlobalDim>
using ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType

◆ NodalVectorType

template<typename ShapeFunctionDisplacement , int GlobalDim>
using ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType

◆ ShapeMatricesType

template<typename ShapeFunctionDisplacement , int GlobalDim>
using ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::ShapeMatricesType

Constructor & Destructor Documentation

◆ NormalTractionBoundaryConditionLocalAssembler()

template<typename ShapeFunctionDisplacement , int GlobalDim>
ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::NormalTractionBoundaryConditionLocalAssembler ( MeshLib::Element const & e,
std::size_t const local_matrix_size,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
ParameterLib::Parameter< double > const & pressure )
inline

Definition at line 60 of file NormalTractionBoundaryConditionLocalAssembler.h.

66 : _integration_method(integration_method),
67 _pressure(pressure),
68 _element(e)
69 {
70 _local_rhs.setZero(local_matrix_size);
71
72 unsigned const n_integration_points =
74
75 _ip_data.reserve(n_integration_points);
76
77 auto const shape_matrices_u =
78 NumLib::initShapeMatrices<ShapeFunctionDisplacement,
79 ShapeMatricesType, GlobalDim>(
80 e, is_axially_symmetric, _integration_method);
81
82 GlobalDimVectorType element_normal(GlobalDim);
83
84 // TODO Extend to rotated 2d meshes and line elements.
85 if (e.getGeomType() == MeshLib::MeshElemType::LINE)
86 {
87 Eigen::Vector3d const v1 = e.getNode(1)->asEigenVector3d() -
88 e.getNode(0)->asEigenVector3d();
89 element_normal[GlobalDim - 1] = 0;
90 element_normal[0] = -v1[1];
91 element_normal[1] = v1[0];
92 element_normal.normalize();
93 }
94 else
95 {
96 auto const n = MeshLib::FaceRule::getSurfaceNormal(e).normalized();
97 for (int i = 0; i < GlobalDim; ++i)
98 {
99 element_normal[i] = n[i];
100 }
101 }
102
103 for (unsigned ip = 0; ip < n_integration_points; ip++)
104 {
105 double const integration_weight =
107 shape_matrices_u[ip].integralMeasure *
108 shape_matrices_u[ip].detJ;
109
110 _ip_data.emplace_back(shape_matrices_u[ip].N, element_normal,
111 integration_weight);
112 }
113 }
double getWeight() const
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition FaceRule.cpp:40
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
std::vector< IntegrationPointData< ShapeMatricesType >, Eigen::aligned_allocator< IntegrationPointData< ShapeMatricesType > > > _ip_data
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)

References ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_integration_method, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_ip_data, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_local_rhs, MathLib::Point3d::asEigenVector3d(), MeshLib::Element::getGeomType(), MeshLib::Element::getNode(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), MeshLib::FaceRule::getSurfaceNormal(), MathLib::WeightedPoint::getWeight(), NumLib::GenericIntegrationMethod::getWeightedPoint(), NumLib::initShapeMatrices(), and MeshLib::LINE.

Member Function Documentation

◆ assemble()

template<typename ShapeFunctionDisplacement , int GlobalDim>
void ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::assemble ( std::size_t const id,
NumLib::LocalToGlobalIndexMap const & dof_table_boundary,
double const t,
std::vector< GlobalVector * > const & ,
GlobalMatrix * ,
GlobalVector & local_rhs,
GlobalMatrix *  )
inlineoverridevirtual

Implements ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssemblerInterface.

Definition at line 115 of file NormalTractionBoundaryConditionLocalAssembler.h.

120 {
121 _local_rhs.setZero();
122
123 unsigned const n_integration_points =
125
126 NodalVectorType pressure =
128
129 for (unsigned ip = 0; ip < n_integration_points; ip++)
130 {
131 auto const& w = _ip_data[ip].integration_weight;
132 auto const& N = _ip_data[ip].N;
133 auto const& n = _ip_data[ip].n;
134
135 typename ShapeMatricesType::template MatrixType<GlobalDim,
137 N_u = ShapeMatricesType::template MatrixType<
138 GlobalDim, displacement_size>::Zero(GlobalDim,
140 for (int i = 0; i < GlobalDim; ++i)
141 {
142 N_u.template block<1, displacement_size / GlobalDim>(
143 i, i * displacement_size / GlobalDim)
144 .noalias() = N;
145 }
146
147 _local_rhs.noalias() -= n.transpose() * N_u * pressure.dot(N) * w;
148 }
149
150 auto const indices = NumLib::getIndices(id, dof_table_boundary);
151 local_rhs.add(indices, _local_rhs);
152 }
void add(IndexType rowId, double v)
add entry
Definition EigenVector.h:76
std::vector< GlobalIndexType > getIndices(std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table)
virtual Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > getNodalValuesOnElement(MeshLib::Element const &element, double const t) const
Returns a matrix of values for all nodes of the given element.
Definition Parameter.h:164

References ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_element, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_integration_method, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_ip_data, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_local_rhs, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::_pressure, MathLib::EigenVector::add(), ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::displacement_size, NumLib::getIndices(), ParameterLib::Parameter< T >::getNodalValuesOnElement(), and NumLib::GenericIntegrationMethod::getNumberOfPoints().

Member Data Documentation

◆ _element

◆ _integration_method

◆ _ip_data

◆ _local_rhs

◆ _pressure

◆ displacement_size

template<typename ShapeFunctionDisplacement , int GlobalDim>
const int ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::displacement_size
staticprivate

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

template<typename ShapeFunctionDisplacement , int GlobalDim>
ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, GlobalDim >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW

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