72 if ( !sourceElement ) {
78 if ( egt == EGT_line_1 ) {
80 }
else if ( ( egt == EGT_triangle_1 ) || ( egt == EGT_quad_1 ) ) {
95 sourceElement->
giveIPValue(dam, gp, IST_PrincipalDamageTensor, tStep);
113 while ( ( actualNumberOfPoints < minNumberOfPoints ) && ( nite <= 2 ) ) {
118 actualNumberOfPoints = 0;
119 for (
int i = 1; i <= neighborList.
giveSize(); i++ ) {
130 element->
giveIPValue(dam, gp, IST_PrincipalDamageTensor, tStep);
132 actualNumberOfPoints++;
134 }
else if ( ( state == 0 ) && ( dam.
computeNorm() < 1.e-3 ) ) {
135 actualNumberOfPoints++;
170 #ifdef MMALSP_ONLY_CLOSEST_POINTS 173 FloatArray dist(actualNumberOfPoints), srcgpcoords;
176 if ( gpList == NULL ) {
180 for (
int ielem = 1; ielem <= patchList.
giveSize(); ielem++ ) {
185 element->
giveIPValue(dam, srcgp, IST_PrincipalDamageTensor, tStep);
188 if ( ( ( state == 1 ) && (
norm(dam) > 1.e-3 ) ) || ( ( ( state == 0 ) &&
norm(dam) < 1.e-3 ) ) ) {
190 dist.at(npoints) = coords.
distance(srcgpcoords);
191 gpList [ npoints - 1 ] = srcgp;
196 dist.at(npoints) = coords.
distance(srcgpcoords);
197 gpList [ npoints - 1 ] = srcgp;
205 if ( npoints != actualNumberOfPoints ) {
214 double swap, minDist;
217 for (
int i = 1; i <= minNumberOfPoints; i++ ) {
218 minDist = dist.at(i);
221 for ( j = i + 1; j <= actualNumberOfPoints; j++ ) {
222 if ( dist.at(j) < minDist ) {
223 minDist = dist.at(j);
229 patchGPList.push_front(gpList [ minDistIndx - 1 ]);
231 dist.at(i) = dist.at(minDistIndx);
232 dist.at(minDistIndx) = swap;
233 srcgp = gpList [ i - 1 ];
234 gpList [ i - 1 ] = gpList [ minDistIndx - 1 ];
235 gpList [ minDistIndx - 1 ] = srcgp;
249 for (
int ielem = 1; ielem <= patchList.
giveSize(); ielem++ ) {
286 }
else if ( size < neq ) {
290 element = srcgp->giveElement();
301 for (
int j = 1; j <= neq; j++ ) {
302 for (
int k = 1; k <= nval; k++ ) {
303 rhs.
at(j, k) += P.
at(j) * ipVal.
at(k);
306 for (
int k = 1; k <= neq; k++ ) {
307 a.
at(j, k) += P.
at(j) * P.
at(k);
324 for ( j = 1; j <= neq; j++ ) {
325 for ( k = 1; k <= nval; k++ ) {
326 if ( fabs( tmp.
at(j, k) - rhs.
at(j, k) ) > 1.e-3 ) {
340 for (
int i = 1; i <= nval; i++ ) {
341 for (
int j = 1; j <= neq; j++ ) {
342 answer.
at(i) += P.
at(j) * x.
at(j, i);
384 P.
at(2) = coords.
at(1);
385 P.
at(3) = coords.
at(2);
386 P.
at(4) = coords.
at(1) * coords.
at(2);
387 P.
at(5) = coords.
at(1) * coords.
at(1);
388 P.
at(6) = coords.
at(2) * coords.
at(2);
391 P.
at(1) = coords.
at(1) * coords.
at(1);
392 P.
at(2) = coords.
at(1);
The base class for all spatial localizers.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Access method for default integration rule.
std::list< GaussPoint * > patchGPList
List of Gp participating in patch.
Element_Geometry_Type
Enumerative type used to classify element geometry Possible values are: EGT_point - point in space EG...
bool solveForRhs(const FloatArray &b, FloatArray &answer, bool transpose=false)
Solves the system of linear equations .
Domain * patchDomain
Patch domain.
double & at(int i)
Coefficient access function.
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
Abstract base class for all finite elements.
The class representing the general material model mapping algorithm.
Element * giveElement()
Returns corresponding element to receiver.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
int regionFilter
If set, then only IP in the same region are taken into account.
REGISTER_MaterialMappingAlgorithm(MMAClosestIPTransfer, MMA_ClosestPoint)
Abstract base class representing integration rule.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
virtual void __init(Domain *dold, IntArray &type, const FloatArray &coords, Set &sourceElemSet, TimeStep *tStep, bool iCohesiveZoneGP=false)
Initializes the receiver state before mapping.
Element * giveElement(int n)
Service for accessing particular domain fe element.
#define OOFEM_FATAL(...)
Macros for printing errors.
void clear()
Clears the array (zero size).
Set of elements, boundaries, edges and/or nodes.
SpatialLocalizer * giveSpatialLocalizer()
Returns receiver's associated spatial localizer.
#define _IFT_MMALeastSquareProjection_statefilter
virtual ~MMALeastSquareProjection()
Destructor.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
virtual Element * giveElementContainingPoint(const FloatArray &coords, const IntArray *regionList=NULL)=0
Returns the element, containing given point and belonging to one of the region in region list...
void giveElementNeighbourList(IntArray &answer, IntArray &elemList)
Returns list of neighboring elements to given elements (they are included too).
virtual void finish(TimeStep *tStep)
Finishes the mapping for given time step.
int stateFilter
If set, then only IP in the neighbourhood with same state can be used to interpolate the values...
Abstract base class representing a material status information.
void computePolynomialTerms(FloatArray &P, const FloatArray &coords, MMALeastSquareProjectionPatchType type)
Class representing vector of real numbers.
MMALeastSquareProjection()
Constructor.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
MMALeastSquareProjectionPatchType
virtual IRResultType initializeFrom(InputRecord *ir)
double norm(const FloatArray &x)
double computeNorm() const
Computes the norm (or length) of the vector.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record of receiver.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
int giveNumberOfIntegrationPoints() const
Returns number of integration points of receiver.
void zero()
Zeroes all coefficients of receiver.
int giveNumberOfUnknownPolynomialCoefficients(MMALeastSquareProjectionPatchType regType)
#define _IFT_MMALeastSquareProjection_regionfilter
void zero()
Zeroes all coefficient of receiver.
MMALeastSquareProjectionPatchType patchType
Type of patch.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
int giveSize() const
Returns the size of receiver.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual GaussPoint * giveClosestIP(const FloatArray &coords, int region, bool iCohesiveZoneGP=false)=0
Returns the integration point in associated domain, which is closest to given point.
virtual int mapStatus(MaterialStatus &oStatus) const
Initializes receiver according to object description stored in input record.
Class representing integration point in finite element program.
bool hasElement(int elem) const
Return True if given element is contained.
Class representing solution step.
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Computes the global coordinates from given element's local coordinates.
virtual int __mapVariable(FloatArray &answer, const FloatArray &coords, InternalStateType type, TimeStep *tStep)
Maps and update the unknown of given type from old mesh oldd to new mesh to which gp belongs to...
void resize(int s)
Resizes receiver towards requested size.