63 std::transform(input.begin(), input.end(), input.begin(), ::tolower);
68 template<
typename C,
typename T,
typename V,
typename ... As> C *
cf_create2(
const T &list, V name, As ... args)
70 auto creator = list.find(name);
71 return creator != list.end() ? creator->second(args...) :
nullptr;
75 template<
typename T,
typename V,
typename C>
bool cf_store2(T &list, V name, C &creator)
77 list[ name ] = creator;
82 template<
typename C,
typename T,
typename ... As> C *
cf_create(
const T &list,
const char *name, As ... args)
85 return creator != list.end() ? creator->second(args...) :
nullptr;
89 template<
typename T,
typename C>
bool cf_store(T &list,
const char *name, C &creator)
99 dofList [ DT_master ] = dofCreator< MasterDof >;
100 dofList [ DT_simpleSlave ] = dofCreator< SimpleSlaveDof >;
101 dofList [ DT_slave ] = dofCreator< SlaveDof >;
102 dofList [ DT_active ] = dofCreator< ActiveDof >;
117 return cf_create2<Dof>(
dofList, name, dofid, dman);
122 return cf_create2<SparseLinearSystemNM>(
sparseLinSolList, name, domain, emodel);
132 return cf_create2<ErrorEstimator>(
errEstList, name, number, domain);
142 if (
conv2lower(name).compare(
"initialcondition") == 0 ) {
161 return cf_create<Element>(
elemList, name,number, domain);
171 return cf_create<DofManager>(
dofmanList, name, number, domain);
181 return cf_create<GeneralBoundaryCondition>(
bcList, name, number, domain);
191 return cf_create<CrossSection>(
csList, name, number, domain);
201 return cf_create<Material>(
matList, name, number, domain);
211 return cf_create<EngngModel>(
engngList, name, number, master);
221 return cf_create<Function>(
funcList, name, number, domain);
231 return cf_create<NonlocalBarrier>(
nlbList, name, number, domain);
241 return cf_create<ExportModule>(
exportList, name, number, emodel);
251 return cf_create<SparseNonLinearSystemNM>(
nonlinList, name, domain, emodel);
261 return cf_create<InitModule>(
initList, name, number, emodel);
271 return cf_create<TopologyDescription>(
topologyList, name, domain);
283 return cf_create<EnrichmentItem>(
enrichItemList, name, number, xm, domain);
303 return cf_create<EnrichmentFunction>(
enrichFuncList, name, number, domain);
353 return cf_create<XfemManager>(
xManList, name, domain);
TopologyDescription * createTopology(const char *name, Domain *domain)
Creates new instance of topology description corresponding to given keyword.
ContactDefinition * createContactDefinition(const char *name, ContactManager *cMan)
GenEigvalSolverType
Types of general eigenvalue solvers.
LinSystSolverType
The values of this type should be related not to specific solvers, but more to specific packages that...
Material * createMaterial(const char *name, int num, Domain *domain)
Creates new instance of material corresponding to given keyword.
std::map< std::string, Element *(*)(int, Domain *) > elemList
Associative container containing element creators with element name as key.
bool registerEnrichmentFront(const char *name, EnrichmentFront *(*creator)())
C * cf_create(const T &list, const char *name, As...args)
std::map< std::string, LoadBalancer *(*)(Domain *) > loadBalancerList
Associative container containing load balancer creators.
NodalRecoveryModel * createNodalRecoveryModel(NodalRecoveryModel::NodalRecoveryModelType type, Domain *d)
Creates new instance of nodal recovery model corresponding to given type.
LoadBalancer * createLoadBalancer(const char *name, Domain *d)
std::map< std::string, ContactDefinition *(*)(ContactManager *) > contactDefList
Abstract class representing entity, which is included in the FE model using one (or more) global func...
std::map< std::string, CrossSection *(*)(int, Domain *) > csList
Associative container containing cross section creators with cross section name as key...
C * cf_create2(const T &list, V name, As...args)
std::map< LinSystSolverType, SparseLinearSystemNM *(*)(Domain *, EngngModel *) > sparseLinSolList
Associative container containing sparse linear solver creators.
BasicGeometry * createGeometry(const char *name)
Function * createFunction(const char *name, int num, Domain *domain)
Creates new instance of load time function corresponding to given keyword.
bool registerNucleationCriterion(const char *name, NucleationCriterion *(*creator)(Domain *))
EnrichmentItem * createEnrichmentItem(const char *name, int num, XfemManager *xm, Domain *domain)
Abstract base class for all nonlocal barriers.
bool registerSparseNonLinearSystemNM(const char *name, SparseNonLinearSystemNM *(*creator)(Domain *, EngngModel *))
Registers a new nonlinear solver in the class factory.
Class implementing general initial condition.
bool registerNodalRecoveryModel(NodalRecoveryModel::NodalRecoveryModelType name, NodalRecoveryModel *(*creator)(Domain *))
Registers a new nodal recovery model.
Base class for all matrices stored in sparse format.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
bool registerLoadBalancerMonitor(const char *name, LoadBalancerMonitor *(*creator)(EngngModel *))
std::map< std::string, NucleationCriterion *(*)(Domain *) > nucleationCritList
Associative container containing nucleation criterion creators.
NonlocalBarrier * createNonlocalBarrier(const char *name, int num, Domain *domain)
Creates new instance of nonlocal barrier corresponding to given keyword.
bool registerSparseLinSolver(LinSystSolverType type, SparseLinearSystemNM *(*creator)(Domain *, EngngModel *))
Registers a sparse linear system solver.
bool registerXfemManager(const char *name, XfemManager *(*creator)(Domain *))
std::map< std::string, FailureCriteriaStatus *(*)(int, FailureCriteria *) > failureCriteriaStatusList
bool registerEngngModel(const char *name, EngngModel *(*creator)(int, EngngModel *))
Registers a new engineering model in the class factory.
This base class is an abstraction for all numerical methods solving sparse linear system of equations...
std::map< std::string, ExportModule *(*)(int, EngngModel *) > exportList
Associative container containing export module creators.
bool registerCrossSection(const char *name, CrossSection *(*creator)(int, Domain *))
Registers a new cross section in the class factory.
std::map< std::string, NonlocalBarrier *(*)(int, Domain *) > nlbList
Associative container containing nonlocal barriers creators with barrier name as key.
bool registerFailureCriteria(const char *name, FailureCriteria *(*creator)(int, FractureManager *))
ExportModule * createExportModule(const char *name, int num, EngngModel *emodel)
Creates new instance of export module corresponding to given keyword.
ContactManager * createContactManager(const char *name, Domain *domain)
dofType
Dof Type, determines the type of DOF created.
ClassFactory()
Creates empty factory.
Represents init module - a base class for all init modules.
bool registerEnrichmentDomain(const char *name, EnrichmentDomain *(*creator)())
Updates the geometry of evolving XFEM interfaces.
FailureCriteriaStatus * createFailureCriteriaStatus(const char *name, int num, FailureCriteria *critManager)
Abstract base class for all finite elements.
std::map< std::string, BasicGeometry *(*)() > geometryList
Associative container containing geometry creators.
DofManager * createDofManager(const char *name, int num, Domain *domain)
Creates new instance of Dof manager corresponding to given keyword.
The class representing the general material model mapping algorithm.
FailureCriteria * createFailureCriteria(const char *name, int num, FractureManager *fracManager)
Base class for dof managers.
CrossSection * createCrossSection(const char *name, int num, Domain *domain)
Creates new instance of cross section corresponding to given keyword.
This class manages the fracture mechanics part.
std::map< std::string, EnrichmentFunction *(*)(int, Domain *) > enrichFuncList
Associative container containing enrichment function creators.
std::map< std::string, DofManager *(*)(int, Domain *) > dofmanList
Associative container containing dofmanager creators with dofmanager name as key. ...
std::map< MaterialMappingAlgorithmType, MaterialMappingAlgorithm *(*)() > materialMappingList
Associative container containing material mapping algorithm creators.
GeneralBoundaryCondition * createBoundaryCondition(const char *name, int num, Domain *domain)
Creates new instance of boundary condition corresponding to given keyword.
EnrichmentFunction * createEnrichmentFunction(const char *name, int num, Domain *domain)
EnrichmentFront * createEnrichmentFront(const char *name)
bool cf_store(T &list, const char *name, C &creator)
bool registerTopologyDescription(const char *name, TopologyDescription *(*creator)(Domain *))
Registers a new topology description in the class factory.
Represents export output module - a base class for all output modules.
MaterialMappingAlgorithm * createMaterialMappingAlgorithm(MaterialMappingAlgorithmType name)
Abstract representation of Geometry.
std::map< std::string, EngngModel *(*)(int, EngngModel *) > engngList
Associative container containing engng model creators with engng model name as key.
bool registerEnrichmentItem(const char *name, EnrichmentItem *(*creator)(int, XfemManager *, Domain *))
bool registerFunction(const char *name, Function *(*creator)(int, Domain *))
Registers a new load time function in the class factory.
ErrorEstimatorType
Determines the type of error estimator.
Abstract class representing global shape function Base class declares abstract interface common to al...
Abstract base class representing integration rule.
std::map< SparseMtrxType, SparseMtrx *(*)() > sparseMtrxList
Associative container containing sparse matrix creators.
std::map< GenEigvalSolverType, SparseGeneralEigenValueSystemNM *(*)(Domain *, EngngModel *) > generalizedEigenValueSolverList
Associative container containing sparse generalized eigenvalue creators.
Base abstract class representing cross section in finite element mesh.
InitialCondition * createInitialCondition(const char *name, int num, Domain *d)
Creates new instance of Initial Condition corresponding to given type.
bool registerBoundaryCondition(const char *name, GeneralBoundaryCondition *(*creator)(int, Domain *))
Registers a new boundary condition in the class factory.
bool registerInitModule(const char *name, InitModule *(*creator)(int, EngngModel *))
Registers a new init module in the class factory.
std::map< std::string, Material *(*)(int, Domain *) > matList
Associative container containing material creators with material name as key.
IntegrationRule * createIRule(IntegrationRuleType name, int number, Element *e)
XfemManager * createXfemManager(const char *name, Domain *domain)
std::map< std::string, ContactManager *(*)(Domain *) > contactManList
Associative container containing ContactManager creators.
std::map< std::string, GeneralBoundaryCondition *(*)(int, Domain *) > bcList
Associative container containing boundary condition creators with bc name as key. ...
bool cf_store2(T &list, V name, C &creator)
bool registerElement(const char *name, Element *(*creator)(int, Domain *))
Registers a new element in the class factory.
InitModule * createInitModule(const char *name, int num, EngngModel *emodel)
Creates new instance of init module corresponding to given keyword.
DofIDItem
Type representing particular dof type.
bool registerLoadBalancer(const char *name, LoadBalancer *(*creator)(Domain *))
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
The base class representing the interface to mesh generation package.
Class EnrichmentFront: describes the edge or tip of an XFEM enrichment.
std::map< ErrorEstimatorType, ErrorEstimator *(*)(int, Domain *) > errEstList
Associative container containing error estimator creators.
std::map< std::string, EnrichmentFront *(*)() > enrichmentFrontList
Associative container containing enrichment front creators.
std::map< std::string, TopologyDescription *(*)(Domain *) > topologyList
Associative container containing topology description creators.
bool registerExportModule(const char *name, ExportModule *(*creator)(int, EngngModel *))
Registers a new export module in the class factory.
Abstract base class for all boundary conditions of problem.
ClassFactory & GiveClassFactory()
This function must be used by all code that run at link time to ensure that the classFactory is const...
std::string conv2lower(std::string input)
Abstract base class for all material models.
MaterialMappingAlgorithmType
Enumerative type used to classify supported MaterialMappingAlgorithms.
ErrorEstimator * createErrorEstimator(ErrorEstimatorType type, int num, Domain *d)
Creates new instance of ErrorEstimator corresponding to given type.
The base class for all error estimation or error indicator algorithms.
Abstract base class representing general load balancer.
MesherInterface * createMesherInterface(MeshPackageType name, Domain *d)
bool registerEnrichmentFunction(const char *name, EnrichmentFunction *(*creator)(int, Domain *))
bool registerDofManager(const char *name, DofManager *(*creator)(int, Domain *))
Registers a new dof manager in the class factory.
Dof * createDof(dofType type, DofIDItem dofid, DofManager *dman)
Creates new instance of DOF corresponding to given keyword.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
bool registerMaterial(const char *name, Material *(*creator)(int, Domain *))
Registers a new material in the class factory.
Abstract base class representing a function with vector input and output.
This class manages the xfem part.
bool registerErrorEstimator(ErrorEstimatorType type, ErrorEstimator *(*creator)(int, Domain *))
Registers a new error estimator.
bool registerGeneralizedEigenValueSolver(GenEigvalSolverType name, SparseGeneralEigenValueSystemNM *(*creator)(Domain *, EngngModel *))
std::map< dofType, Dof *(*)(DofIDItem, DofManager *) > dofList
Associative container containing dof creators.
std::map< std::string, PropagationLaw *(*)() > propagationLawList
Associative container containing propagation law creators.
NucleationCriterion * createNucleationCriterion(const char *name, Domain *domain)
std::map< MeshPackageType, MesherInterface *(*)(Domain *) > mesherInterfaceList
Associative container containing mesher interface creators.
bool registerContactManager(const char *name, ContactManager *(*creator)(Domain *))
bool registerNonlocalBarrier(const char *name, NonlocalBarrier *(*creator)(int, Domain *))
Registers a new nonlocal barrier in the class factory.
Abstract class for topology description.
std::map< std::string, EnrichmentDomain *(*)() > enrichmentDomainList
Associative container containing enrichment-domain creators.
ClassFactory & classFactory
LoadBalancerMonitor * createLoadBalancerMonitor(const char *name, EngngModel *e)
bool registerContactDefinition(const char *name, ContactDefinition *(*creator)(ContactManager *))
bool registerMesherInterface(MeshPackageType name, MesherInterface *(*creator)(Domain *))
bool registerPropagationLaw(const char *name, PropagationLaw *(*creator)())
std::map< std::string, EnrichmentItem *(*)(int, XfemManager *, Domain *) > enrichItemList
Associative container containing enrichment item creators.
MeshPackageType
Enumerative type used to classify supported mesh packages.
SparseGeneralEigenValueSystemNM * createGeneralizedEigenValueSolver(GenEigvalSolverType name, Domain *d, EngngModel *m)
Abstract base class representing the "problem" under consideration.
bool registerFailureCriteriaStatus(const char *name, FailureCriteriaStatus *(*creator)(int, FailureCriteria *))
std::map< std::string, InitModule *(*)(int, EngngModel *) > initList
Associative container containing init module creators.
PropagationLaw * createPropagationLaw(const char *name)
bool registerGeometry(const char *name, BasicGeometry *(*creator)())
Class Factory allows to register terminal oofem classes, based on their membership (classes represent...
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class representing Lobatto-quadrature integration rule.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
std::map< std::string, FailureCriteria *(*)(int, FractureManager *) > failureCriteriaList
Associative container containing failure criteria creators.
The base class for all recovery models, which perform nodal averaging or projection processes for int...
std::map< std::string, LoadBalancerMonitor *(*)(EngngModel *) > loadMonitorList
Associative container containing load balancer monitor creators.
Element * createElement(const char *name, int num, Domain *domain)
Creates new instance of element corresponding to given keyword.
This base class is an abstraction for all numerical methods solving sparse linear system of equations...
std::map< std::string, Function *(*)(int, Domain *) > funcList
Associative container containing load time function creators with function name as key...
EnrichmentDomain * createEnrichmentDomain(const char *name)
std::map< std::string, SparseNonLinearSystemNM *(*)(Domain *, EngngModel *) > nonlinList
Associative container containing nonlinear solver creators.
std::map< NodalRecoveryModel::NodalRecoveryModelType, NodalRecoveryModel *(*)(Domain *) > nodalRecoveryModelList
Associative container containing nodal recovery model creators.
bool registerSparseMtrx(SparseMtrxType type, SparseMtrx *(*creator)())
Registers a sparse matrix type.
This base class is an abstraction for all numerical methods solving sparse nonlinear system of equati...
bool registerMaterialMappingAlgorithm(MaterialMappingAlgorithmType name, MaterialMappingAlgorithm *(*creator)())
SparseNonLinearSystemNM * createNonLinearSolver(const char *name, Domain *domain, EngngModel *emodel)
Creates new instance of nonlinear solver corresponding to given keyword.
Abstract base class representing general load balancer monitor.
Class representing Gaussian-quadrature integration rule.
std::map< std::string, XfemManager *(*)(Domain *) > xManList
Associative container containing XfemManager creators.
EngngModel * createEngngModel(const char *name, int num, EngngModel *master)
Creates new instance of engng model corresponding to given keyword.