OGS
GenericNaturalBoundaryConditionLocalAssembler.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
11
12namespace ProcessLib
13{
15{
16public:
18
19 virtual void assemble(
20 std::size_t const id,
21 NumLib::LocalToGlobalIndexMap const& dof_table_boundary, double const t,
22 std::vector<GlobalVector*> const& x, int const process_id,
23 GlobalMatrix* K, GlobalVector& b, GlobalMatrix* Jac) = 0;
24};
25
26template <typename ShapeFunction, int GlobalDim>
29{
30protected:
34
36 {
37 NAndWeight(typename ShapeMatricesType::ShapeMatrices::ShapeType&& N_,
38 double const weight_)
39 : N(std::move(N_)), weight(weight_)
40 {
41 }
42 typename ShapeMatricesType::ShapeMatrices::ShapeType const N;
43 double const weight;
44 };
45
46private:
47 static std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
48 initNsAndWeights(MeshLib::Element const& e, bool is_axially_symmetric,
49 NumLib::GenericIntegrationMethod const& integration_method)
50 {
51 std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
52 ns_and_weights;
53 ns_and_weights.reserve(integration_method.getNumberOfPoints());
54
56 GlobalDim>(e, is_axially_symmetric,
57 integration_method);
58 for (unsigned ip = 0; ip < sms.size(); ++ip)
59 {
60 auto& sm = sms[ip];
61 double const w =
62 sm.detJ * sm.integralMeasure *
63 integration_method.getWeightedPoint(ip).getWeight();
64
65 ns_and_weights.emplace_back(std::move(sm.N), w);
66 }
67
68 return ns_and_weights;
69 }
70
71public:
73 MeshLib::Element const& e, bool is_axially_symmetric,
74 NumLib::GenericIntegrationMethod const& integration_method)
75 : _integration_method(integration_method),
77 initNsAndWeights(e, is_axially_symmetric, integration_method)),
78 _element(e)
79 {
80 }
81
82protected:
84 std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>> const
87};
88
89} // namespace ProcessLib
MathLib::EigenMatrix GlobalMatrix
MathLib::EigenVector GlobalVector
EigenFixedShapeMatrixPolicy< ShapeFunction, GlobalDim > ShapeMatrixPolicyType
constexpr 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_)