OGS
CreateLocalAssemblers.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <vector>
13
14#include "BaseLib/Logging.h"
17
18namespace ProcessLib
19{
20namespace LIE
21{
22namespace SmallDeformation
23{
24namespace detail
25{
26template <int GlobalDim,
27 template <typename, int> class LocalAssemblerMatrixImplementation,
28 template <typename, int>
29 class LocalAssemblerMatrixNearFractureImplementation,
30 template <typename, int> class LocalAssemblerFractureImplementation,
31 typename LocalAssemblerInterface, typename... ExtraCtorArgs>
33 NumLib::LocalToGlobalIndexMap const& dof_table,
34 std::vector<MeshLib::Element*> const& mesh_elements,
35 std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
36 NumLib::IntegrationOrder const integration_order,
37 ExtraCtorArgs&&... extra_ctor_args)
38{
39 // Shape matrices initializer
41 LocalAssemblerInterface, LocalAssemblerMatrixImplementation,
42 LocalAssemblerMatrixNearFractureImplementation,
43 LocalAssemblerFractureImplementation, GlobalDim, ExtraCtorArgs...>;
44
45 DBUG("Create local assemblers.");
46 // Populate the vector of local assemblers.
47 local_assemblers.resize(mesh_elements.size());
48
49 LocalDataInitializer initializer(dof_table, integration_order);
50
51 DBUG("Calling local assembler builder for all mesh elements.");
53 initializer, mesh_elements, local_assemblers,
54 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
55}
56
57} // namespace detail
58
70template <int GlobalDim,
71 template <typename, int> class LocalAssemblerMatrixImplementation,
72 template <typename, int>
73 class LocalAssemblerMatrixNearFractureImplementation,
74 template <typename, int> class LocalAssemblerFractureImplementation,
75 typename LocalAssemblerInterface, typename... ExtraCtorArgs>
77 std::vector<MeshLib::Element*> const& mesh_elements,
78 NumLib::LocalToGlobalIndexMap const& dof_table,
79 std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
80 NumLib::IntegrationOrder const integration_order,
81 ExtraCtorArgs&&... extra_ctor_args)
82{
83 DBUG("Create local assemblers.");
84
86 GlobalDim, LocalAssemblerMatrixImplementation,
87 LocalAssemblerMatrixNearFractureImplementation,
88 LocalAssemblerFractureImplementation>(
89 dof_table, mesh_elements, local_assemblers, integration_order,
90 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
91}
92
93} // namespace SmallDeformation
94} // namespace LIE
95} // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
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)