OGS
GenericNaturalBoundaryConditionLocalAssembler.h
Go to the documentation of this file.
1
11#pragma once
12
18
19namespace ProcessLib
20{
22{
23public:
25
26 virtual void assemble(
27 std::size_t const id,
28 NumLib::LocalToGlobalIndexMap const& dof_table_boundary, double const t,
29 std::vector<GlobalVector*> const& x, int const process_id,
30 GlobalMatrix* K, GlobalVector& b, GlobalMatrix* Jac) = 0;
31};
32
33template <typename ShapeFunction, int GlobalDim>
36{
37protected:
41
43 {
44 NAndWeight(typename ShapeMatricesType::ShapeMatrices::ShapeType&& N_,
45 double const weight_)
46 : N(std::move(N_)), weight(weight_)
47 {
48 }
49 typename ShapeMatricesType::ShapeMatrices::ShapeType const N;
50 double const weight;
51 };
52
53private:
54 static std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
55 initNsAndWeights(MeshLib::Element const& e, bool is_axially_symmetric,
56 NumLib::GenericIntegrationMethod const& integration_method)
57 {
58 std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
59 ns_and_weights;
60 ns_and_weights.reserve(integration_method.getNumberOfPoints());
61
62 auto sms = NumLib::initShapeMatrices<ShapeFunction, ShapeMatricesType,
63 GlobalDim>(e, is_axially_symmetric,
64 integration_method);
65 for (unsigned ip = 0; ip < sms.size(); ++ip)
66 {
67 auto& sm = sms[ip];
68 double const w =
69 sm.detJ * sm.integralMeasure *
70 integration_method.getWeightedPoint(ip).getWeight();
71
72 ns_and_weights.emplace_back(std::move(sm.N), w);
73 }
74
75 return ns_and_weights;
76 }
77
78public:
80 MeshLib::Element const& e, bool is_axially_symmetric,
81 NumLib::GenericIntegrationMethod const& integration_method)
82 : _integration_method(integration_method),
84 initNsAndWeights(e, is_axially_symmetric, integration_method)),
85 _element(e)
86 {
87 }
88
89protected:
91 std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>> const
94};
95
96} // namespace ProcessLib
Definition of the Element class.
Global vector based on Eigen vector.
Definition EigenVector.h:25
double getWeight() const
MathLib::WeightedPoint const & getWeightedPoint(unsigned const igp) const
virtual void assemble(std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac)=0
GenericNaturalBoundaryConditionLocalAssembler(MeshLib::Element const &e, bool is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method)
static std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > initNsAndWeights(MeshLib::Element const &e, bool is_axially_symmetric, NumLib::GenericIntegrationMethod const &integration_method)
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
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)
MatrixType< ShapeFunction::NPOINTS, ShapeFunction::NPOINTS > NodalMatrixType
VectorType< ShapeFunction::NPOINTS > NodalVectorType
NAndWeight(typename ShapeMatricesType::ShapeMatrices::ShapeType &&N_, double const weight_)