OGS
ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim > Class Template Referencefinal

Detailed Description

template<typename ShapeFunction, int GlobalDim>
class ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >

Definition at line 32 of file HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler.h.

#include <HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler.h>

Inheritance diagram for ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >:
[legend]
Collaboration diagram for ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >:
[legend]

Public Member Functions

 HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler (MeshLib::Element const &e, std::size_t const local_matrix_size, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, HCNonAdvectiveFreeComponentFlowBoundaryConditionData const &data)
 
void assemble (std::size_t const mesh_item_id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix &, GlobalVector &b, GlobalMatrix *) override
 
- Public Member Functions inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
 GenericNaturalBoundaryConditionLocalAssembler (MeshLib::Element const &e, bool is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method)
 
- Public Member Functions inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssemblerInterface
virtual ~GenericNaturalBoundaryConditionLocalAssemblerInterface ()=default
 

Private Types

using Base
 
using NodalVectorType = typename Base::NodalVectorType
 
using NodalMatrixType = typename Base::NodalMatrixType
 

Private Member Functions

Eigen::Vector3d getOrientedSurfaceNormal (MeshLib::Element const &e) const
 

Private Attributes

HCNonAdvectiveFreeComponentFlowBoundaryConditionData const & _data
 
std::size_t const _local_matrix_size
 
Eigen::Vector3d const _surface_normal
 

Additional Inherited Members

- Protected Types inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
 
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
 
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
 
- Protected Attributes inherited from ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >
NumLib::GenericIntegrationMethod const & _integration_method
 
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
 
MeshLib::Element const & _element
 

Member Typedef Documentation

◆ Base

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::Base
private
Initial value:
GenericNaturalBoundaryConditionLocalAssembler<ShapeFunction, GlobalDim>

Definition at line 36 of file HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler.h.

◆ NodalMatrixType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::NodalMatrixType = typename Base::NodalMatrixType
private

◆ NodalVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::NodalVectorType = typename Base::NodalVectorType
private

Constructor & Destructor Documentation

◆ HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler()

template<typename ShapeFunction , int GlobalDim>
ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler ( MeshLib::Element const & e,
std::size_t const local_matrix_size,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
HCNonAdvectiveFreeComponentFlowBoundaryConditionData const & data )
inline

Member Function Documentation

◆ assemble()

template<typename ShapeFunction , int GlobalDim>
void ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::assemble ( std::size_t const mesh_item_id,
NumLib::LocalToGlobalIndexMap const & dof_table_boundary,
double const t,
std::vector< GlobalVector * > const & x,
int const process_id,
GlobalMatrix & ,
GlobalVector & b,
GlobalMatrix *  )
inlineoverridevirtual

Implements ProcessLib::GenericNaturalBoundaryConditionLocalAssemblerInterface.

Definition at line 57 of file HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler.h.

62 {
63 NodalVectorType _local_rhs = NodalVectorType::Zero(_local_matrix_size);
64 // Get element nodes for the interpolation from nodes to
65 // integration point.
66 NodalVectorType const boundary_permeability_node_values =
68 t);
69 unsigned const n_integration_points =
71
72 auto const indices =
73 NumLib::getIndices(mesh_item_id, dof_table_boundary);
74 std::vector<double> const local_values = x[process_id]->get(indices);
75 std::size_t const bulk_element_id =
77 std::size_t const bulk_face_id =
79 auto const& bulk_element =
80 *_data.process.getMesh().getElement(bulk_element_id);
81
82 for (unsigned ip = 0; ip < n_integration_points; ip++)
83 {
84 auto const& n_and_weight = Base::_ns_and_weights[ip];
85 auto const& N = n_and_weight.N;
86 auto const& w = n_and_weight.weight;
88
89 auto const bulk_element_point =
90 MeshLib::getBulkElementPoint(bulk_element, bulk_face_id, wp);
91
92 double int_pt_value = 0.0;
93 NumLib::shapeFunctionInterpolate(local_values, N, int_pt_value);
94
95 NodalVectorType const neumann_node_values =
96 -boundary_permeability_node_values * int_pt_value *
97 _data.process.getFlux(bulk_element_id, bulk_element_point, t, x)
98 .dot(_surface_normal);
99 _local_rhs.noalias() += N * neumann_node_values.dot(N) * w;
100 }
101
102 b.add(indices, _local_rhs);
103 }
void add(IndexType rowId, double v)
add entry
Definition EigenVector.h:76
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
const Element * getElement(std::size_t idx) const
Get the element with the given index.
Definition Mesh.h:94
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
MeshLib::Mesh & getMesh() const
Definition Process.h:154
virtual Eigen::Vector3d getFlux(std::size_t, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &) const
Definition Process.h:179
MathLib::Point3d getBulkElementPoint(MeshLib::CellType const bulk_element_cell_type, std::size_t const bulk_face_id, MathLib::WeightedPoint const &point_on_face)
void shapeFunctionInterpolate(const NodalValues &, const ShapeMatrix &)
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::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_data, ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_element, ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_integration_method, ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_local_matrix_size, ProcessLib::GenericNaturalBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_ns_and_weights, ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_surface_normal, MathLib::EigenVector::add(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionData::boundary_permeability, ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionData::bulk_element_ids, ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionData::bulk_face_ids, MeshLib::getBulkElementPoint(), MeshLib::Mesh::getElement(), ProcessLib::Process::getFlux(), MeshLib::Element::getID(), NumLib::getIndices(), ProcessLib::Process::getMesh(), ParameterLib::Parameter< T >::getNodalValuesOnElement(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), NumLib::GenericIntegrationMethod::getWeightedPoint(), ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionData::process, and NumLib::detail::shapeFunctionInterpolate().

◆ getOrientedSurfaceNormal()

template<typename ShapeFunction , int GlobalDim>
Eigen::Vector3d ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::getOrientedSurfaceNormal ( MeshLib::Element const & e) const
inlineprivate

Definition at line 106 of file HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler.h.

107 {
108 // At the moment (2016-09-28) the surface normal is not oriented
109 // according to the right hand rule
110 // for correct results it is necessary to multiply the normal with -1
111 Eigen::Vector3d surface_normal =
113 auto const zeros_size = 3 - _data.process.getMesh().getDimension();
114 surface_normal.tail(zeros_size).setZero();
115 return surface_normal;
116 }
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition FaceRule.cpp:40
unsigned getDimension() const
Returns the dimension of the mesh (determined by the maximum dimension over all elements).
Definition Mesh.h:88

References ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_data, MeshLib::Mesh::getDimension(), ProcessLib::Process::getMesh(), MeshLib::FaceRule::getSurfaceNormal(), and ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionData::process.

Member Data Documentation

◆ _data

◆ _local_matrix_size

template<typename ShapeFunction , int GlobalDim>
std::size_t const ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_local_matrix_size
private

◆ _surface_normal

template<typename ShapeFunction , int GlobalDim>
Eigen::Vector3d const ProcessLib::HCNonAdvectiveFreeComponentFlowBoundaryConditionLocalAssembler< ShapeFunction, GlobalDim >::_surface_normal
private

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