OGS
LIE/SmallDeformation/LocalAssembler/CreateLocalAssemblers.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
6#include <vector>
7
8#include "BaseLib/Logging.h"
11
12namespace ProcessLib
13{
14namespace LIE
15{
16namespace SmallDeformation
17{
18namespace detail
19{
20template <int DisplacementDim,
21 template <typename, int> class LocalAssemblerMatrixImplementation,
22 template <typename, int>
23 class LocalAssemblerMatrixNearFractureImplementation,
24 template <typename, int> class LocalAssemblerFractureImplementation,
25 typename LocalAssemblerInterface, typename... ExtraCtorArgs>
27 NumLib::LocalToGlobalIndexMap const& dof_table,
28 std::vector<MeshLib::Element*> const& mesh_elements,
29 std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
30 NumLib::IntegrationOrder const integration_order,
31 ExtraCtorArgs&&... extra_ctor_args)
32{
33 // Shape matrices initializer
36 LocalAssemblerMatrixImplementation,
37 LocalAssemblerMatrixNearFractureImplementation,
38 LocalAssemblerFractureImplementation,
39 DisplacementDim, ExtraCtorArgs...>;
40
41 DBUG("Create local assemblers.");
42 // Populate the vector of local assemblers.
43 local_assemblers.resize(mesh_elements.size());
44
45 LocalDataInitializer initializer(dof_table, integration_order);
46
47 DBUG("Calling local assembler builder for all mesh elements.");
49 initializer, mesh_elements, local_assemblers,
50 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
51}
52
53} // namespace detail
54
66template <int DisplacementDim,
67 template <typename, int> class LocalAssemblerMatrixImplementation,
68 template <typename, int>
69 class LocalAssemblerMatrixNearFractureImplementation,
70 template <typename, int> class LocalAssemblerFractureImplementation,
71 typename LocalAssemblerInterface, typename... ExtraCtorArgs>
73 std::vector<MeshLib::Element*> const& mesh_elements,
74 NumLib::LocalToGlobalIndexMap const& dof_table,
75 std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
76 NumLib::IntegrationOrder const integration_order,
77 ExtraCtorArgs&&... extra_ctor_args)
78{
79 DBUG("Create local assemblers.");
80
82 DisplacementDim, LocalAssemblerMatrixImplementation,
83 LocalAssemblerMatrixNearFractureImplementation,
84 LocalAssemblerFractureImplementation>(
85 dof_table, mesh_elements, local_assemblers, integration_order,
86 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
87}
88
89} // namespace SmallDeformation
90} // namespace LIE
91} // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:22
void createLocalAssemblers(NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< MeshLib::Element * > const &mesh_elements, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
static void transformDereferenced(F const &f, C const &c, Data &data, Args_ &&... args)