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

Detailed Description

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

Definition at line 52 of file NormalTractionBoundaryConditionLocalAssembler.h.

#include <NormalTractionBoundaryConditionLocalAssembler.h>

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

Public Types

using ShapeMatricesType = ShapeMatrixPolicyType< ShapeFunctionDisplacement, GlobalDim >
 
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, bool const is_axially_symmetric, unsigned const integration_order, 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 void assemble (std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &, GlobalMatrix &, GlobalVector &b, GlobalMatrix *)=0
 
virtual ~NormalTractionBoundaryConditionLocalAssemblerInterface ()=default
 

Public Attributes

 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
 

Private Attributes

IntegrationMethod 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 , typename IntegrationMethod , int GlobalDim>
using ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::GlobalDimVectorType = typename ShapeMatricesType::GlobalDimVectorType

◆ NodalVectorType

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

◆ ShapeMatricesType

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

Constructor & Destructor Documentation

◆ NormalTractionBoundaryConditionLocalAssembler()

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

Definition at line 61 of file NormalTractionBoundaryConditionLocalAssembler.h.

67 : _integration_method(integration_order),
68 _pressure(pressure),
69 _element(e)
70 {
71 _local_rhs.setZero(local_matrix_size);
72
73 unsigned const n_integration_points =
74 _integration_method.getNumberOfPoints();
75
76 _ip_data.reserve(n_integration_points);
77
78 auto const shape_matrices_u =
79 NumLib::initShapeMatrices<ShapeFunctionDisplacement,
80 ShapeMatricesType, GlobalDim>(
81 e, is_axially_symmetric, _integration_method);
82
83 GlobalDimVectorType element_normal(GlobalDim);
84
85 // TODO Extend to rotated 2d meshes and line elements.
86 if (e.getGeomType() == MeshLib::MeshElemType::LINE)
87 {
88 Eigen::Vector3d const v1 = e.getNode(1)->asEigenVector3d() -
89 e.getNode(0)->asEigenVector3d();
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 =
106 _integration_method.getWeightedPoint(ip).getWeight() *
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 }
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition: FaceRule.cpp:38
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, IntegrationMethod, GlobalDim >::_integration_method, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::_ip_data, ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::_local_rhs, MathLib::Point3d::asEigenVector3d(), MeshLib::Element::getGeomType(), MeshLib::Element::getNode(), MeshLib::FaceRule::getSurfaceNormal(), NumLib::initShapeMatrices(), and MeshLib::LINE.

Member Function Documentation

◆ assemble()

template<typename ShapeFunctionDisplacement , typename IntegrationMethod , int GlobalDim>
void ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, 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 =
124 _integration_method.getNumberOfPoints();
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:79
static const double t
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:163

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

Member Data Documentation

◆ _element

template<typename ShapeFunctionDisplacement , typename IntegrationMethod , int GlobalDim>
MeshLib::Element const& ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::_element
private

◆ _integration_method

◆ _ip_data

◆ _local_rhs

◆ _pressure

template<typename ShapeFunctionDisplacement , typename IntegrationMethod , int GlobalDim>
ParameterLib::Parameter<double> const& ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryConditionLocalAssembler< ShapeFunctionDisplacement, IntegrationMethod, GlobalDim >::_pressure
private

◆ displacement_size

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

◆ EIGEN_MAKE_ALIGNED_OPERATOR_NEW

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

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