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 
18 namespace ProcessLib
19 {
20 namespace SmallDeformation
21 {
22 namespace detail
23 {
24 template <int GlobalDim,
25  template <typename /* shp fct */, int /* global dim */>
26  class LocalAssemblerImplementation,
27  typename LocalAssemblerInterface, typename... ExtraCtorArgs>
29  NumLib::LocalToGlobalIndexMap const& dof_table,
30  std::vector<MeshLib::Element*> const& mesh_elements,
31  std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
32  NumLib::IntegrationOrder const integration_order,
33  ExtraCtorArgs&&... extra_ctor_args)
34 {
35  using LocAsmFactory =
37  LocalAssemblerImplementation,
38  GlobalDim, ExtraCtorArgs...>;
39 
40  DBUG("Create local assemblers.");
41 
42  LocAsmFactory factory(dof_table, integration_order);
43  local_assemblers.resize(mesh_elements.size());
44 
45  DBUG("Calling local assembler builder for all mesh elements.");
47  factory, mesh_elements, local_assemblers,
48  std::forward<ExtraCtorArgs>(extra_ctor_args)...);
49 }
50 
51 } // namespace detail
52 
64 template <int GlobalDim,
65  template <typename /* shp fct */, int /* global dim */>
66  class LocalAssemblerImplementation,
67  typename LocalAssemblerInterface, typename... ExtraCtorArgs>
69  std::vector<MeshLib::Element*> const& mesh_elements,
70  NumLib::LocalToGlobalIndexMap const& dof_table,
71  std::vector<std::unique_ptr<LocalAssemblerInterface>>& local_assemblers,
72  NumLib::IntegrationOrder const integration_order,
73  ExtraCtorArgs&&... extra_ctor_args)
74 {
75  DBUG("Create local assemblers.");
76 
77  detail::createLocalAssemblers<GlobalDim, LocalAssemblerImplementation>(
78  dof_table, mesh_elements, local_assemblers, integration_order,
79  std::forward<ExtraCtorArgs>(extra_ctor_args)...);
80 }
81 } // namespace SmallDeformation
82 
83 } // namespace ProcessLib
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition: Logging.h:29
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)