diff --git a/ProcessLib/HydroMechanics/CreateLocalAssemblers.h b/ProcessLib/HydroMechanics/CreateLocalAssemblers.h index 3201b94494c067948a253cce9485d1517eca9e0a..e8992a5eeaec6b5fe322375fb6740d2cb2012f3f 100644 --- a/ProcessLib/HydroMechanics/CreateLocalAssemblers.h +++ b/ProcessLib/HydroMechanics/CreateLocalAssemblers.h @@ -22,8 +22,8 @@ namespace HydroMechanics { namespace detail { -template <unsigned GlobalDim, int DisplacementDim, - template <typename, typename, typename, unsigned, int> +template <int GlobalDim, + template <typename, typename, typename, int> class LocalAssemblerImplementation, typename LocalAssemblerInterface, typename... ExtraCtorArgs> void createLocalAssemblers( @@ -37,7 +37,7 @@ void createLocalAssemblers( using LocalDataInitializer = LocalDataInitializer<LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, - DisplacementDim, ExtraCtorArgs...>; + ExtraCtorArgs...>; DBUG("Create local assemblers."); // Populate the vector of local assemblers. @@ -64,9 +64,8 @@ void createLocalAssemblers( * The first two template parameters cannot be deduced from the arguments. * Therefore they always have to be provided manually. */ -template <int DisplacementDim, - template <typename, typename, typename, unsigned, int> - class LocalAssemblerImplementation, +template <int GlobalDim, template <typename, typename, typename, int> + class LocalAssemblerImplementation, typename LocalAssemblerInterface, typename... ExtraCtorArgs> void createLocalAssemblers( const unsigned dimension, @@ -78,25 +77,9 @@ void createLocalAssemblers( { DBUG("Create local assemblers."); - switch (dimension) - { - case 2: - detail::createLocalAssemblers<2, DisplacementDim, - LocalAssemblerImplementation>( - dof_table, shapefunction_order, mesh_elements, local_assemblers, - std::forward<ExtraCtorArgs>(extra_ctor_args)...); - break; - case 3: - detail::createLocalAssemblers<3, DisplacementDim, - LocalAssemblerImplementation>( - dof_table, shapefunction_order, mesh_elements, local_assemblers, - std::forward<ExtraCtorArgs>(extra_ctor_args)...); - break; - default: - OGS_FATAL( - "Meshes with dimension different than two and three are not " - "supported."); - } + detail::createLocalAssemblers<GlobalDim, LocalAssemblerImplementation>( + dof_table, shapefunction_order, mesh_elements, local_assemblers, + std::forward<ExtraCtorArgs>(extra_ctor_args)...); } } // HydroMechanics diff --git a/ProcessLib/HydroMechanics/LocalDataInitializer.h b/ProcessLib/HydroMechanics/LocalDataInitializer.h index cd3323c8e0fa69ef4633df1eb2892b9aba2c423c..0589321252773611294d8808450d10cdbbbf67fa 100644 --- a/ProcessLib/HydroMechanics/LocalDataInitializer.h +++ b/ProcessLib/HydroMechanics/LocalDataInitializer.h @@ -115,11 +115,11 @@ namespace HydroMechanics /// /// \attention This is modified version of the ProcessLib::LocalDataInitializer /// class which does not include line elements, allows only shapefunction of -/// order 2, and provides additional template argument DisplacementDim. +/// order 2. template <typename LocalAssemblerInterface, - template <typename, typename, typename, unsigned, int> - class LocalAssemblerData, - unsigned GlobalDim, int DisplacementDim, typename... ConstructorArgs> + template <typename, typename, typename, int> + class HydroMechanicsLocalAssembler, + int GlobalDim, typename... ConstructorArgs> class LocalDataInitializer final { public: @@ -223,10 +223,9 @@ private: template <typename ShapeFunctionDisplacement, typename ShapeFunctionPressure> - using LAData = - LocalAssemblerData<ShapeFunctionDisplacement, ShapeFunctionPressure, - IntegrationMethod<ShapeFunctionDisplacement>, - GlobalDim, DisplacementDim>; + using LAData = HydroMechanicsLocalAssembler< + ShapeFunctionDisplacement, ShapeFunctionPressure, + IntegrationMethod<ShapeFunctionDisplacement>, GlobalDim>; /// A helper forwarding to the correct version of makeLocalAssemblerBuilder /// depending whether the global dimension is less than the shape function's