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)
std::string parseNormalTractionBoundaryCondition (BaseLib::ConfigTree const &config)
template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > createNormalTractionBoundaryCondition (std::string const &parameter_name, 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 (std::string const &parameter_name, 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 27 of file NormalTractionBoundaryCondition-impl.h.

29{
31 {
32 auto const n = MeshLib::FaceRule::getSurfaceNormal(bulk_element);
33 Eigen::Vector3d const e = element.getNode(1)->asEigenVector3d() -
34 element.getNode(0)->asEigenVector3d();
35 Eigen::Vector3d const normal = e.cross(n).normalized();
36
37 // Compute center of the bulk element to correctly orient the
38 // normal.
39 auto const c =
41 // Flip n if the normal points toward c:
42 // <normal, c - n0> > 0.
43 if (normal.dot(c - element.getNode(0)->asEigenVector3d()) > 0)
44 {
45 return -normal;
46 }
47 return normal;
48 }
49
50 Eigen::Vector3d normal = MeshLib::FaceRule::getSurfaceNormal(element);
51 normal.tail<3 - GlobalDim>().setZero();
52 return normal.normalized();
53}
Eigen::Vector3d const & asEigenVector3d() const
Definition Point3d.h:55
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:33
MathLib::Point3d getCenterOfGravity(Element const &element)
Calculates the center of gravity for the mesh element.
Definition Element.cpp:131

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

Referenced by ProcessLib::NormalTractionBoundaryCondition::NormalTractionBoundaryCondition< GlobalDim, LocalAssemblerImplementation >::NormalTractionBoundaryCondition().

◆ createNormalTractionBoundaryCondition() [1/2]

template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition ( std::string const & parameter_name,
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 )

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

148{
149 DBUG("Constructing NormalTractionBoundaryCondition.");
150
151 auto const& pressure = ParameterLib::findParameter<double>(
152 parameter_name, parameters, 1, &bc_mesh);
153
154 return std::make_unique<NormalTractionBoundaryCondition<
156 integration_order, shapefunction_order, bulk_mesh, dof_table,
157 variable_id, bc_mesh, pressure);
158}
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
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)

References DBUG(), and ParameterLib::findParameter().

◆ createNormalTractionBoundaryCondition() [2/2]

template<int GlobalDim>
std::unique_ptr< NormalTractionBoundaryCondition< GlobalDim, NormalTractionBoundaryConditionLocalAssembler > > ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition ( std::string const & parameter_name,
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 )

◆ parseNormalTractionBoundaryCondition()

std::string ProcessLib::NormalTractionBoundaryCondition::parseNormalTractionBoundaryCondition ( BaseLib::ConfigTree const & config)
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 123 of file NormalTractionBoundaryCondition-impl.h.

125{
126 DBUG("Parsing NormalTractionBoundaryCondition.");
127
129 config.checkConfigParameter("type", "NormalTraction");
130
131 auto const parameter_name =
133 config.getConfigParameter<std::string>("parameter");
134 DBUG("parameter {:s}", parameter_name);
135
136 return parameter_name;
137}

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

Referenced by ProcessLib::createBoundaryCondition().