129 double n1 = 0.0, n2 = 0.0;
132 for (
int j = 1; j <= 3; j++ ) {
134 n1 += triplets.
at(j) * triplets.
at(j);
136 n2 += triplets.
at(j + 3) * triplets.
at(j + 3);
141 if ( ( n1 <= 1.e-6 ) || ( n2 <= 1.e-6 ) ) {
145 for (
int j = 1; j <= 3; j++ ) {
181 if ( type != ExternalForcesVector ) {
211 for (
Dof *dof: *
this ) {
215 printf(
"load array : ");
230 for (
Dof *d: *
this ) {
232 if (
id == D_u ||
id == D_v ||
id == D_w ) {
233 int ic =
id - D_u + 1;
235 }
else if (
id == V_u ||
id == V_v ||
id == V_w ) {
236 int ic =
id - V_u + 1;
251 if ( ( ic < 1 ) || ( ic > 3 ) ) {
252 OOFEM_ERROR(
"Can't return non-existing coordinate (index not in range 1..3)");
261 for (
Dof *d: *
this ) {
264 coordinate += scale * d->
giveUnknown(VM_Total, tStep);
266 }
else if (
id - V_u + 1 == ic ) {
279 displacements.
zero();
281 for (
Dof *d: *
this ) {
283 if (
id == D_u ||
id == D_v ||
id == D_w ) {
284 int ic2 =
id - D_u + 1;
285 displacements.at(ic2) = scale * d->
giveUnknown(VM_Total, tStep);
286 }
else if (
id == V_u ||
id == V_v ||
id == V_w ) {
287 int ic2 =
id - V_u + 1;
293 for (
int i = 1; i <= 3; i++ ) {
294 coordinate += displacements.at(i) * T->
at(i, ic);
300 OOFEM_ERROR(
"Can't return updatedCoordinate for non-current timestep");
317 for (
int i = 1; i <= coord.
giveSize(); i++ ) {
318 coord.
at(i) += scale * vec.
at(i);
337 for (
Dof *dof: *
this ) {
338 if ( dynamic_cast< SimpleSlaveDof * >( dof ) ) {
343 if ( nslaves == 0 ) {
347 IntArray masterDofManagers(nslaves);
349 int master, alreadyFound = 0;
352 for (
Dof *dof: *
this ) {
357 for (
int j = 1; j <= numberOfMDM; j++ ) {
358 if ( masterDofManagers.
at(j) == master ) {
364 if ( alreadyFound == 0 ) {
368 masterDofManagers.
at(numberOfMDM) = master;
394 for (
int k = 1; k <= 3; k++ ) {
395 for (
int l = 1; l <= 3; l++ ) {
396 if ( fabs( thisLcs->
at(k, l) - masterLcs->
at(k, l) ) > 1.e-4 ) {
402 for (
int k = 1; k <= 3; k++ ) {
403 for (
int l = 1; l <= 3; l++ ) {
404 if ( fabs( thisLcs->
at(k, l) - ( k == l ) ) > 1.e-4 ) {
410 for (
int k = 1; k <= 3; k++ ) {
411 for (
int l = 1; l <= 3; l++ ) {
412 if ( fabs( masterLcs->
at(k, l) - ( k == l ) ) > 1.e-4 ) {
442 answer.
resize(numberOfDofs, numberOfDofs);
446 for (
Dof *dof: *
this ) {
454 for (
Dof *dof2: *
this ) {
457 if ( ( id2 == D_u ) || ( id2 == D_v ) || ( id2 == D_w ) ) {
459 (
int ) ( id2 ) - (
int ) ( D_u ) + 1 );
468 for (
Dof *dof2: *
this ) {
471 if ( ( id2 == V_u ) || ( id2 == V_v ) || ( id2 == V_w ) ) {
473 (
int ) ( id2 ) - (
int ) ( V_u ) + 1 );
482 for (
Dof *dof2: *
this ) {
485 if ( ( id2 == R_u ) || ( id2 == R_v ) || ( id2 == R_w ) ) {
487 (
int ) ( id2 ) - (
int ) ( R_u ) + 1 );
496 answer.
at(i, i) = 1.0;
506 answer.
resize(size, size);
509 for (
int i = 1; i <= size; i++ ) {
515 for (
int j = 1; j <= size; j++ ) {
517 if ( ( id2 == D_u ) || ( id2 == D_v ) || ( id2 == D_w ) ) {
518 answer.
at(j, i) =
localCoordinateSystem->
at( (
int ) (
id ) - (
int ) ( D_u ) + 1, (
int ) ( id2 ) - (
int ) ( D_u ) + 1 );
527 for (
int j = 1; j <= size; j++ ) {
529 if ( ( id2 == V_u ) || ( id2 == V_v ) || ( id2 == V_w ) ) {
530 answer.
at(j, i) =
localCoordinateSystem->
at( (
int ) (
id ) - (
int ) ( V_u ) + 1, (
int ) ( id2 ) - (
int ) ( V_u ) + 1 );
539 for (
int j = 1; j <= size; j++ ) {
541 if ( ( id2 == R_u ) || ( id2 == R_v ) || ( id2 == R_w ) ) {
542 answer.
at(j, i) =
localCoordinateSystem->
at( (
int ) (
id ) - (
int ) ( R_u ) + 1, (
int ) ( id2 ) - (
int ) ( R_u ) + 1 );
551 answer.
at(i, i) = 1.0;
583 if ( !stream.
write(_haslcs) ) {
617 if ( !stream.
read(_haslcs) ) {
655 EASValsSetMType(FILLED_CIRCLE_MARKER);
661 EASValsSetMType(SQUARE_MARKER);
676 bool ordinary =
true;
678 for (
Dof *dof: *
this ) {
690 go = CreateMarker3D(p);
691 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);
692 EMAddGraphicsToModel(ESIModel(), go);
705 go = CreateAnnText3D(p, num);
706 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK, go);
707 EMAddGraphicsToModel(ESIModel(), go);
709 int i, hasDisplSupport [ 3 ], hasRotSupport [ 3 ], hasAny = 0;
717 for ( i = 0; i < 3; i++ ) {
718 hasDisplSupport [ i ] = 0;
719 hasRotSupport [ i ] = 0;
722 for (
Dof *dof: *
this ) {
723 if ( dof->
hasBc(tStep) ) {
726 case D_u: hasDisplSupport [ 0 ] = 1;
728 case D_v: hasDisplSupport [ 1 ] = 1;
730 case D_w: hasDisplSupport [ 2 ] = 1;
732 case R_u: hasRotSupport [ 0 ] = 1;
734 case R_v: hasRotSupport [ 1 ] = 1;
736 case R_w: hasRotSupport [ 2 ] = 1;
751 for ( i = 0; i < 3; i++ ) {
752 if ( hasDisplSupport [ i ] || hasRotSupport [ i ] ) {
772 pp [ 1 ].x = T->
at(i + 1, 1);
773 pp [ 1 ].y = T->
at(i + 1, 2);
774 pp [ 1 ].z = T->
at(i + 1, 3);
778 if ( hasDisplSupport [ i ] && hasRotSupport [ i ] ) {
779 EASValsSetVecMType(TRIPLE_ARROW_VECMARKER);
782 if ( hasDisplSupport [ i ] ) {
783 EASValsSetVecMType(ARROW_VECMARKER);
786 if ( hasRotSupport [ i ] ) {
787 EASValsSetVecMType(DOUBLE_ARROW_VECMARKER);
790 go = CreateVecMarker3D(pp);
791 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
792 EMAddGraphicsToModel(ESIModel(), go);
809 pp [ 1 ].x = pp [ 1 ].y = pp [ 1 ].z = 0.0;
827 for (
Dof *dof: *
this ) {
830 case D_u: force.at(1) = defScale * load.
at(i);
832 case D_v: force.at(2) = defScale * load.
at(i);
834 case D_w: force.at(3) = defScale * load.
at(i);
836 case R_u: momentum.
at(1) = defScale * load.
at(i);
838 case R_v: momentum.
at(2) = defScale * load.
at(i);
840 case R_w: momentum.
at(3) = defScale * load.
at(i);
850 EASValsSetVecMType(ARROW_VECMARKER);
851 pp [ 1 ].x = force.at(1);
852 pp [ 1 ].y = force.at(2);
853 pp [ 1 ].z = force.at(3);
854 go = CreateVector3D(pp);
855 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
856 EMAddGraphicsToModel(ESIModel(), go);
858 EASValsSetVecMType(DOUBLE_ARROW_VECMARKER);
859 pp [ 1 ].x = momentum.
at(1);
860 pp [ 1 ].y = momentum.
at(2);
861 pp [ 1 ].z = momentum.
at(3);
862 go = CreateVector3D(pp);
863 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
864 EMAddGraphicsToModel(ESIModel(), go);
878 for (
Dof *dof: *
this ) {
880 p [ 1 ].x = defScale * dof->
giveUnknown(VM_Total, tStep);
882 p [ 1 ].y = defScale * dof->
giveUnknown(VM_Total, tStep);
884 p [ 1 ].z = defScale * dof->
giveUnknown(VM_Total, tStep);
890 go = CreateVector3D(p);
891 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK, go);
892 EMAddGraphicsToModel(ESIModel(), go);
Class implementing a concentrated load (force, moment,...) that acts directly on a dof manager (node ...
int number
Component number.
void printYourself() const
Prints receiver on stdout.
bool isDofManEnriched(const DofManager &iDMan) const
bool hasLocalCS()
Returns nonzero if node has prescribed local coordinate system.
int giveGlobalNumber() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
virtual CoordSystType giveCoordSystMode()
Returns receiver's coordinate system.
FloatMatrix * localCoordinateSystem
Triplet defining the local coordinate system in node.
FloatMatrix * giveLocalCoordinateTriplet()
Returns pointer to local coordinate triplet in node.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
bool isEmpty() const
Checks if receiver is empty (i.e., zero sized).
Load is specified in global c.s.
contextIOResultType storeYourself(DataStream &stream) const
double & at(int i)
Coefficient access function.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
virtual const IntArray & giveDofIDs() const
Array with default dofs which b.c.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
void clear()
Clears receiver (zero size).
virtual void computeLoadVector(FloatArray &answer, Load *load, CharType type, TimeStep *tStep, ValueModeType mode)
Computes the load vector for given load.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep)=0
The key method of class Dof.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
virtual void giveUpdatedCoordinates(FloatArray &answer, TimeStep *tStep, double scale=1.)
Returns updated coordinate of receiver.
Base class for dof managers.
virtual void drawYourself(oofegGraphicContext &gc, TimeStep *tStep)
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
Computes boundary condition value - its components values at given time.
virtual double giveCoordinate(int i)
virtual void printYourself()
Prints the receiver state on stdout.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
XfemManager * giveXfemManager()
#define OOFEG_DEFORMED_GEOMETRY_LAYER
bool hasSameLCS(Node *remote)
Returns true, if the local coordinate systems of receiver and given node are the same.
contextIOResultType storeYourself(DataStream &stream) const
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
virtual void printYourself()
Prints receiver state on stdout. Useful for debugging.
double giveTimeIncrement()
Returns solution step associated time increment.
EPixel getDeformedElementColor()
int giveNumberOfEnrichmentItems() const
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
int giveMasterDofManagerNum() const
Returns Master Dof Manager Number.
InternalStateType giveIntVarType()
virtual bcGeomType giveBCGeoType() const
Returns geometry character of boundary condition.
int giveNumberOfDofs() const
void giveUnknownVectorOfType(FloatArray &answer, UnknownType ut, ValueModeType mode, TimeStep *tStep)
Constructs the requested vector by assembling e.g.
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
virtual void updateYourself(TimeStep *tStep)
Updates receiver at end of time step (i.e.
REGISTER_DofManager(ElementSide)
virtual double giveVariableScale(VarScaleType varId)
Returns the scale factor for given variable type.
DofIDItem
Type representing particular dof type.
virtual ~Node()
Destructor.
contextIOResultType restoreYourself(DataStream &stream)
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
virtual bool isPrimaryDof()
Tests if receiver is primary DOF.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
virtual fMode giveFormulation()
Indicates type of non linear computation (total or updated formulation).
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
Returns updated ic-th coordinate of receiver.
EPixel getCrackPatternColor()
double at(int i, int j) const
Coefficient access function.
Node(int n, Domain *aDomain)
Constructor.
IntArray loadArray
List of applied loads.
FloatArray coordinates
Array storing nodal coordinates.
contextIOResultType restoreYourself(DataStream &stream)
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
bool isTheCurrentTimeStep()
Check if receiver is current solution step.
Implementation of matrix containing floating point numbers.
This class manages the xfem part.
IRResultType
Type defining the return values of InputRecord reading operations.
#define OOFEG_NODE_ANNOTATION_LAYER
Class representing "slave" degree of freedom.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual bool giveEquationScalingFlag()
Returns the Equation scaling flag, which is used to indicate that governing equation(s) are scaled...
fMode
Type representing the type of formulation (total or updated) of non-linear computation.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
EnrichmentItem * giveEnrichmentItem(int n)
std::string __DofIDItemToString(DofIDItem _value)
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
IntArray * giveLoadArray()
Returns the array containing applied loadings of the receiver.
void zero()
Zeroes all coefficient of receiver.
virtual bool hasBc(TimeStep *tStep)=0
Test if Dof has active boundary condition.
Domain * giveDomain() const
Load is base abstract class for all loads.
int giveSize() const
Returns the size of receiver.
virtual bool computeL2GTransformation(FloatMatrix &answer, const IntArray &dofIDArry)
Computes transformation matrix from global c.s.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void clear()
Sets size of receiver to be an empty matrix. It will have zero rows and zero columns size...
Class implementing node in finite element mesh.
#define OOFEG_NATURALBC_LAYER
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
int giveNumberOfRows() const
Returns number of rows of receiver.
Load * giveLoad(int n)
Service for accessing particular domain load.
DofManager is local, there are no contribution from other domains to this DofManager.
virtual void updateYourself(TimeStep *tStep)
Updates receiver after equilibrium in time step has been reached.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
#define OOFEM_WARNING(...)
Class representing solution step.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
void add(const FloatArray &src)
Adds array src to receiver.
#define OOFEG_BCIC_ANNOTATION_LAYER
OGC_PlotModeType giveIntVarPlotMode()