CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
A Field is an object wrapped around a SAFunc functor, defined on at least one domain.
A domain is a CepsVector of either GeomCell*, GeomNode* or DegreeOfFreedom*. Several vectors can be passed to the Field, on which to compute the values of the functor.
A compact support in these domains can be provided to the Field, by using a locator. For example:
Field f(mySAFunc, vecOfOnwedNodes); f.addDomain(vecOfHaloNodes); AttributesLocator l(); /// parametrize the locator... f.computeSupport(l); /// ... f.actualize(t); f.getValues(...),
Optionally, data can be precomputed (bufferized). This can be useful for data that does not change with time. (e.g. reoriented conductivity tensors)
#include <Field.hpp>
Public Types | |
using | FunctionType = SAFunc< _Result > |
The type returned by the functor. More... | |
using | _Domain = CepsVector< _SupportType * > |
The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More... | |
using | _Iterator = typename CepsVector< _SupportType * >::const_iterator |
The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom) More... | |
Public Member Functions | |
Field (FunctionType *functor, const _Domain *domain, CepsBool bufferize=false) | |
Construct a new Field object, with a vector, functor cannot be null. More... | |
virtual | ~Field ()=default |
Destructor. More... | |
void | addDomain (const _Domain *domain) |
Add another domain of definition. More... | |
void | clearDomains () |
Removes domains and support. More... | |
FunctionType * | getFunctor () const |
Get the functor inside the object. More... | |
void | setFunctor (ceps::Function< _Result(CepsStandardArgs)> *functor) |
Set the functor inside the object. More... | |
void | setScaleFactor (CepsReal scaleFactor) |
Scale the result. More... | |
CepsReal | getScaleFactor () const |
Get the scale factor used. More... | |
CepsBool | isBuffered () const |
Tells if field is bufferized. More... | |
CepsBool | hasBufferedData () const |
Tells if field is bufferized and data has already been computed. More... | |
CepsEnum | getFunctorFlags () const |
Get flags of the function. More... | |
CepsBool | hasFunctorOption (CepsFunctionFlag flag) const |
Knowing the behavior relating to the time variable. More... | |
CepsBool | isSpaceVariable () const |
Knowing the behavior relating to the space variable. More... | |
CepsBool | isTimeVariable () const |
Knowing the behavior relating to the time variable. More... | |
CepsBool | needsSolution () const |
Knowing the behavior relating to the solution vector. More... | |
void | getValues (CepsVector< _Result > &values, CepsReal t, const CepsVector< _SupportType * > &points={}) |
Get the values for given row indices. If no support was given, simply call the functor for all dofs. More... | |
_Result | getValue (_SupportType *point, CepsReal t) |
Get single value for given row index. /!\ If not nullptr, the solution vector should HAVE ALREADY CALLED getLocalData() !! More... | |
void | computeSupport (AbstractSelector< _Iterator > *selector, CepsBool canStartEmpty=false) |
Computes the support in the domains of definition, using the given selector. More... | |
virtual void | actualize (CepsReal t) |
Precompute field data. More... | |
CepsVector< _Result > & | getBufferedData () |
Ref to buffered data. More... | |
CepsVector< CepsGlobalIndex > & | getSupportIndices () |
Get indices of support. More... | |
const CepsVector< _SupportType * > & | getSupport () |
Get suppor. More... | |
const CepsVector< const CepsVector< _SupportType * > * > & | getDomains () |
Get the spans on which the field is defined. More... | |
Protected Member Functions | |
virtual void | evaluateAll (CepsReal t, CepsVector< _Result > &results) |
Evaluate on all domain or support, put results in given vector. More... | |
virtual void | evaluateOn (const _Domain *domain, CepsReal t, CepsUInt offset, CepsVector< _Result > &results) |
Precompute field data. More... | |
Protected Attributes | |
FunctionType * | m_functor |
doesn't belong to this object More... | |
CepsReal | m_scaleFactor |
An optional scale factor. More... | |
CepsVector< _SupportType * > | m_support |
List of "points" where the field applies. More... | |
CepsVector< CepsGlobalIndex > | m_supportIndices |
List of "points" indices. More... | |
CepsBool | m_supportComputed |
True if computeSupport has been called. More... | |
CepsVector< _Result > | m_buffer |
Get buffer with data evaluated. More... | |
CepsBool | m_precompute |
Do we bufferize data ? More... | |
CepsBool | m_isPrecomputed |
Check if values were already evaluated. More... | |
CepsVector< const CepsVector< _SupportType * > * > | m_domains |
Ranges on which the field is defined. More... | |
Friends | |
class | BoundaryConditionManager |
Friend classes. More... | |
class | SourceTermManager |
using Field< _Result, _SupportType >::_Domain = CepsVector<_SupportType*> |
The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom)
using Field< _Result, _SupportType >::_Iterator = typename CepsVector<_SupportType*>::const_iterator |
The objects on which is defined the support (GeomCell, GeomNode, DegreeOfFreedom)
using Field< _Result, _SupportType >::FunctionType = SAFunc<_Result> |
Field< _Result, _SupportType >::Field | ( | FunctionType * | functor, |
const _Domain * | domain, | ||
CepsBool | bufferize = false |
||
) |
Construct a new Field object, with a vector, functor cannot be null.
|
virtualdefault |
Destructor.
|
virtual |
Precompute field data.
void Field< _Result, _SupportType >::addDomain | ( | const _Domain * | domain | ) |
Add another domain of definition.
void Field< _Result, _SupportType >::clearDomains | ( | ) |
Removes domains and support.
void Field< _Result, _SupportType >::computeSupport | ( | AbstractSelector< _Iterator > * | selector, |
CepsBool | canStartEmpty = false |
||
) |
Computes the support in the domains of definition, using the given selector.
selector | must have been parametrized before calling this method |
canStartEmpty | do not consider empty support to be no support to compute |
|
protectedvirtual |
Evaluate on all domain or support, put results in given vector.
|
protectedvirtual |
Precompute field data.
CepsVector<_Result>& Field< _Result, _SupportType >::getBufferedData | ( | ) |
Ref to buffered data.
const CepsVector<const CepsVector<_SupportType*>*>& Field< _Result, _SupportType >::getDomains | ( | ) |
Get the spans on which the field is defined.
FunctionType* Field< _Result, _SupportType >::getFunctor | ( | ) | const |
Get the functor inside the object.
CepsEnum Field< _Result, _SupportType >::getFunctorFlags | ( | ) | const |
Get flags of the function.
CepsReal Field< _Result, _SupportType >::getScaleFactor | ( | ) | const |
Get the scale factor used.
const CepsVector<_SupportType*>& Field< _Result, _SupportType >::getSupport | ( | ) |
Get suppor.
CepsVector<CepsGlobalIndex>& Field< _Result, _SupportType >::getSupportIndices | ( | ) |
Get indices of support.
_Result Field< _Result, _SupportType >::getValue | ( | _SupportType * | point, |
CepsReal | t | ||
) |
Get single value for given row index. /!\ If not nullptr, the solution vector should HAVE ALREADY CALLED getLocalData() !!
void Field< _Result, _SupportType >::getValues | ( | CepsVector< _Result > & | values, |
CepsReal | t, | ||
const CepsVector< _SupportType * > & | points = {} |
||
) |
Get the values for given row indices. If no support was given, simply call the functor for all dofs.
CepsBool Field< _Result, _SupportType >::hasBufferedData | ( | ) | const |
Tells if field is bufferized and data has already been computed.
CepsBool Field< _Result, _SupportType >::hasFunctorOption | ( | CepsFunctionFlag | flag | ) | const |
Knowing the behavior relating to the time variable.
CepsBool Field< _Result, _SupportType >::isBuffered | ( | ) | const |
Tells if field is bufferized.
CepsBool Field< _Result, _SupportType >::isSpaceVariable | ( | ) | const |
Knowing the behavior relating to the space variable.
CepsBool Field< _Result, _SupportType >::isTimeVariable | ( | ) | const |
Knowing the behavior relating to the time variable.
CepsBool Field< _Result, _SupportType >::needsSolution | ( | ) | const |
Knowing the behavior relating to the solution vector.
void Field< _Result, _SupportType >::setFunctor | ( | ceps::Function< _Result(CepsStandardArgs)> * | functor | ) |
Set the functor inside the object.
functor | change the functor inside |
void Field< _Result, _SupportType >::setScaleFactor | ( | CepsReal | scaleFactor | ) |
Scale the result.
scaleFactor | CepsReal |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |