38 m_extMediaAttrsOpts(
""),
44 m_cathodeAttrsOpts(
""),
47 setProblemName(
"Extended Bidomain");
57 if (m_extMediaAttrs.empty())
58 m_extMediaAttrs = {-1};
60 m_extMediaAttrs.insert(m_anodeAttrs.begin(), m_anodeAttrs.end());
61 m_extMediaAttrs.insert(m_cathodeAttrs.begin(), m_cathodeAttrs.end());
133 res.insert(tissue.begin(),tissue.end());
134 res.insert(extra .begin(),extra .end());
172 "anode NEUMANN anode_stim "
173 "UNKNOWN 1 ATTRIBUTES " +
177 "cathode NEUMANN cathode_stim "
178 "UNKNOWN 1 ATTRIBUTES " +
185 CEPS_ABORT_IF(options.size() != 2,
"robin coefficient entry requires a scalar and an attribute");
186 m_boundaryConditions->
add(
"boundary ROBIN 0.0 UNKNOWN 1 ATTRIBUTES " + options[1] +
" ROBINCOEFF " + options[0]);
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
std::basic_string< CepsChar > CepsString
C++ format string.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
CepsBool hasAnalyticSolution() const
Tells if there is an analytic or reference solution.
CepsString getOutputFileBase() const
Output file name includes the directory.
FunctionDictionary * getFunctionDictionary() const
Get functions manager.
void addUnknown(const CepsString &label, CepsSet< CepsAttribute > attrs={}, CepsLocationFlag flag=CepsLocationFlag::Point, const CepsString &unit="")
Register a new unknown.
void addZeroDUnknown(CepsString label, const CepsString &unit="")
Register a new unknown, defined outside of geometry.
void addUnknownInteraction(CepsString label1, CepsString label2, CepsSet< CepsAttribute > attrs={})
Register interaction between unknowns. Also sets the interaction within Unknown instances label1 and ...
InputParameters * m_parameters
Input file data.
void setOutputFileBase(CepsString fileName)
Output file name includes the directory.
Geometry * m_geom
Link to geometry on which the pb is defined.
BoundaryConditionManager * m_boundaryConditions
All BCs should be there.
FunctionDictionary * m_functions
Collection of custom functions.
void initializeEquation() override
Initializes equations (unknowns, bc, source term) and creates the spatial discretization This method ...
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > m_errors
Will store Linf, L1 and L2 relative errors.
CepsArray2< CepsArray3< CepsArray3< CepsReal > > > getErrors() const
Gets the currently computed errors. First index selects absolute(0) or relative(1) second index selec...
Bidomain equation main class.
void add(const CepsString ¶ms)
Add a boundary condition term from parameters.
CepsString m_sigmaIOptions
Options for intracellular conductivity.
CepsString m_sigmaEOptions
Options for extracellulat conductivity.
const CepsSet< CepsAttribute > & getTissueAttributes() const
All attributes that localize tissue.
void initializeEquation() override
Initializes all the elements of the PDE from options.
void solve() override
Performs all iterations of the PDE solver.
Profiler * getProfiler() const
Access to profiler.
virtual CepsSet< CepsAttribute > getAnodeAttributes() const
Get cathode attributes if set.
CepsBool hasAnodalCathodalStimulation() const
Has anodal and cathodal stimulation ?
CepsSet< CepsAttribute > m_extMediaAttrs
Extracardiac regions attributes.
void run() override
Run the simulation.
void defineUnknowns() override
Transmembrane voltage (mV) and Extracellular potential (mV)
CepsSet< CepsAttribute > getWholeDomainAttributes() const
Get all attributes: tissue and extracardiac.
void defineBoundaryConditions() override
Define the boundary conditions.
ExtendedBidomainProblem(Geometry *g, InputParameters *=nullptr)
Constructor from geometry and possibly parameters.
CepsString m_cathodeAttrsOpts
Text input for cathode attributes.
CepsString m_extMediaAttrsOpts
Text input for extracardiac regions attributes.
CepsSet< CepsAttribute > m_cathodeAttrs
Cathode attributes.
CepsSet< CepsAttribute > m_anodeAttrs
Anode attributes.
CepsString m_robinCoeffs
Robin coefficients.
virtual CepsSet< CepsAttribute > getCathodeAttributes() const
Get cathode attributes if set.
CepsBool requireNullMean() const
Tells if this problem requires a null mean constraint.
void setupWithParameters(InputParameters *params) override
Sets options from the parameters.
CepsString m_anodeAttrsOpts
Text input for anode attributes.
const CepsSet< CepsAttribute > & getExtracardiacAttributes() const
Get extracardiac attributes.
CepsString m_biElecStimOpts
Anodal and cathodal stimulation parameters, disabled if empty.
Solves bidomain extended problem with FBE, SBDF RK or CN schemes.
Poisson equation with Neumann 1 on anode, -1 on cathode. Neumann 0 elsewhere. Functional tensorial co...
Solver for a Poisson equation with Neumann BC (using 0 mean constraint)
void solve() override
Solve and postprocess.
void add(const CepsString &label, const CepsString ¶ms, Geometry *geom=nullptr)
Add an object from parameters.
void deleteTensor(const CepsString &label)
Delete a single tensor entry. Be careful if the functor was created outside dictionary.
Encapsulates all the geometrical data.
void stop(CepsString lbl)
Stops the measure of a labeled chronometer.
void start(CepsString lbl, CepsString dspl="")
Creates or continue a labeled chronometer.
CepsSet< CepsInt > toInts(const CepsString &s)
Cast CepsString to a set of CepsInt.
CepsBool isValidPtr(_Type *ptr)
Tells if pointer is not null.
CepsVector< CepsString > split(const CepsString &s, const CepsString &delimiters=CepsString(" \t"))
Splits a string using mulitple delimiters in a single string.
CepsBool isProfiling()
Check if we are currently profiling on the master proc (always false on slave procs).
static constexpr const char * vm
Transmembrane voltage.
static constexpr const char * lag
Lagrangian (null mean constraint)
static constexpr const char * ue
Extracellular and extracardiac potential.