Skip to content
Snippets Groups Projects
Commit 718cf486 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[PL] Extended source terms to 0D meshes

With that change "Volumetric"/"Python" source terms can be applied to nodes, as well.
Thereby, the special "Nodal" source term has become obsolete, now.
parent 5390a73f
No related branches found
No related tags found
No related merge requests found
...@@ -33,10 +33,6 @@ void createLocalAssemblersPython( ...@@ -33,10 +33,6 @@ void createLocalAssemblersPython(
NumLib::IntegrationOrder const integration_order, NumLib::IntegrationOrder const integration_order,
ExtraCtorArgs&&... extra_ctor_args) ExtraCtorArgs&&... extra_ctor_args)
{ {
static_assert(
GlobalDim == 1 || GlobalDim == 2 || GlobalDim == 3,
"Meshes with dimension greater than three are not supported.");
using LocAsmFactory = using LocAsmFactory =
LocalAssemblerFactoryPython<LocalAssemblerInterface, LocalAssemblerFactoryPython<LocalAssemblerInterface,
LocalAssemblerImplementation, GlobalDim, LocalAssemblerImplementation, GlobalDim,
...@@ -82,6 +78,12 @@ void createLocalAssemblersPython( ...@@ -82,6 +78,12 @@ void createLocalAssemblersPython(
switch (dimension) switch (dimension)
{ {
case 0:
detail::createLocalAssemblersPython<0,
LocalAssemblerImplementation>(
dof_table, mesh_elements, local_assemblers, integration_order,
std::forward<ExtraCtorArgs>(extra_ctor_args)...);
break;
case 1: case 1:
detail::createLocalAssemblersPython<1, detail::createLocalAssemblersPython<1,
LocalAssemblerImplementation>( LocalAssemblerImplementation>(
......
...@@ -91,13 +91,19 @@ struct NsAndWeight<ShapeFunction, ShapeFunction, ShapeMatrix, ShapeMatrix> ...@@ -91,13 +91,19 @@ struct NsAndWeight<ShapeFunction, ShapeFunction, ShapeMatrix, ShapeMatrix>
Eigen::Ref<const Eigen::RowVectorXd> N(unsigned order) const Eigen::Ref<const Eigen::RowVectorXd> N(unsigned order) const
{ {
if (order >= 2) // For point elements shape functions are the same for all orders, so
// this specialization will be selected, which is OK for any shape
// function order for point elements.
if constexpr (!std::is_same_v<ShapeFunction, NumLib::ShapePoint1>)
{ {
OGS_FATAL( if (order >= 2)
"Only shape functions of order < 2 are available in the " {
"current setting. You have requested order {}. Maybe there is " OGS_FATAL(
"an error in the OGS project file.", "Only shape functions of order < 2 are available in the "
order); "current setting. You have requested order {}. Maybe there "
"is an error in the OGS project file.",
order);
}
} }
return N_; return N_;
......
...@@ -33,10 +33,6 @@ void createLocalAssemblers( ...@@ -33,10 +33,6 @@ void createLocalAssemblers(
NumLib::IntegrationOrder const integration_order, NumLib::IntegrationOrder const integration_order,
ExtraCtorArgs&&... extra_ctor_args) ExtraCtorArgs&&... extra_ctor_args)
{ {
static_assert(
GlobalDim == 1 || GlobalDim == 2 || GlobalDim == 3,
"Meshes with dimension greater than three are not supported.");
using LocalAssemblerFactory = using LocalAssemblerFactory =
LocalAssemblerFactory<LocalAssemblerInterface, LocalAssemblerFactory<LocalAssemblerInterface,
LocalAssemblerImplementation, GlobalDim, LocalAssemblerImplementation, GlobalDim,
...@@ -83,6 +79,12 @@ void createLocalAssemblers( ...@@ -83,6 +79,12 @@ void createLocalAssemblers(
switch (dimension) switch (dimension)
{ {
case 0:
detail::createLocalAssemblers<0, LocalAssemblerImplementation>(
dof_table, shapefunction_order, mesh_elements, local_assemblers,
integration_order,
std::forward<ExtraCtorArgs>(extra_ctor_args)...);
break;
case 1: case 1:
detail::createLocalAssemblers<1, LocalAssemblerImplementation>( detail::createLocalAssemblers<1, LocalAssemblerImplementation>(
dof_table, shapefunction_order, mesh_elements, local_assemblers, dof_table, shapefunction_order, mesh_elements, local_assemblers,
......
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