38 ceps::HoldsDimension(),
40 m_rowsAlreadyUsed({}),
45 m_robin = ceps::getNew<Manager>();
68 "When adding boundary condition, no parameters found after key " << key
84 "When adding boundary condition, no parameters found after keyword " << type
87 if (type ==
"DIRICHLET")
89 else if (type ==
"NEUMANN")
91 else if (type ==
"ROBIN")
96 "When adding boundary condition with key " << key <<
", unknown type " << type <<
"\n" <<
97 " Valid types are DIRICHLET, NEUMANN and ROBIN"
116 "When adding boundary condition, no parameters found after dictionary entry " << dicoKey
131 return add(key,type,rest,func);
149 "Function passed for Neumann/Robin BC must be defined either as\n" <<
150 " - a constant function (in space, may be time dependant)\n" <<
151 " - a function of any point x,\n" <<
152 " - a piecewise function using region attributes to determine the value,\n" <<
153 " - a piecewise function using cell ID to determine the value,\n" <<
154 " This function may be evaluated at points of the boundary which do not coincide\n" <<
155 " with degrees of freedom or geometrical nodes"
184 if (options.contains(UNKNOWN))
187 "When adding boundary condition, missing unknown identifier after "<< UNKNOWN <<
" keyword"
195 for (
auto label : {ATTRIBUTE, ATTRIBUTES})
196 if (options.contains(label))
199 "When adding boundary condition, could not find any attribute after " << label <<
" keyword"
205 if (attributes.empty())
210 if (options.contains(SCALE))
213 "When adding boundary condition, could not find real number after SCALE keyword"
220 if (options.contains(ROBINCOEFF))
224 "When adding boundary condition, unable to find "<< std::quoted(opt) <<
" in dictionary\n"
225 " or convert it to a real constant"
258 if (not attributes.empty())
270 return d->getUnknown()->getIdentifier() == unknown;
283 "When adding boundary condition " << key <<
", one of the degrees of freedom\n" <<
284 " selected from the given options already has a boundary condition assigned to it"
317 if (manager->contains(nkey))
319 CEPS_WARNS(
"already contains a boundary condition with the key " << nkey <<
". Ignoring.");
324 manager->insert(std::make_pair(nkey,bc));
330 bctype =
"Dirichlet";
340 CEPS_SAYS (
" Added new boundary condition : " << key <<
" (type: " + bctype +
")");
388 for (
auto [name,bc]: *toParse)
409 obj.second->actualize(time);
416 for (Manager::value_type obj : *
m_neumann)
417 obj.second->actualize(time);
425 for (Manager::value_type obj : *
m_robin)
426 obj.second->actualize(time);
CepsBoundaryConditionFlag
Enumeration for boundary condition type.
@ CellIndex
Use cell index to determine position.
@ Solution
Depends on the content of a solution vector with values at dofs.
@ None
No dependance, constant functions.
@ Space
Depends on position x.
@ Attribute
Depends on the attribute of the region of evaluation.
#define CEPS_ABORT(message)
Stops the execution with a message. If testing is enabled, only throws a runtime_error.
#define CEPS_SAYS(message)
Writes a message in the debug log and in the terminal (stdio).
#define CEPS_ABORT_IF(condition, message)
Stops the execution with a message if condition is true. If testing is enabled, only throws a runtime...
#define CEPS_WARNS(message)
Writes a warning in the debug log and in the terminal (stderr).
std::basic_string< CepsChar > CepsString
C++ format string.
CepsIndex CepsUnknownIndex
For unknowns.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
CepsInt CepsAttribute
Used to define regions.
float CepsReal
Need single precision floating point.
constexpr CepsAttribute CepsUniversal
This attribute means "everywhere".
void onlyOnThisProc(CepsBool value=true)
Choose only object that belongs to this proc.
void onlyOnBoundary(CepsBool value=true)
Choose only objects that are on boundary.
void setDofsInfos(DistributedInfos< DegreeOfFreedom * > *dof)
Set dofs infos in this class.
Manager * m_dirichlet
managers for dirichlet
void actualizeAllRobin(CepsReal time)
Actualize only Robin conditions.
CepsMap< CepsString, ScalarBoundaryCondition * > Manager
Alias for manager inside.
void actualizeAllDirichlet(CepsReal time)
Actualize only Dirichlet conditions.
Manager * getRobinBCs() const
Get the manager for Robin conditions of dim.
Manager * m_neumann
managers for neumann
void add(const CepsString ¶ms)
Add a boundary condition term from parameters.
~BoundaryConditionManager() final
Destroy the Boundary Condition Manager object : default destructor.
Manager * m_robin
managers for robin
Manager * getNeumannBCs() const
Get the manager for Neumann conditions of dim.
void actualizeAll(CepsReal time)
Actualize all bc.
FunctionDictionary * m_dictionary
link to the dictionary
virtual void reset()
Reset the boundary conditions manager.
void actualizeAllNeumann(CepsReal time)
Actualize only Neumann conditions.
CepsSet< DegreeOfFreedom * > m_rowsAlreadyUsed
rows that have a BC
ScalarBoundaryCondition * getBC(CepsString key, const CepsBoundaryConditionFlag &type) const
Get the boundary condition with name 'key' of type 'type' on dimension 'dim'.
DistributedInfos< DegreeOfFreedom * > * m_dofs
dofs
Manager * getBCs(const CepsBoundaryConditionFlag &type) const
Get th correct manager for bc.
Manager * getDirichletBCs() const
Get the manager for Dirichlet conditions.
BoundaryConditionManager(FunctionDictionary *dico)
Construct a new Boundary Condition Manager object dimension.
void setBoundaryConditionType(CepsBoundaryConditionFlag type)
Set boundary condition type.
void setAlpha(CoeffFunc alpha)
Set alpha in .
void setBeta(CoeffFunc beta)
Set beta in .
CepsBoundaryConditionFlag getBoundaryConditionType() const
Get boundary condition type.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
const CepsVector< _Type > & getOwned() const
Get data owned by the processor, const.
const CepsVector< _Type > & getHalo() const
Get halo data owned by neighbor processor, const.
const CepsVector< _SupportType * > & getSupport()
Get suppor.
void addDomain(const _Domain *domain)
Add another domain of definition.
void setScaleFactor(CepsReal scaleFactor)
Scale the result.
void computeSupport(AbstractSelector< _Iterator > *selector, CepsBool canStartEmpty=false)
Computes the support in the domains of definition, using the given selector.
FunctionDictionary that holds functions which can be used to define source terms, boundary conditions...
void addConstant(const CepsString &label, const CepsString ¶ms)
Add a constant function through parameter string.
CepsBool hasScalar(const CepsString &label) const
Tells if function "label" is registered.
const ScalarEntry getScalar(const CepsString &label) const
Get a single scalar entry, const version.
A SAFunc is a ceps::Function that uses CepsStandardArgs as argument of call operator (),...
CepsBool hasOption(CepsFunctionFlag flag)
Tells if option is activated.
void setAttributes(const CepsVector< CepsAttribute > &attributes)
Sets the attributes of the entity.
A namespace for all utility methods.
CepsString toKey(const CepsString &s)
Transform to key type a std::string, upper case and no spaces.
CepsMap< CepsString, CepsVector< CepsString > > splitByKeyword(const CepsString &s, const CepsSet< CepsString > &tags)
Extract parameters in the CepsString given by tags. Builds a map of keywords and parameter words acco...
void barrier()
Explicit barrier: wait for all processors before continuing.
CepsVector< CepsString > splitAtNthDelimiter(const CepsString &s, CepsUInt n, CepsString delimiters=CepsString(" \t"))
Split a string a the n-th delimeter. This ignores the doubled delimiter (eg multiple spaces count as ...
CepsInt toInt(const CepsString &s)
Cast CepsString to CepsInt.
CepsBool isNumber(const CepsString &s)
Check if the string contains only digit numbers.
void destroyObject(_Type &)
Destroy[delete] any type.
CepsReal toReal(const CepsString &s)
Cast CepsString to CepsReal.