56FractureManager :: FractureManager(
Domain *domain)
58 this->domain = domain;
59 this->updateFlag =
false;
62FractureManager :: ~FractureManager() { }
65FractureManager :: clear() { }
80int FractureManager :: instanciateYourself(
DataReader &dr)
85 for (
int i = 1; i <= ( int ) this->
criteriaList.size(); i++ ) {
89 auto failCriteria =
classFactory.createFailureCriteria(name.c_str(), i,
this);
90 if ( !failCriteria ) {
91 OOFEM_ERROR(
"unknown failure criteria (%s)", name.c_str() );
94 failCriteria->initializeFrom(mir);
97 if ( failCriteria->giveType() == ELLocal ) {
98 int numEl = this->
domain->giveNumberOfElements();
99 failCriteria->list.resize(numEl);
100 for (
int j = 1; j <= numEl; j++ ) {
103 failCriteria->list.at(j - 1) = fcs;
105 }
else if ( failCriteria->giveType() == IPLocal ) {
107 }
else if ( failCriteria->giveType() == Nonlocal ) {
108 OOFEM_ERROR(
"Nonlocal criteria not supported yet");
121FractureManager :: evaluateYourself(
TimeStep *tStep)
130FractureManager :: evaluateFailureCriterias(
TimeStep *tStep)
135 for (
int i = 1; i <= ( int ) this->
criteriaList.size(); i++ ) {
137 printf(
"\n Evaluating failure criteria %i \n", i);
140 if ( failCrit->giveType() == ELLocal ) {
141 for (
int j = 1; j <= ( int ) failCrit->list.size(); j++ ) {
143 printf(
"\n Evaluating for element %i \n", j);
146 failCrit->computeFailureCriteriaQuantities(fcStatus, tStep);
148 this->
setUpdateFlag( failCrit->evaluateFailureCriteria(fcStatus) );
150 }
else if ( failCrit->giveType() == Nonlocal ) {
151 OOFEM_ERROR(
"Nonlocal criteria not supported yet");
168 printf(
"\n Updating geometry of enrichment item %i ", k);
172 for (
int i = 1; i <= ( int ) this->
criteriaList.size(); i++ ) {
174 printf(
"based on failure criteria %i \n", i);
178 for (
int j = 1; j <= ( int ) failCrit->list.size(); j++ ) {
180 printf(
"\n Element %i ", j);
226 bool criteriaFulfilled =
false;
228 for (
int i = 1; i <= ( int ) status->
failedFlags.size(); i++ ) {
232 criteriaFulfilled =
true;
235 return criteriaFulfilled;
#define REGISTER_FailureCriteria(class)
FloatArray layerDamageValues
virtual InputRecord & giveInputRecord(InputRecordType irType, int recordId)=0
virtual void updateGeometry(FailureCriteriaStatus *fc, TimeStep *tStep)
virtual Interface * giveInterface(InterfaceType t)
std ::vector< bool > failedFlags
void setType(FailureCriteriaType _type)
virtual bool evaluateFCQuantities(Element *el, TimeStep *tStep)
virtual void computeFailureCriteriaQuantities(FailureCriteriaStatus *fc, TimeStep *tStep)
Index giveSize() const
Returns the size of receiver.
void evaluateFailureCriterias(TimeStep *tStep)
void setUpdateFlag(bool flag)
std::vector< std::unique_ptr< FailureCriteria > > criteriaList
EnrichmentItem * giveEnrichmentItem(int n)
int giveNumberOfEnrichmentItems() const
#define _IFT_DamagedNeighborLayered_DamageThreshold
#define _IFT_FracManager_verbose
#define _IFT_FracManager_numcriterias
ClassFactory & classFactory
@ FailureModuleElementInterfaceType