OGS
GenericNaturalBoundaryConditionLocalAssembler.h
Go to the documentation of this file.
1 
11 #pragma once
12 
17 
18 namespace ProcessLib
19 {
21 {
22 public:
24 
25  virtual void assemble(
26  std::size_t const id,
27  NumLib::LocalToGlobalIndexMap const& dof_table_boundary, double const t,
28  std::vector<GlobalVector*> const& x, int const process_id,
29  GlobalMatrix& K, GlobalVector& b, GlobalMatrix* Jac) = 0;
30 };
31 
32 template <typename ShapeFunction, typename IntegrationMethod, int GlobalDim>
35 {
36 protected:
40 
41  struct NAndWeight
42  {
44  double const weight_)
45  : N(std::move(N_)), weight(weight_)
46  {
47  }
49  double const weight;
50  };
51 
52 private:
53  static std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
54  initNsAndWeights(MeshLib::Element const& e, bool is_axially_symmetric,
55  unsigned const integration_order)
56  {
57  IntegrationMethod const integration_method(integration_order);
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 
78 public:
80  MeshLib::Element const& e, bool is_axially_symmetric,
81  unsigned const integration_order)
82  : _integration_method(integration_order),
84  initNsAndWeights(e, is_axially_symmetric, integration_order)),
85  _element(e)
86  {
87  }
88 
89 protected:
90  IntegrationMethod const _integration_method;
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:26
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
static std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > initNsAndWeights(MeshLib::Element const &e, bool is_axially_symmetric, unsigned const integration_order)
std::vector< NAndWeight, Eigen::aligned_allocator< NAndWeight > > const _ns_and_weights
GenericNaturalBoundaryConditionLocalAssembler(MeshLib::Element const &e, bool is_axially_symmetric, unsigned const integration_order)
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_)