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

Detailed Description

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

Definition at line 42 of file SurfaceFluxLocalAssembler.h.

#include <SurfaceFluxLocalAssembler.h>

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

Public Member Functions

 SurfaceFluxLocalAssembler (MeshLib::Element const &surface_element, std::size_t, NumLib::GenericIntegrationMethod const &integration_method, bool const is_axially_symmetric, MeshLib::PropertyVector< std::size_t > const &bulk_element_ids, MeshLib::PropertyVector< std::size_t > const &bulk_face_ids)
 
void integrate (std::size_t const element_id, std::vector< GlobalVector * > const &x, MeshLib::PropertyVector< double > &specific_flux, double const t, MeshLib::Mesh const &bulk_mesh, std::function< Eigen::Vector3d(std::size_t const, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &)> getFlux) override
 
- Public Member Functions inherited from ProcessLib::SurfaceFluxLocalAssemblerInterface
virtual ~SurfaceFluxLocalAssemblerInterface ()=default
 

Protected Types

using ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
 
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
 
using NodalVectorType = typename ShapeMatricesType::NodalVectorType
 

Static Private Member Functions

static Eigen::Vector3d getSurfaceNormal (MeshLib::Element const &surface_element, MeshLib::Element const &bulk_element)
 

Private Attributes

MeshLib::Element const & _surface_element
 
std::vector< double > _detJ_times_integralMeasure
 
NumLib::GenericIntegrationMethod const & _integration_method
 
std::size_t const _bulk_element_id
 
std::size_t const _bulk_face_id
 

Member Typedef Documentation

◆ NodalMatrixType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::NodalMatrixType = typename ShapeMatricesType::NodalMatrixType
protected

Definition at line 47 of file SurfaceFluxLocalAssembler.h.

◆ NodalVectorType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::NodalVectorType = typename ShapeMatricesType::NodalVectorType
protected

Definition at line 48 of file SurfaceFluxLocalAssembler.h.

◆ ShapeMatricesType

template<typename ShapeFunction , int GlobalDim>
using ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::ShapeMatricesType = ShapeMatrixPolicyType<ShapeFunction, GlobalDim>
protected

Definition at line 46 of file SurfaceFluxLocalAssembler.h.

Constructor & Destructor Documentation

◆ SurfaceFluxLocalAssembler()

template<typename ShapeFunction , int GlobalDim>
ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::SurfaceFluxLocalAssembler ( MeshLib::Element const & surface_element,
std::size_t ,
NumLib::GenericIntegrationMethod const & integration_method,
bool const is_axially_symmetric,
MeshLib::PropertyVector< std::size_t > const & bulk_element_ids,
MeshLib::PropertyVector< std::size_t > const & bulk_face_ids )
inline

Precomputes the shape matrices for a given surface element.

Parameters
surface_elementThe surface element used for precomputing the shape matrices used later on for the integration.
is_axially_symmetriccorrects integration measure for cylinder coordinates.
bulk_element_idsThe id of the corresponding element in the bulk mesh.
bulk_face_idsThe id of the corresponding face in the bulk element.
integration_methodThe integration method used.

Definition at line 61 of file SurfaceFluxLocalAssembler.h.

68 : _surface_element(surface_element),
69 _integration_method(integration_method),
70 _bulk_element_id(bulk_element_ids[surface_element.getID()]),
71 _bulk_face_id(bulk_face_ids[surface_element.getID()])
72 {
73 auto const n_integration_points =
75
76 auto const shape_matrices =
79 _surface_element, is_axially_symmetric, _integration_method);
80 for (std::size_t ip = 0; ip < n_integration_points; ++ip)
81 {
83 shape_matrices[ip].detJ * shape_matrices[ip].integralMeasure);
84 }
85 }
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
NumLib::GenericIntegrationMethod const & _integration_method
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)
@ N_J
calculates N, dNdr, J, and detJ

References ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_detJ_times_integralMeasure, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_integration_method, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_surface_element, NumLib::GenericIntegrationMethod::getNumberOfPoints(), NumLib::initShapeMatrices(), and NumLib::N_J.

Member Function Documentation

◆ getSurfaceNormal()

template<typename ShapeFunction , int GlobalDim>
static Eigen::Vector3d ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::getSurfaceNormal ( MeshLib::Element const & surface_element,
MeshLib::Element const & bulk_element )
inlinestaticprivate

Definition at line 154 of file SurfaceFluxLocalAssembler.h.

157 {
158 Eigen::Vector3d surface_element_normal;
159
160 if (surface_element.getGeomType() == MeshLib::MeshElemType::LINE)
161 {
162 auto const bulk_normal =
164 auto const& l0 = surface_element.getNode(0)->asEigenVector3d();
165 auto const& l1 = surface_element.getNode(1)->asEigenVector3d();
166 Eigen::Vector3d const line = l1 - l0;
167 surface_element_normal = line.cross(bulk_normal);
168 }
169 else
170 {
171 surface_element_normal =
173 }
174 surface_element_normal.normalize();
175 // At the moment (2016-09-28) the surface normal is not oriented
176 // according to the right hand rule. Thus for an intuitive flux
177 // output, i.e., inflow has positive sign, outflow has negative
178 // sign, the normal must not be multiplied by -1.
179 return surface_element_normal;
180 };
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition FaceRule.cpp:40

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

Referenced by ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::integrate().

◆ integrate()

template<typename ShapeFunction , int GlobalDim>
void ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::integrate ( std::size_t const element_id,
std::vector< GlobalVector * > const & x,
MeshLib::PropertyVector< double > & specific_flux,
double const t,
MeshLib::Mesh const & bulk_mesh,
std::function< Eigen::Vector3d(std::size_t const, MathLib::Point3d const &, double const, std::vector< GlobalVector * > const &)> getFlux )
inlineoverridevirtual

Integration for the element with the id element_id.

Parameters
element_idid of the element
xThe global vector containing the values for numerical integration.
specific_fluxPropertyVector the integration result will be stored into, where specific_flux has the same number of entries like mesh elements exists.
tThe integration is performed at the time t.
bulk_meshStores a reference to the bulk mesh that is needed to fetch the information for the integration over the surface mesh.
getFluxfunction that calculates the flux in the integration points of the face elements of the bulk element that belongs to the surface.

Implements ProcessLib::SurfaceFluxLocalAssemblerInterface.

Definition at line 100 of file SurfaceFluxLocalAssembler.h.

109 {
110 auto const& bulk_element = *bulk_mesh.getElement(_bulk_element_id);
111 auto const surface_element_normal =
112 getSurfaceNormal(_surface_element, bulk_element);
113
114 double element_area = 0.0;
115 std::size_t const n_integration_points =
117 // specific_flux[id_of_element] +=
118 // int_{\Gamma_e} \alpha \cdot flux \cdot normal \d \Gamma /
119 // element_area
120 for (std::size_t ip(0); ip < n_integration_points; ip++)
121 {
122 auto const& wp = _integration_method.getWeightedPoint(ip);
123
124 auto const bulk_element_point =
126 auto const bulk_flux =
127 getFlux(_bulk_element_id, bulk_element_point, t, x);
128 for (int component_id(0);
129 component_id < specific_flux.getNumberOfGlobalComponents();
130 ++component_id)
131 {
132 // TODO find solution for 2d case
133 double const bulk_grad_times_normal(
134 Eigen::Map<Eigen::RowVectorXd const>(bulk_flux.data(),
135 bulk_flux.size())
136 .dot(surface_element_normal));
137
138 specific_flux.getComponent(element_id, component_id) +=
139 bulk_grad_times_normal * _detJ_times_integralMeasure[ip] *
140 wp.getWeight();
141 }
142 element_area += _detJ_times_integralMeasure[ip] * wp.getWeight();
143 }
144 for (int component_id(0);
145 component_id < specific_flux.getNumberOfGlobalComponents();
146 ++component_id)
147 {
148 specific_flux.getComponent(element_id, component_id) /=
149 element_area;
150 }
151 }
int getNumberOfGlobalComponents() const
PROP_VAL_TYPE & getComponent(std::size_t tuple_index, int component)
Returns the value for the given component stored in the given tuple.
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
static Eigen::Vector3d getSurfaceNormal(MeshLib::Element const &surface_element, MeshLib::Element const &bulk_element)
MathLib::Point3d getBulkElementPoint(MeshLib::CellType const bulk_element_cell_type, std::size_t const bulk_face_id, MathLib::WeightedPoint const &point_on_face)

References ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_bulk_element_id, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_bulk_face_id, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_detJ_times_integralMeasure, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_integration_method, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_surface_element, MeshLib::getBulkElementPoint(), MeshLib::PropertyVector< PROP_VAL_TYPE >::getComponent(), MeshLib::Mesh::getElement(), MeshLib::PropertyVectorBase::getNumberOfGlobalComponents(), NumLib::GenericIntegrationMethod::getNumberOfPoints(), ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::getSurfaceNormal(), and NumLib::GenericIntegrationMethod::getWeightedPoint().

Member Data Documentation

◆ _bulk_element_id

template<typename ShapeFunction , int GlobalDim>
std::size_t const ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_bulk_element_id
private

◆ _bulk_face_id

template<typename ShapeFunction , int GlobalDim>
std::size_t const ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_bulk_face_id
private

◆ _detJ_times_integralMeasure

template<typename ShapeFunction , int GlobalDim>
std::vector<double> ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, GlobalDim >::_detJ_times_integralMeasure
private

◆ _integration_method

◆ _surface_element


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