Skip to content
Snippets Groups Projects
Commit b37a7272 authored by Dmitry Yu. Naumov's avatar Dmitry Yu. Naumov
Browse files

[PL] Reduce number of LocalAsm instantiations.

Only assemblers for shape functions with dimension
less or equal to the global dimension will be instatiated.
parent d96f50c1
No related branches found
No related tags found
No related merge requests found
......@@ -340,9 +340,15 @@ private:
IntegrationMethod<ShapeFunction>, GlobalDim,
DisplacementDim>;
/// Generates a function that creates a new LocalAssembler of type LAData<SHAPE_FCT>
template<typename ShapeFct>
static LADataBuilder makeLocalAssemblerBuilder()
/// Generates a function that creates a new LocalAssembler of type
/// LAData<ShapeFct>. Only functions with shape function's dimension less or
/// equal to the global dimension are instantiated, e.g. following
/// combinations of shape functions and global dimensions: (Line2, 1),
/// (Line2, 2), (Line2, 3), (Hex20, 3) but not (Hex20, 2) or (Hex20, 1).
template <typename ShapeFct>
static
typename std::enable_if<GlobalDim >= ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return [](MeshLib::Element const& e,
std::size_t const n_variables,
......@@ -371,6 +377,16 @@ private:
};
}
/// Returns nullptr for shape functions whose dimensions are less than the
/// global dimension.
template <typename ShapeFct>
static
typename std::enable_if < GlobalDim<ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return nullptr;
}
/// Mapping of element types to local assembler constructors.
std::unordered_map<std::type_index, LADataBuilder> _builder;
......
......@@ -249,9 +249,15 @@ private:
LocalAssemblerData<ShapeFunction, IntegrationMethod<ShapeFunction>,
GlobalDim, DisplacementDim>;
/// Generates a function that creates a new LocalAssembler of type LAData<SHAPE_FCT>
template<typename ShapeFct>
static LADataBuilder makeLocalAssemblerBuilder()
/// Generates a function that creates a new LocalAssembler of type
/// LAData<ShapeFct>. Only functions with shape function's dimension less or
/// equal to the global dimension are instantiated, e.g. following
/// combinations of shape functions and global dimensions: (Line2, 1),
/// (Line2, 2), (Line2, 3), (Hex20, 3) but not (Hex20, 2) or (Hex20, 1).
template <typename ShapeFct>
static
typename std::enable_if<GlobalDim >= ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return [](MeshLib::Element const& e,
std::size_t const local_matrix_size,
......@@ -261,6 +267,16 @@ private:
};
}
/// Returns nullptr for shape functions whose dimensions are less than the
/// global dimension.
template <typename ShapeFct>
static
typename std::enable_if < GlobalDim<ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return nullptr;
}
/// Mapping of element types to local assembler constructors.
std::unordered_map<std::type_index, LADataBuilder> _builder;
......
......@@ -342,9 +342,14 @@ private:
GlobalDim>;
/// Generates a function that creates a new LocalAssembler of type
/// LAData<SHAPE_FCT>
/// LAData<ShapeFct>. Only functions with shape function's dimension less or
/// equal to the global dimension are instantiated, e.g. following
/// combinations of shape functions and global dimensions: (Line2, 1),
/// (Line2, 2), (Line2, 3), (Hex20, 3) but not (Hex20, 2) or (Hex20, 1).
template <typename ShapeFct>
static LADataBuilder makeLocalAssemblerBuilder()
static
typename std::enable_if<GlobalDim >= ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return [](MeshLib::Element const& e,
std::size_t const local_matrix_size,
......@@ -354,6 +359,16 @@ private:
};
}
/// Returns nullptr for shape functions whose dimensions are less than the
/// global dimension.
template <typename ShapeFct>
static
typename std::enable_if < GlobalDim<ShapeFct::DIM, LADataBuilder>::type
makeLocalAssemblerBuilder()
{
return nullptr;
}
/// Mapping of element types to local assembler constructors.
std::unordered_map<std::type_index, LADataBuilder> _builder;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment