48 #ifdef __PARALLEL_MODE 109 elem->updateBeforeNonlocalAverage(tStep);
119 double elemVolume, integrationVolume = 0.;
139 FloatArray gpCoords, jGpCoords, shiftedGpCoords;
141 OOFEM_ERROR(
"computeGlobalCoordinates of target failed");
161 for (
int ix = -nx; ix <= nx; ix++ ) {
163 shiftedGpCoords = gpCoords;
164 shiftedGpCoords.
at(1) += ix *
px;
167 #ifdef NMEI_USE_ALL_ELEMENTS_IN_SUPPORT 176 for (
auto elindx : elemSet ) {
187 #ifdef NMEI_USE_ALL_ELEMENTS_IN_SUPPORT 196 iList->push_back(ir);
197 integrationVolume += elemVolume;
200 OOFEM_ERROR(
"computeGlobalCoordinates of target failed");
205 iList->shrink_to_fit();
214 double weight, elemVolume, integrationVolume = 0.;
227 if ( contributingElems == NULL ) {
232 int _size = contributingElems->
giveSize();
234 OOFEM_ERROR(
"computeGlobalCoordinates of target failed");
246 iList->reserve(_size);
247 for (
int _e = 1; _e <= _size; _e++ ) {
258 #ifdef NMEI_USE_ALL_ELEMENTS_IN_SUPPORT 267 iList->push_back(ir);
268 integrationVolume += elemVolume;
271 OOFEM_ERROR(
"computeGlobalCoordinates of target failed");
278 #ifdef __PARALLEL_MODE 279 #ifdef __VERBOSE_PARALLEL 281 for (
auto &lir : *iList ) {
282 fprintf(stderr,
"%d,%d(%e)", lir.nearGp->giveElement()->giveGlobalNumber(), lir.nearGp->giveNumber(), lir.weight);
285 fprintf(stderr,
"\n");
307 OOFEM_ERROR(
"NonlocalMaterialExtensionInterface :: modifyNonlocalWeightFunctionAround is implemented only for 1D and 2D problems, sorry.\n");
327 double xgp = coords.
at(1);
328 double ygp = coords.
at(2);
330 double xngp, yngp, damgp;
331 for (
auto lip : *list ) {
334 ngpElem = ( lip.nearGp )->giveElement();
342 for (
int i = 1; i <= 2 *
gridSize + 1; i++ ) {
343 for (
int j = 1; j <= 2 *
gridSize + 1; j++ ) {
345 speed->
at(i, j) = damgp;
350 for (
int i = 1; i <= 2 *
gridSize + 1; i++ ) {
351 for (
int j = 1; j <= 2 *
gridSize + 1; j++ ) {
353 if ( dist2 < minDist2->at(i, j) ) {
355 speed->
at(i, j) = damgp;
363 for (
int i = 1; i <= 2 *
gridSize + 1; i++ ) {
364 for (
int j = 1; j <= 2 *
gridSize + 1; j++ ) {
377 center.
at(1, 1) = center.
at(1, 2) = ( double )
gridSize + 1;
384 for (
auto lip : *list ) {
386 ngpElem = ( lip.nearGp )->giveElement();
392 }
else if ( j > 2 *
gridSize + 1 ) {
398 }
else if ( i > 2 *
gridSize + 1 ) {
404 if ( distance < 0. ) {
431 std :: vector< localIntegrationRecord > :: iterator postarget;
434 for (
auto pos = list->begin(); pos != list->end(); ++pos ) {
435 if ( pos->nearGp == gp ) {
443 double xtarget = coords.
at(1);
445 double w, wsum = 0., x, xprev, damage, damageprev = 0.;
449 double distance = 0.;
451 for (
auto pos = postarget; pos != list->end(); ++pos ) {
452 nearElem = ( pos->nearGp )->giveElement();
464 if ( pos != postarget ) {
478 for (
auto pos = postarget; pos != list->begin(); --pos ) {
479 nearElem = ( pos->nearGp )->giveElement();
491 if ( pos != postarget ) {
504 auto pos = list->begin();
505 if ( pos != postarget ) {
506 nearElem = ( pos->nearGp )->giveElement();
547 case 2:
return 1. / (
Rf /
cl + ( 1. -
Rf /
cl ) * pow(1. - damage,
exponent) );
549 case 3:
if ( damage == 0. ) {
552 return 1. / ( 1. - ( 1. -
Rf /
cl ) * pow(damage,
exponent) );
555 case 4:
return 1. / pow(
Rf /
cl, damage);
557 case 5:
return ( 2. *
cl ) / (
cl +
Rf + (
cl -
Rf ) * cos(
M_PI * damage) );
559 case 6:
return 1. / sqrt(1. - damage);
565 std :: vector< localIntegrationRecord > *
606 if ( distance >
suprad || distance < 0. ) {
610 double aux = distance / this->
cl;
615 aux = ( 1. - aux * aux );
616 return aux * aux / iwf;
619 return exp(-aux * aux) / iwf;
623 return exp(-aux) / iwf;
635 double r = sqrt(x * x + y * y);
636 double sum = exp(-r / this->
cl);
637 double h = this->
cl / 10.;
640 r = sqrt(x * x + y * y);
641 sum += 2. * exp(-r / this->
cl);
644 return sum * h / iwf;
665 const double pi =
M_PI;
668 switch ( spatial_dimension ) {
669 case 1:
return cl * 16. / 15.;
671 case 2:
return cl *
cl * pi / 3.;
673 case 3:
return cl *
cl *
cl * pi * 32. / 105.;
679 switch ( spatial_dimension ) {
680 case 1:
return cl * sqrt(pi);
682 case 2:
return cl *
cl * pi;
684 case 3:
return cl *
cl *
cl * sqrt(pi * pi * pi);
691 switch ( spatial_dimension ) {
692 case 1:
return cl * 2.;
694 case 2:
return cl *
cl * 2. * pi;
696 case 3:
return cl *
cl *
cl * 8. * pi;
702 switch ( spatial_dimension ) {
703 case 1:
return cl * 2.;
705 case 2:
return cl *
cl * pi;
707 case 3:
return cl *
cl *
cl * ( 4. / 3. ) * pi;
805 if ( nlvariation == 1 ) {
809 }
else if ( nlvariation == 2 ) {
812 }
else if ( nlvariation == 3 ) {
911 bool shieldFlag =
false;
913 for ( ib = 1; ib <= nbarrier; ib++ ) {
939 double distance = 1.e10;
942 for ( ib = 1; ib <= nbarrier; ib++ ) {
944 if ( distance > temp ) {
950 double newradius = 0.0;
953 newradius = ( 1. -
beta ) / (
zeta * cl0 ) * distance +
beta;
958 newradius = 1. - ( 1. -
beta ) * exp( -distance / (
zeta *
cl0 ) );
960 return newradius *
cl0;
WeightFunctionType
Type characterizing the nonlocal weight function.
#define _IFT_NonlocalMaterialExtensionInterface_r
#define _IFT_NonlocalMaterialExtensionInterface_exp
double beta
Parameter which multiplied with the interaction radius cl0 gives its minimum allowed value...
void updateDomainBeforeNonlocAverage(TimeStep *tStep)
Updates data in all integration points before nonlocal average takes place.
void modifyNonlocalWeightFunctionAround(GaussPoint *gp)
Recompute the nonlocal interaction weights based on the current solution (e.g., on the damage field)...
NonlocalMaterialStatusExtensionInterface()
Constructor.
double exponent
Parameter used as an exponent by models with evolving characteristic length.
void endIPNonlocalAverage(GaussPoint *gp)
Notifies the receiver, that the nonlocal averaging has been finished for given ip.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
ScalingType
Type characterizing the scaling approach.
void setMethod(int o, double i, int c)
Set the details of the algorithm to be used.
virtual double evaluateSupportRadius()
Determines the width (radius) of limited support of weighting function.
#define _IFT_NonlocalMaterialExtensionInterface_regionmap
double giveSolutionValueAt(int i, int j)
Output methods.
virtual void giveAllElementsWithIpWithinBox_EvenIfEmpty(elementContainerType &elemSet, const FloatArray &coords, const double radius)=0
Returns container (set) of all domain elements having integration point within given box...
#define _IFT_NonlocalMaterialExtensionInterface_nonlocalvariation
virtual void applyConstraint(const FloatArray &c1, const FloatArray &c2, double &weight, bool &shieldFlag, NonlocalMaterialExtensionInterface *nei)=0
Abstract method modifying the integration weight between master (c1) and source (c2) point...
void unFreeze()
Set all flags to "unfrozen".
virtual double calculateMinimumDistanceFromBoundary(const FloatArray &coords)=0
Abstract method calculating the minimum distance of the Gauss Point from the nonlocal boundaries...
#define _IFT_NonlocalMaterialExtensionInterface_gridsize
AveragedVarType averagedVar
Parameter specifying the type of averaged (nonlocal) variable.
NonlocalBarrier * giveNonlocalBarrier(int n)
Service for accessing particular domain nonlocal barrier representation.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
int giveGlobalNumber() const
Domain * giveDomain()
Returns reference to domain.
void applyBarrierConstraints(const FloatArray &gpCoords, const FloatArray &jGpCoords, double &weight)
void setNonlocalUpdateStateCounter(StateCounterType val)
sets the value of nonlocalUpdateStateCounter
virtual void giveAllElementsWithNodesWithinBox(elementContainerType &elemSet, const FloatArray &coords, const double radius)
Returns container (set) of all domain elements having node within given box.
virtual double giveNonlocalMetricModifierAt(GaussPoint *gp)
Provide the current value of the variable that affects nonlocal interaction (e.g., of damage) This method is used e.g.
NlVariationType nlvar
Parameter specifying the type of nonlocal variation.
void buildNonlocalPointTable(GaussPoint *gp)
Builds list of integration points which take part in nonlocal average in given integration point...
Abstract base class for all finite elements.
bool permanentNonlocTableFlag
Flag indicating whether to keep nonlocal interaction tables of integration points cached...
Element * giveElement()
Returns corresponding element to receiver.
Abstract base class for all nonlocal constitutive model statuses.
ScalingType scaling
Parameter specifying the type of scaling of nonlocal weight function.
std::vector< localIntegrationRecord > * giveIntegrationDomainList()
Returns integration list of receiver.
int giveNumberOfSpatialDimensions()
Returns number of spatial dimensions.
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
double mapToGridCoord(double x, double x0)
#define _IFT_NonlocalMaterialExtensionInterface_wft
double weight
Corresponding integration weight.
AveragedVarType
Type characterizing the averaged (nonlocal) variable.
virtual int hasBoundedSupport()
Determines, whether receiver has bounded weighting function (limited support).
FloatMatrix * givePrescribedField()
#define _IFT_NonlocalMaterialExtensionInterface_averagingtype
Abstract base class representing integration rule.
WeightFunctionType weightFun
Parameter specifying the type of nonlocal weight function.
#define _IFT_NonlocalMaterialExtensionInterface_permanentNonlocTableFlag
double zeta
Parameter used when Distance-based nonlocal variation is applied When it is multiplied with the inter...
double computeDistanceModifier(double damage)
Compute the factor that specifies how the interaction length should be modified, based on the current...
IRResultType initializeFrom(InputRecord *ir)
int averType
Parameter specifying how the weight function should be adjusted due to damage.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
FloatMatrix * minDist2
Auxiliary matrix to store minimum distances of grid points from Gauss points.
virtual double give(int aProperty, GaussPoint *gp)
Returns the value of material property 'aProperty'.
#define _IFT_NonlocalMaterialExtensionInterface_initdiag
int gridSize
Grid on which the eikonal equation will be solved (used by eikonal nonlocal models) ...
virtual double computeVolumeAround(GaussPoint *gp)
Returns volume related to given integration point.
double giveDistanceBasedInteractionRadius(const FloatArray &gpCoords)
Provides the distance based interaction radius This function is called when nlvariation is set to 1...
#define _IFT_NonlocalMaterialExtensionInterface_rf
NonlocalMaterialExtensionInterface(Domain *d)
Constructor.
Element * giveElement(int n)
Service for accessing particular domain fe element.
StateCounterType giveNonlocalUpdateStateCounter()
Returns the value of nonlocalUpdateStateCounter.
double cl0
Initial(user defined) characteristic length of the nonlocal model (its interpretation depends on the ...
double px
Parameter specifying the periodic shift in x-direction.
StateCounterType giveSolutionStateCounter()
Returns current solution state counter.
#define _IFT_NonlocalMaterialExtensionInterface_centdiff
void modifyNonlocalWeightFunction_1D_Around(GaussPoint *gp)
#define _IFT_NonlocalMaterialExtensionInterface_px
GaussPoint * nearGp
Reference to influencing integration point.
void clear()
clears the integration list of receiver
int giveNumber()
Returns number of receiver.
void setZeroValues(FloatMatrix *gridCoords)
Methods setting the values of the unknown field at selected points (e.g., zero times) ...
#define _IFT_NonlocalMaterialExtensionInterface_m
std::vector< localIntegrationRecord > * giveIPIntegrationList(GaussPoint *gp)
Returns integration list corresponding to given integration point.
Class that solves certain problems on a regular 2D grid, consisting of n x m nodes.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
#define _IFT_NonlocalMaterialExtensionInterface_scalingtype
#define _IFT_NonlocalMaterialExtensionInterface_beta
virtual ~NonlocalMaterialStatusExtensionInterface()
Destructor.
double dist2FromGridNode(double x, double y, int j, int i)
Class representing vector of real numbers.
double giveIntegralOfWeightFunction(const int spatial_dimension)
Provides the integral of the weight function over the contributing volume in 1, 2 or 3D...
void rebuildNonlocalPointTable(GaussPoint *gp, IntArray *contributingElems)
Rebuild list of integration points which take part in nonlocal average in given integration point...
#define _IFT_NonlocalMaterialExtensionInterface_zeta
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
void setIntegrationScale(double val)
Sets associated integration scale.
void manipulateWeight(double &weight, GaussPoint *gp, GaussPoint *jGp)
Manipulates weight on integration point in the element.
double mm
For "undernonlocal" or "overnonlocal" formulation.
IntegrationPointStatus * giveMaterialStatus()
Returns reference to associated material status (NULL if not defined).
double initDiag
Optional parameters setting details of the fast marching method.
IntArray regionMap
Map indicating regions to skip (region - cross section model).
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
int giveNumberOfNonlocalBarriers() const
Returns number of nonlocal integration barriers.
virtual double maxValueOfWeightFunction()
Determines the maximum value of the nonlocal weight function.
int giveNumberOfRegions() const
Returns number of regions. Currently regions corresponds to cross section models. ...
#define _IFT_NonlocalMaterialExtensionInterface_order
#define _IFT_NonlocalMaterialExtensionInterface_averagedquantity
double integrationScale
Nonlocal volume around the corresponding integration point.
double volumeAround
Local volume around the corresponding integration point.
std::vector< std::unique_ptr< Element > > & giveElements()
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual bool hasProperty(int aProperty, GaussPoint *gp)
Returns true if 'aProperty' exists on material.
void setVolumeAround(double val)
Sets associated integration scale.
double cl
Characteristic length of the nonlocal model (its interpretation depends on the type of weight functio...
Class representing integration point in finite element program.
#define OOFEM_WARNING(...)
double suprad
Support radius.
Class representing solution step.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
double Rf
Final value of interaction radius, for a model with evolving characteristic length.
double giveVolumeAround()
Returns associated volume.
int mapToGridPoint(double x, double x0)
virtual double computeWeightFunction(double distance)
Evaluates the basic nonlocal weight function for a given distance between interacting points...
const FloatArray & giveNaturalCoordinates()
Returns coordinate array of receiver.
Structure containing reference to integration point and its corresponding nonlocal integration weight...
virtual Material * giveMaterial()
double computeModifiedLength(double length, double dam1, double dam2)
Compute the modified interaction length based on the current solution (e.g., on the damage field)...
void giveInputRecord(DynamicInputRecord &input)
Stores receiver in an input record.