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 SmallDeformation
21{
22namespace detail
23{
24template <int GlobalDim,
25 template <typename /* shp fct */, int /* global dim */>
26 class LocalAssemblerImplementation,
27 typename LocalAssemblerInterface,
28 IntegrationMethodProviderOrIntegrationOrder ProviderOrOrder,
29 typename... ExtraCtorArgs>
31 NumLib::LocalToGlobalIndexMap const& dof_table,
32 std::vector<MeshLib::Element*> const& mesh_elements,
33 std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
34 ProviderOrOrder const& provider_or_order,
35 ExtraCtorArgs&&... extra_ctor_args)
36{
37 DBUG("Create local assemblers.");
38
39 auto const& integration_method_provider =
40 getIntegrationMethodProvider(provider_or_order);
41
42 using IntMethProv =
43 std::remove_cvref_t<decltype(integration_method_provider)>;
44 using LocAsmFactory = ProcessLib::LocalAssemblerFactorySD<
45 LocalAssemblerInterface, LocalAssemblerImplementation, IntMethProv,
46 GlobalDim, ExtraCtorArgs...>;
47
48 LocAsmFactory factory(dof_table, integration_method_provider);
49 local_assemblers.resize(mesh_elements.size());
50
51 DBUG("Calling local assembler builder for all mesh elements.");
53 factory, mesh_elements, local_assemblers,
54 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
55}
56
57} // namespace detail
58
70template <int GlobalDim,
71 template <typename /* shp fct */, int /* global dim */>
72 class LocalAssemblerImplementation,
75 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 ProviderOrOrder const& provider_or_order,
81 ExtraCtorArgs&&... extra_ctor_args)
82{
83 DBUG("Create local assemblers.");
84
85 detail::createLocalAssemblers<GlobalDim, LocalAssemblerImplementation>(
86 dof_table, mesh_elements, local_assemblers, provider_or_order,
87 std::forward<ExtraCtorArgs>(extra_ctor_args)...);
88}
89} // namespace SmallDeformation
90
91} // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void createLocalAssemblers(std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, ProviderOrOrder const &provider_or_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, ProviderOrOrder const &provider_or_order, ExtraCtorArgs &&... extra_ctor_args)
static void transformDereferenced(F const &f, C const &c, Data &data, Args_ &&... args)