OGS
ProcessLib::NormalTractionBoundaryCondition Namespace Reference

Classes

struct  IntegrationPointData
 
class  NormalTractionBoundaryCondition
 
class  NormalTractionBoundaryConditionLocalAssembler
 
class  NormalTractionBoundaryConditionLocalAssemblerInterface
 

Functions

template<int GlobalDim>
Eigen::Vector3d computeElementNormal (const MeshLib::Element &element, const MeshLib::Element &bulk_element)
 
template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > createNormalTractionBoundaryCondition (BaseLib::ConfigTree const &config, MeshLib::Mesh const &bc_mesh, MeshLib::Mesh const &bulk_mesh, NumLib::LocalToGlobalIndexMap const &dof_table, int const variable_id, unsigned const integration_order, unsigned const shapefunction_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
 
template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > createNormalTractionBoundaryCondition (BaseLib::ConfigTree const &config, MeshLib::Mesh const &bc_mesh, NumLib::LocalToGlobalIndexMap const &dof_table, int const variable_id, unsigned const integration_order, unsigned const shapefunction_order, std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const &parameters)
 

Function Documentation

◆ computeElementNormal()

template<int GlobalDim>
Eigen::Vector3d ProcessLib::NormalTractionBoundaryCondition::computeElementNormal ( const MeshLib::Element & element,
const MeshLib::Element & bulk_element )

Computes the normal vector for a boundary element.

Parameters
elementThe boundary element.
bulk_elementThe corresponding bulk element.
Template Parameters
GlobalDimGlobal dimension of the problem.
Returns
The computed normal vector.

Definition at line 34 of file NormalTractionBoundaryCondition-impl.h.

36{
38 {
39 auto const n = MeshLib::FaceRule::getSurfaceNormal(bulk_element);
40 Eigen::Vector3d const e = element.getNode(1)->asEigenVector3d() -
41 element.getNode(0)->asEigenVector3d();
42 Eigen::Vector3d const normal = e.cross(n).normalized();
43
44 // Compute center of the bulk element to correctly orient the
45 // normal.
46 auto const c =
48 // Flip n if the normal points toward c:
49 // <normal, c - n0> > 0.
50 if (normal.dot(c - element.getNode(0)->asEigenVector3d()) > 0)
51 {
52 return -normal;
53 }
54 return normal;
55 }
56
57 Eigen::Vector3d normal = MeshLib::FaceRule::getSurfaceNormal(element);
58 normal.tail<3 - GlobalDim>().setZero();
59 return normal.normalized();
60}
Eigen::Vector3d const & asEigenVector3d() const
Definition Point3d.h:64
virtual MeshElemType getGeomType() const =0
virtual const Node * getNode(unsigned idx) const =0
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition FaceRule.cpp:40
MathLib::Point3d getCenterOfGravity(Element const &element)
Calculates the center of gravity for the mesh element.
Definition Element.cpp:142

References MathLib::Point3d::asEigenVector3d(), MeshLib::getCenterOfGravity(), MeshLib::Element::getGeomType(), MeshLib::Element::getNode(), MeshLib::FaceRule::getSurfaceNormal(), and MeshLib::LINE.

◆ createNormalTractionBoundaryCondition() [1/2]

template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition ( BaseLib::ConfigTree const & config,
MeshLib::Mesh const & bc_mesh,
MeshLib::Mesh const & bulk_mesh,
NumLib::LocalToGlobalIndexMap const & dof_table,
int const variable_id,
unsigned const integration_order,
unsigned const shapefunction_order,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )
Input File Parameter
prj__process_variables__process_variable__boundary_conditions__boundary_condition__type
Input File Parameter
prj__process_variables__process_variable__boundary_conditions__boundary_condition__NormalTraction__parameter

Definition at line 133 of file NormalTractionBoundaryCondition-impl.h.

139{
140 DBUG("Constructing NormalTractionBoundaryCondition from config.");
142 config.checkConfigParameter("type", "NormalTraction");
143
144 auto const parameter_name =
146 config.getConfigParameter<std::string>("parameter");
147 DBUG("Using parameter {:s}", parameter_name);
148
149 auto const& pressure = ParameterLib::findParameter<double>(
150 parameter_name, parameters, 1, &bc_mesh);
151 return std::make_unique<NormalTractionBoundaryCondition<
153 integration_order, shapefunction_order, bulk_mesh, dof_table,
154 variable_id, bc_mesh, pressure);
155}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
OGS_NO_DANGLING Parameter< ParameterDataType > & findParameter(std::string const &parameter_name, std::vector< std::unique_ptr< ParameterBase > > const &parameters, int const num_components, MeshLib::Mesh const *const mesh=nullptr)
Definition Utils.h:102

References BaseLib::ConfigTree::checkConfigParameter(), DBUG(), ParameterLib::findParameter(), and BaseLib::ConfigTree::getConfigParameter().

Referenced by ProcessLib::createBoundaryCondition().

◆ createNormalTractionBoundaryCondition() [2/2]

template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition ( BaseLib::ConfigTree const & config,
MeshLib::Mesh const & bc_mesh,
NumLib::LocalToGlobalIndexMap const & dof_table,
int const variable_id,
unsigned const integration_order,
unsigned const shapefunction_order,
std::vector< std::unique_ptr< ParameterLib::ParameterBase > > const & parameters )