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

Detailed Description

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

Definition at line 39 of file SurfaceFluxLocalAssembler.h.

#include <SurfaceFluxLocalAssembler.h>

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

Public Member Functions

 SurfaceFluxLocalAssembler (MeshLib::Element const &surface_element, std::size_t, bool const is_axially_symmetric, unsigned const integration_order, 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
 

Private Attributes

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

Member Typedef Documentation

◆ NodalMatrixType

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

Definition at line 44 of file SurfaceFluxLocalAssembler.h.

◆ NodalVectorType

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

Definition at line 45 of file SurfaceFluxLocalAssembler.h.

◆ ShapeMatricesType

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

Definition at line 43 of file SurfaceFluxLocalAssembler.h.

Constructor & Destructor Documentation

◆ SurfaceFluxLocalAssembler()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::SurfaceFluxLocalAssembler ( MeshLib::Element const &  surface_element,
std::size_t  ,
bool const  is_axially_symmetric,
unsigned const  integration_order,
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_orderthe order of the integration

Definition at line 58 of file SurfaceFluxLocalAssembler.h.

65  : _surface_element(surface_element),
66  _integration_method(integration_order),
67  _bulk_element_id(bulk_element_ids[surface_element.getID()]),
68  _bulk_face_id(bulk_face_ids[surface_element.getID()])
69  {
70  auto const n_integration_points =
71  _integration_method.getNumberOfPoints();
72 
73  auto const shape_matrices =
75  GlobalDim, NumLib::ShapeMatrixType::N_J>(
76  _surface_element, is_axially_symmetric, _integration_method);
77  for (std::size_t ip = 0; ip < n_integration_points; ++ip)
78  {
80  shape_matrices[ip].detJ * shape_matrices[ip].integralMeasure);
81  }
82  }
ShapeMatrixPolicyType< ShapeFunction, GlobalDim > ShapeMatricesType
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, IntegrationMethod, GlobalDim >::_detJ_times_integralMeasure, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_integration_method, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_surface_element, NumLib::initShapeMatrices(), and NumLib::N_J.

Member Function Documentation

◆ integrate()

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
void ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, 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 97 of file SurfaceFluxLocalAssembler.h.

106  {
107  auto get_surface_normal =
108  [this, &bulk_mesh](
109  MeshLib::Element const& surface_element) -> Eigen::Vector3d {
110  Eigen::Vector3d surface_element_normal;
111  if (surface_element.getGeomType() == MeshLib::MeshElemType::LINE)
112  {
113  auto const bulk_normal = MeshLib::FaceRule::getSurfaceNormal(
114  *bulk_mesh.getElements()[_bulk_element_id]);
115  auto const l0 = Eigen::Map<Eigen::Vector3d const>(
117  auto const l1 = Eigen::Map<Eigen::Vector3d const>(
119  Eigen::Vector3d const line = l1 - l0;
120  surface_element_normal = line.cross(bulk_normal);
121  }
122  else
123  {
124  surface_element_normal =
125  MeshLib::FaceRule::getSurfaceNormal(surface_element);
126  }
127  surface_element_normal.normalize();
128  // At the moment (2016-09-28) the surface normal is not oriented
129  // according to the right hand rule. Thus for an intuitive flux
130  // output, i.e., inflow has positive sign, outflow has negative
131  // sign, the normal must not be multiplied by -1.
132  return surface_element_normal;
133  };
134  auto const surface_element_normal =
135  get_surface_normal(_surface_element);
136 
137  double element_area = 0.0;
138  std::size_t const n_integration_points =
139  _integration_method.getNumberOfPoints();
140  // specific_flux[id_of_element] +=
141  // int_{\Gamma_e} \alpha \cdot flux \cdot normal \d \Gamma /
142  // element_area
143  for (std::size_t ip(0); ip < n_integration_points; ip++)
144  {
145  auto const& wp = _integration_method.getWeightedPoint(ip);
146 
147  auto const bulk_element_point = MeshLib::getBulkElementPoint(
148  bulk_mesh, _bulk_element_id, _bulk_face_id, wp);
149  auto const bulk_flux =
150  getFlux(_bulk_element_id, bulk_element_point, t, x);
151  for (int component_id(0);
152  component_id < specific_flux.getNumberOfGlobalComponents();
153  ++component_id)
154  {
155  // TODO find solution for 2d case
156  double const bulk_grad_times_normal(
157  Eigen::Map<Eigen::RowVectorXd const>(bulk_flux.data(),
158  bulk_flux.size())
159  .dot(surface_element_normal));
160 
161  specific_flux.getComponent(element_id, component_id) +=
162  bulk_grad_times_normal * _detJ_times_integralMeasure[ip] *
163  wp.getWeight();
164  }
165  element_area += _detJ_times_integralMeasure[ip] * wp.getWeight();
166  }
167  for (int component_id(0);
168  component_id < specific_flux.getNumberOfGlobalComponents();
169  ++component_id)
170  {
171  specific_flux.getComponent(element_id, component_id) /=
172  element_area;
173  }
174  }
const T * getCoords() const
Definition: TemplatePoint.h:75
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
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::Point3d getBulkElementPoint(Tri const &, std::size_t const face_id, MathLib::WeightedPoint1D const &wp)

References ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_bulk_element_id, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_bulk_face_id, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_detJ_times_integralMeasure, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_integration_method, ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_surface_element, MeshLib::getBulkElementPoint(), MeshLib::PropertyVector< PROP_VAL_TYPE >::getComponent(), MathLib::TemplatePoint< T, DIM >::getCoords(), MeshLib::Mesh::getElements(), MeshLib::Element::getNode(), MeshLib::PropertyVectorBase::getNumberOfGlobalComponents(), MeshLib::FaceRule::getSurfaceNormal(), and MeshLib::LINE.

Member Data Documentation

◆ _bulk_element_id

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

◆ _bulk_face_id

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

◆ _detJ_times_integralMeasure

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

◆ _integration_method

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
IntegrationMethod const ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_integration_method
private

◆ _surface_element

template<typename ShapeFunction , typename IntegrationMethod , int GlobalDim>
MeshLib::Element const& ProcessLib::SurfaceFluxLocalAssembler< ShapeFunction, IntegrationMethod, GlobalDim >::_surface_element
private

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