OOFEM 3.0
Loading...
Searching...
No Matches
nonlocalmaterialext.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef nonlocalmaterialext_h
36#define nonlocalmaterialext_h
37
38#include "matstatus.h"
39#include "interface.h"
40#include "intarray.h"
41#include "grid.h"
42#include "mathfem.h"
43#include "dynamicinputrecord.h"
44
45#include <list>
46#include <memory>
47#ifdef _OPENMP
48#include <omp.h>
49#endif
51
52#define _IFT_NonlocalMaterialExtensionInterface_regionmap "regionmap"
53#define _IFT_NonlocalMaterialExtensionInterface_permanentNonlocTableFlag "permanentnonloctableflag"
54#define _IFT_NonlocalMaterialExtensionInterface_r "r"
55#define _IFT_NonlocalMaterialExtensionInterface_wft "wft"
56#define _IFT_NonlocalMaterialExtensionInterface_averagingtype "averagingtype"
57#define _IFT_NonlocalMaterialExtensionInterface_m "m"
58#define _IFT_NonlocalMaterialExtensionInterface_scalingtype "scaling"
59#define _IFT_NonlocalMaterialExtensionInterface_averagedquantity "averagedvar"
60#define _IFT_NonlocalMaterialExtensionInterface_nonlocalvariation "nlvariation"
61#define _IFT_NonlocalMaterialExtensionInterface_beta "beta"
62#define _IFT_NonlocalMaterialExtensionInterface_zeta "zeta"
63#define _IFT_NonlocalMaterialExtensionInterface_px "px"
64#define _IFT_NonlocalMaterialExtensionInterface_averagingtype "averagingtype"
65#define _IFT_NonlocalMaterialExtensionInterface_exp "exp"
66#define _IFT_NonlocalMaterialExtensionInterface_rf "rf"
67#define _IFT_NonlocalMaterialExtensionInterface_gridsize "gridsize"
68#define _IFT_NonlocalMaterialExtensionInterface_initdiag "initdiag"
69#define _IFT_NonlocalMaterialExtensionInterface_order "order"
70#define _IFT_NonlocalMaterialExtensionInterface_centdiff "centdiff"
72
73namespace oofem {
86
95
112{
113protected:
115 std :: vector< localIntegrationRecord >integrationDomainList;
120
121public:
126
129
135 std :: vector< localIntegrationRecord > *giveIntegrationDomainList() { return & integrationDomainList; }
139 void setIntegrationScale(double val) { integrationScale = val; }
141 double giveVolumeAround() { return volumeAround; }
143 void setVolumeAround(double val) { volumeAround = val; }
145 void clear() { integrationDomainList.clear(); }
146};
147
148
164{
165protected:
166 /*
167 * It is necessary, mainly due to resulting efficiency, to compute variable(s)
168 * which are nonlocally averaged in advance, before average process begins.
169 * The loop over all integration points is typically made to compute these variables.
170 * To prevent doing this multiple times at the same solution state,
171 * the modification time mark is kept.
172 * In the present implementation, there is one common stateCounter for the whole domain.
173 * This implies, that all variables (which undergo averaging) for all material models of the domain
174 * should be prepared at the same time in updateDomainBeforeNonlocAverage method.
175 * It is believed that this is general enough and can somehow handle even the case of multiple models
176 * with different parameters being averaged (but is this realistic?).
177 * If this scheme will not be enough general, then the state counter
178 * can be kept as attribute of NonlocalMaterialExtensionInterface, so independently for
179 * each material model. Each model will be then updated in separate call. But in the case of
180 * several material models of the same type (with different parameters) this will lead to
181 * multiple update, which can not be avoided, although it is redundant.
182 *
183 * StateCounterType lastUpdatedStateCounter;
184 */
185 Domain *domain = nullptr;
193 int gridSize = 0;
195 double initDiag = 0.;
196 int order = 0;
197 int centDiff = 0;
198
203 mutable double cl = 0.;
204
206 mutable double suprad = 0.;
207
209 double mm = 0.;
210
215
220
227 double cl0 = 0.;
237 double beta = 0.;
245 double zeta = 0.;
246
254 double px = 0.;
255
256 // Parameters used by models with evolving characteristic length.
257
259 double Rf = 0.;
261 double exponent = 0.;
263 int averType = 0;
264
265#ifdef _OPENMP
266 public:
267 static omp_lock_t updateDomainBeforeNonlocAverageLock;
268#endif
269public:
277
278
294 void updateDomainBeforeNonlocAverage(TimeStep *tStep) const;
295
304 void buildNonlocalPointTable(GaussPoint *gp) const;
305
313 void rebuildNonlocalPointTable(GaussPoint *gp, IntArray *contributingElems) const;
314
319 void modifyNonlocalWeightFunctionAround(GaussPoint *gp) const;
320 void modifyNonlocalWeightFunction_1D_Around(GaussPoint *gp) const;
321
326 virtual double giveNonlocalMetricModifierAt(GaussPoint *gp) const { return 1.; }
327
333 double computeDistanceModifier(double cl, double damage) const;
334
339 double computeModifiedLength(double length, double dam1, double dam2) const;
340
348 std :: vector< localIntegrationRecord > *giveIPIntegrationList(GaussPoint *gp) const;
349
357 virtual double computeWeightFunction(const double cl, const double distance) const;
358
367 virtual double computeWeightFunction(const double cl, const FloatArray &src, const FloatArray &coord) const;
368
373 double giveIntegralOfWeightFunction(double cl, const int spatial_dimension) const;
374
375
377 virtual double maxValueOfWeightFunction();
378
384 /*
385 * Returns the region id of given element
386 * @param element pointer to element which region id is requested.
387 * @return Region id (number) for this element.
388 */
389 //int giveElementRegion (Element* element);
394 virtual int hasBoundedSupport() const { return 1; }
399 virtual double evaluateSupportRadius(double cl) const;
400
402 Domain *giveDomain() { return this->domain; }
403
404 void initializeFrom(InputRecord &ir);
409 void giveInputRecord(DynamicInputRecord &input);
410 /*
411 * Creates new copy of associated status and inserts it into given integration point.
412 * @param gp Integration point where newly created status will be stored.
413 * @return reference to new status.
414 */
415 //MaterialStatus* CreateStatus (GaussPoint* gp)
416 // {return new NonlocalMaterialStatus (1,this->giveDomain(), gp);;}
423 void endIPNonlocalAverage(GaussPoint *gp) const;
424
425protected:
426 /*
427 * Returns true if the barrier is activated
428 * by interaction of two given points. In this case the nonlocal influence
429 * is not considered.
430 * @param gpCoords Coordinates of first point.
431 * @param jGpCoords Coordinates of second point.
432 * @param weight Set to zero if the GP are across the barrier.
433 */
434 //bool isBarrierActivated (const FloatArray& c1, const FloatArray& c2) const;
435
436 void applyBarrierConstraints(const FloatArray &gpCoords, const FloatArray &jGpCoords, double &weight) const;
437
446 void manipulateWeight(double &weight, GaussPoint *gp, GaussPoint *jGp) const;
447
456 double giveDistanceBasedInteractionRadius(const FloatArray &gpCoords) const;
457
458 int mapToGridPoint(double x, double x0) const { return 1 + gridSize + ( int ) ceil(gridSize * ( x - x0 ) / suprad - 0.5); }
459 double mapToGridCoord(double x, double x0) const { return 1. + gridSize + gridSize * ( x - x0 ) / suprad; }
460 double dist2FromGridNode(double x, double y, int j, int i) const { return ( ( x - j ) * ( x - j ) + ( y - i ) * ( y - i ) ); }
461};
462} // end namespace oofem
463#endif // nonlocalmaterialext_h
double length(const Vector &a)
Definition CSG.h:88
Interface()
Constructor.
Definition interface.h:86
Domain * giveDomain()
Returns reference to domain.
int averType
Parameter specifying how the weight function should be adjusted due to damage.
NlVariationType
Type characterizing the Nonlocal variation.
double exponent
Parameter used as an exponent by models with evolving characteristic length.
NlVariationType nlvar
Parameter specifying the type of nonlocal variation.
virtual double giveNonlocalMetricModifierAt(GaussPoint *gp) const
bool permanentNonlocTableFlag
Flag indicating whether to keep nonlocal interaction tables of integration points cached.
ScalingType
Type characterizing the scaling approach.
AveragedVarType
Type characterizing the averaged (nonlocal) variable.
double Rf
Final value of interaction radius, for a model with evolving characteristic length.
ScalingType scaling
Parameter specifying the type of scaling of nonlocal weight function.
double initDiag
Optional parameters setting details of the fast marching method.
double dist2FromGridNode(double x, double y, int j, int i) const
int mapToGridPoint(double x, double x0) const
double mm
For "undernonlocal" or "overnonlocal" formulation.
WeightFunctionType weightFun
Parameter specifying the type of nonlocal weight function.
IntArray regionMap
Map indicating regions to skip (region - cross section model).
AveragedVarType averagedVar
Parameter specifying the type of averaged (nonlocal) variable.
int gridSize
Grid on which the eikonal equation will be solved (used by eikonal nonlocal models).
double mapToGridCoord(double x, double x0) const
void clear()
clears the integration list of receiver
void setIntegrationScale(double val)
Sets associated integration scale.
std ::vector< localIntegrationRecord > integrationDomainList
List containing localIntegrationRecord values.
double giveVolumeAround()
Returns associated volume.
void setVolumeAround(double val)
Sets associated integration scale.
double integrationScale
Nonlocal volume around the corresponding integration point.
std ::vector< localIntegrationRecord > * giveIntegrationDomainList()
double giveIntegrationScale()
Returns associated integration scale.
double volumeAround
Local volume around the corresponding integration point.
double distance(const FloatArray &x, const FloatArray &y)
#define OOFEM_EXPORT
Definition oofemcfg.h:7
GaussPoint * nearGp
Reference to influencing integration point.
double weight
Corresponding integration weight.

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011