OGS
PythonBoundaryConditionLocalAssembler.h
Go to the documentation of this file.
1
11#pragma once
12
16
17namespace ProcessLib
18{
19template <typename ShapeFunction, typename LowerOrderShapeFunction,
20 int GlobalDim>
23{
24 using LocAsmImpl = ProcessLib::BoundaryConditionAndSourceTerm::Python::
25 BcAndStLocalAssemblerImpl<PythonBcData, ShapeFunction,
26 LowerOrderShapeFunction, GlobalDim>;
27 using Traits = typename LocAsmImpl::Traits;
28
29public:
31 MeshLib::Element const& e,
32 std::size_t const /*local_matrix_size*/,
33 NumLib::GenericIntegrationMethod const& integration_method,
34 bool is_axially_symmetric,
35 PythonBcData const& data)
36 : impl_{e, integration_method, is_axially_symmetric, data}
37 {
38 }
39
40 void assemble(std::size_t const boundary_element_id,
41 NumLib::LocalToGlobalIndexMap const& dof_table_boundary,
42 double const t, std::vector<GlobalVector*> const& xs,
43 int const process_id, GlobalMatrix* /*K*/, GlobalVector& b,
44 GlobalMatrix* const Jac) override
45 {
46 impl_.assemble(boundary_element_id, dof_table_boundary, t,
47 *xs[process_id], b, Jac);
48 }
49
50 double interpolate(unsigned const local_node_id,
51 NumLib::LocalToGlobalIndexMap const& dof_table_boundary,
52 GlobalVector const& x, int const var,
53 int const comp) const override
54 {
55 if constexpr (ShapeFunction::ORDER < 2 ||
56 LowerOrderShapeFunction::ORDER > 1)
57 {
58 return std::numeric_limits<double>::quiet_NaN();
59 }
60 else
61 {
62 auto const N = computeLowerOrderShapeMatrix(local_node_id);
63
64 auto const nodal_values_base_node =
67 impl_.element,
68 impl_.bc_or_st_data.bc_or_st_mesh.getID(),
69 dof_table_boundary, x, var, comp);
70
71 return N * nodal_values_base_node;
72 }
73 }
74
75private:
76 typename Traits::LowerOrderShapeMatrix computeLowerOrderShapeMatrix(
77 unsigned const local_node_id) const
78 {
79 using HigherOrderMeshElement = typename ShapeFunction::MeshElement;
80
81 assert(local_node_id < impl_.element.getNumberOfNodes());
82
83 std::array natural_coordss{MathLib::Point3d{NumLib::NaturalCoordinates<
84 HigherOrderMeshElement>::coordinates[local_node_id]}};
85
86 bool const is_axially_symmetric = false; // does not matter for N
87 auto const shape_matrices = NumLib::computeShapeMatrices<
88 LowerOrderShapeFunction,
89 typename Traits::LowerOrderShapeMatrixPolicy, GlobalDim,
90 NumLib::ShapeMatrixType::N>(impl_.element, is_axially_symmetric,
91 natural_coordss);
92 return shape_matrices.front().N;
93 }
94
96};
97
98} // namespace ProcessLib
Global vector based on Eigen vector.
Definition EigenVector.h:25
double interpolate(unsigned const local_node_id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, GlobalVector const &x, int const var, int const comp) const override
ProcessLib::BoundaryConditionAndSourceTerm::Python:: BcAndStLocalAssemblerImpl< PythonBcData, ShapeFunction, LowerOrderShapeFunction, GlobalDim > LocAsmImpl
Traits::LowerOrderShapeMatrix computeLowerOrderShapeMatrix(unsigned const local_node_id) const
void assemble(std::size_t const boundary_element_id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &xs, int const process_id, GlobalMatrix *, GlobalVector &b, GlobalMatrix *const Jac) override
PythonBoundaryConditionLocalAssembler(MeshLib::Element const &e, std::size_t const, NumLib::GenericIntegrationMethod const &integration_method, bool is_axially_symmetric, PythonBcData const &data)
std::vector< typename ShapeMatricesType::ShapeMatrices, Eigen::aligned_allocator< typename ShapeMatricesType::ShapeMatrices > > computeShapeMatrices(MeshLib::Element const &e, bool const is_axially_symmetric, PointContainer const &points)
Eigen::VectorXd collectDofsToMatrixOnBaseNodesSingleComponent(MeshLib::Element const &element, std::size_t const mesh_id, NumLib::LocalToGlobalIndexMap const &dof_table, GlobalVector const &x, int const variable, int const component)