Commit 8db79f70 authored by Andreas Nüßing's avatar Andreas Nüßing

[Unfitted] enable spatial venant for CutFEM

parent d192db00
......@@ -8,6 +8,7 @@
#include <duneuro/eeg/source_model_interface.hh>
#include <duneuro/eeg/unfitted_partial_integration_source_model.hh>
#include <duneuro/eeg/unfitted_patch_based_venant_source_model.hh>
#include <duneuro/eeg/unfitted_truncated_spatial_venant_source_model.hh>
namespace duneuro
{
......@@ -31,6 +32,11 @@ namespace duneuro
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), scaleToBBox,
config);
} else if (type == "truncated_spatial_venant") {
return Dune::Std::make_unique<UnfittedTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, typename Solver::Traits::SubTriangulation,
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), config);
} else {
DUNE_THROW(duneuro::SourceModelException, "unknown source model of type \"" << type
<< "\"");
......@@ -56,6 +62,11 @@ namespace duneuro
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), scaleToBBox,
config);
} else if (type == "truncated_spatial_venant") {
return Dune::Std::make_unique<UnfittedTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, typename Solver::Traits::SubTriangulation,
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), config);
} else {
DUNE_THROW(duneuro::SourceModelException, "unknown source model of type \"" << type
<< "\"");
......
......@@ -7,9 +7,9 @@
#include <duneuro/common/exceptions.hh>
#include <duneuro/eeg/source_model_interface.hh>
#include <duneuro/eeg/udg_subtraction_source_model.hh>
#include <duneuro/eeg/udg_truncated_spatial_venant_source_model.hh>
#include <duneuro/eeg/unfitted_partial_integration_source_model.hh>
#include <duneuro/eeg/unfitted_patch_based_venant_source_model.hh>
#include <duneuro/eeg/unfitted_truncated_spatial_venant_source_model.hh>
namespace duneuro
{
......@@ -39,9 +39,10 @@ namespace duneuro
Vector>>(solver.functionSpace(), solver.subTriangulation(), solver.elementSearch(),
config.get<std::size_t>("compartment"), config, solverConfig);
} else if (type == "truncated_spatial_venant") {
return Dune::Std::make_unique<UDGTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, ST, Vector>>(
solver.functionSpace().getGFS(), subTriangulation, search, dipoleCompartment, config);
return Dune::Std::make_unique<UnfittedTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, typename Solver::Traits::SubTriangulation,
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), config);
} else {
DUNE_THROW(duneuro::SourceModelException, "unknown source model of type \"" << type
<< "\"");
......@@ -68,10 +69,10 @@ namespace duneuro
solver.elementSearch(), config.get<std::size_t>("compartment"), scaleToBBox,
config);
} else if (type == "truncated_spatial_venant") {
return Dune::Std::make_unique<UDGTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, ST, Vector>>(
solver.functionSpace().getGFS(), solver.subTriangulation(), solver.elementSearch(),
config.get<std::size_t>("compartment"), config);
return Dune::Std::make_unique<UnfittedTruncatedSpatialVenantSourceModel<
typename Solver::Traits::FunctionSpace::GFS, typename Solver::Traits::SubTriangulation,
Vector>>(solver.functionSpace().getGFS(), solver.subTriangulation(),
solver.elementSearch(), config.get<std::size_t>("compartment"), config);
} else {
DUNE_THROW(duneuro::SourceModelException, "unknown source model of type \"" << type
<< "\"");
......
#ifndef DUNEURO_UDG_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
#define DUNEURO_UDG_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
#ifndef DUNEURO_UNFITTED_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
#define DUNEURO_UNFITTED_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
#include <Eigen/Dense>
#include <array>
......@@ -22,7 +22,7 @@
namespace duneuro
{
template <class GFS, class ST, class V>
class UDGTruncatedSpatialVenantSourceModel
class UnfittedTruncatedSpatialVenantSourceModel
: public SourceModelBase<typename GFS::Traits::GridViewType, V>
{
public:
......@@ -45,9 +45,9 @@ namespace duneuro
using RangeType = typename BasisSwitch::Range;
using DOFIndex = typename GFS::Ordering::Traits::DOFIndex;
UDGTruncatedSpatialVenantSourceModel(const GFS& gfs, std::shared_ptr<ST> subTriangulation,
std::shared_ptr<typename BaseT::SearchType> search,
std::size_t child, const Dune::ParameterTree& params)
UnfittedTruncatedSpatialVenantSourceModel(const GFS& gfs, std::shared_ptr<const ST> subTriangulation,
std::shared_ptr<const typename BaseT::SearchType> search,
std::size_t child, const Dune::ParameterTree& params)
: BaseT(search)
, subTriangulation_(subTriangulation)
, child_(child)
......@@ -150,7 +150,7 @@ namespace duneuro
}
private:
std::shared_ptr<ST> subTriangulation_;
std::shared_ptr<const ST> subTriangulation_;
std::size_t child_;
std::shared_ptr<ElementNeighborhoodMap<GV>> elementNeighborhoodMap_;
const GFS& gfs_;
......@@ -330,4 +330,4 @@ namespace duneuro
};
}
#endif // DUNEURO_UDG_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
#endif // DUNEURO_UNFITTED_TRUNCATED_SPATIAL_VENANT_SOURCE_MODEL_HH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment