78 double xc1, xc2, xa, xb, yc1, yc2, ya, yb;
79 double a11, a12, a21, a22, b1, b2, det, t, s;
87 for ( indx = 1; indx < size; indx++ ) {
102 det = a11 * a22 - a21 * a12;
107 t = ( b1 * a22 - b2 * a12 ) / det;
108 if ( t < 0. || t > 1. ) {
112 s = ( -b1 * a21 + b2 * a11 ) / det;
113 if ( s >= 0. && s <= 1. ) {
131 for (
int j = 1; j <= coords.
giveSize(); j++ ) {
138 if ( min > tempDistance ) {
161 if ( scaleFactor < 0. || scaleFactor > 1. ) {
172 lineAB.
times(scaleFactor);
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
double giveDistancePointLine(const FloatArray &coordsA, const FloatArray &coordsB, const FloatArray &coordsGP)
This function computes the length of the normal to the line defined by 2 vertices that passes through...
Abstract base class for all nonlocal barriers.
#define _IFT_PolylineNonlocalBarrier_xcoordindx
Abstract base class for all nonlocal materials.
Domain * domain
Link to domain object, useful for communicating with other FEM components.
double & at(int i)
Coefficient access function.
int localXCoordIndx
Local x-coordinate index.
Implementation of polyline nonlocal barrier.
virtual double calculateMinimumDistanceFromBoundary(const FloatArray &coords)
Abstract method calculating the minimum distance of the Gauss Point from the nonlocal boundaries...
virtual double giveCoordinate(int i)
int & at(int i)
Coefficient access function.
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
double computeSquaredNorm() const
Computes the square of the norm.
int localYCoordIndx
Local y-coordinate index.
Class representing vector of real numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
#define _IFT_PolylineNonlocalBarrier_ycoordindx
double computeNorm() const
Computes the norm (or length) of the vector.
virtual void applyConstraint(const FloatArray &c1, const FloatArray &c2, double &weight, bool &shieldFlag, NonlocalMaterialExtensionInterface *nei)
Abstract method modifying the integration weight between master (c1) and source (c2) point...
virtual bool isActivated(const FloatArray &c1, const FloatArray &c2)
IntArray vertexNodes
List of polyline vertices.
void times(double s)
Multiplies receiver with scalar.
int min(int i, int j)
Returns smaller value from two given decimals.
virtual ~PolylineNonlocalBarrier()
Virtual destructor.
int giveSize() const
Returns the size of receiver.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Class implementing node in finite element mesh.
#define _IFT_PolylineNonlocalBarrier_vertexnodes
REGISTER_NonlocalBarrier(PolylineNonlocalBarrier)
void add(const FloatArray &src)
Adds array src to receiver.