86Element :: Element(
int n,
Domain *aDomain) :
113 this->
giveDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep,
true);
124 assert(offset==(
int)answer.
size());
138 answer.
resize( dofIDMask.
giveSize() * ( this->giveNumberOfDofManagers() + this->giveNumberOfInternalDofManagers() ) );
142 this->
giveDofManager(i)->giveUnknownVector(vec, dofIDMask, u, tStep, padding);
152 assert(offset==(
int)answer.
size());
156 OOFEM_WARNING(
"The transformation matrix from global -> element local c.s. is not fully supported for this function (yet)");
171 for (
int bNode: bNodes ) {
172 this->
giveDofManager( bNode )->giveUnknownVector(vec, dofIDMask, u, tStep, padding);
176 assert(offset==(
int)answer.
size());
179 OOFEM_ERROR(
"Local coordinate system is not implemented yet");
193 this->
giveDofManager(i)->giveUnknownVector(vec, dofIDMask, field, u, tStep);
203 assert(offset==(
int)answer.
size());
223 this->
giveDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, u, tStep);
234 assert(offset==(
int)answer.
size());
249 answer.
resize( dofIDMask.
giveSize() * this->computeNumberOfGlobalDofs() );
253 this->
giveDofManager(i)->givePrescribedUnknownVector(vec, dofIDMask, mode, tStep);
263 assert(offset==(
int)answer.
size());
272Element :: computeNumberOfGlobalDofs()
279Element :: computeNumberOfPrimaryMasterDofs()
286 answer += this->
giveDofManager(i)->giveNumberOfPrimaryMasterDofs(nodeDofIDMask);
300 bool is_GtoL, is_NtoG;
311 OOFEM_ERROR(
"GtoL transformation matrix size mismatch in columns");
314 OOFEM_ERROR(
"GtoL transformation matrix size mismatch in rows");
319 OOFEM_ERROR(
"NtoG transformation matrix size mismatch in columns");
322 OOFEM_ERROR(
"NtoG transformation matrix size mismatch in rows");
329 }
else if ( is_GtoL ) {
331 }
else if ( is_NtoG ) {
342Element :: computeDofTransformationMatrix(
FloatMatrix &answer,
const IntArray &nodes,
bool includeInternal)
347 for (
int n : nodes ) {
348 flag = flag || this->
giveDofManager( n )->requiresTransformation();
363 int nr, nc, lastRowPos = 0, lastColPos = 0;
365 for (
int n : nodes ) {
367 if ( !this->
giveDofManager( n )->computeM2GTransformation(dofManT, dofIDmask) ) {
374 for (
int j = 1; j <= nr; j++ ) {
375 for (
int k = 1; k <= nc; k++ ) {
377 answer.
at(lastRowPos + j, lastColPos + k) = dofManT.
at(j, k);
384 if ( includeInternal ) {
394 for (
int j = 1; j <= nr; j++ ) {
395 for (
int k = 1; k <= nc; k++ ) {
397 answer.
at(lastRowPos + j, lastColPos + k) = dofManT.
at(j, k);
411Element :: giveBodyLoadArray()
420Element :: giveBoundaryLoadArray()
431 IntArray masterDofIDs, nodalArray, ids;
432 locationArray.
clear();
461 locationArray.
clear();
466 this->
giveDofManager(i)->giveLocationArray(dofIDMask, nodalArray, s);
469 this->
giveDofManager(i)->giveMasterDofIDArray(dofIDMask, masterDofIDs);
487 IntArray masterDofIDs, nodalArray, dofIDMask;
488 locationArray.
clear();
492 for (
int i = 1; i <= bNodes.
giveSize(); i++ ) {
494 this->
giveDofManager( bNodes.
at(i) )->giveLocationArray(dofIDMask, nodalArray, s);
497 this->
giveDofManager( bNodes.
at(i) )->giveMasterDofIDArray(dofIDMask, masterDofIDs);
508 locationArray.
clear();
512 for (
int i = 1; i <= bNodes.
giveSize(); i++ ) {
513 this->
giveDofManager( bNodes.
at(i) )->giveLocationArray(dofIDMask, nodalArray, s);
516 this->
giveDofManager( bNodes.
at(i) )->giveMasterDofIDArray(dofIDMask, masterDofIDs);
546Element :: giveRegionNumber()
553Element :: giveDofManager(
int i)
const
556 if ( ( i <= 0 ) || ( i >
dofManArray.giveSize() ) ) {
567 if ( dMan == NULL ) {
568 OOFEM_ERROR(
"Element :: addDofManager - dMan is a null pointer");
577Element :: giveSide(
int i)
const
580 if ( ( i <= 0 ) || ( i >
dofManArray.giveSize() ) ) {
596Element :: setDofManager(
int id,
int dm)
613Element :: setIntegrationRules(std :: vector< std :: unique_ptr< IntegrationRule > > irlist)
626 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
636 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
683 OOFEM_ERROR(
"Unknown Type of characteristic mtrx.");
699 bool tripletsflag =
false;
707 double n1 = 0.0, n2 = 0.0;
709 for (
int j = 1; j <= 3; j++ ) {
711 n1 += triplets.
at(j) * triplets.
at(j);
713 n2 += triplets.
at(j + 3) * triplets.
at(j + 3);
718 for (
int j = 1; j <= 3; j++ ) {
743 FEMComponent :: giveInputRecord(input);
763 for (
int j = 1; j <= 3; j++ ) {
786Element :: initializeFinish()
797Element :: postInitialize()
804Element :: printOutputAt(FILE *file,
TimeStep *tStep)
815 iRule->printOutputAt(file, tStep);
818 fprintf(file,
"is not active in current time step\n");
832 iRule->updateYourself(tStep);
863 for (
auto &gp: *iRule ) {
864 castingTime = this->
giveCrossSection()->giveMaterial(gp)->giveCastingTime();
866 if ( tNow < castingTime ) {
879Element :: initForNewStep()
884 for (
auto &gp: *iRule ) {
910std::unique_ptr<IntegrationRule>
916std::unique_ptr<IntegrationRule>
925 FEMComponent :: saveContext(stream, mode);
945 for (
int i = 1; i <= s; i++ ) {
967 if ( !stream.
write(numberOfIntegrationRules) ) {
972 int _val = iRule->giveIntegrationRuleType();
973 if ( !stream.
write(_val) ) {
984 if ( !stream.
write(_mode) ) {
994 iRule->saveContext(stream, mode);
1004 FEMComponent :: restoreContext(stream, mode);
1031 if ( !stream.
read(_nrules) ) {
1037 for (
int i = 1; i <= _nrules; i++ ) {
1038 if ( !stream.
read(dtypes.
at(i)) ) {
1047 for (
int i = 0; i < _nrules; i++ ) {
1051 for (
int i = 0; i < _nrules; i++ ) {
1063 if ( !stream.
read(_mode) ) {
1075 iRule->restoreContext(stream, mode);
1081Element :: computeVolumeAreaOrLength()
1088 for (
auto &gp: *iRule ) {
1100Element :: computeMeanSize()
1105 if ( volume < 0. ) {
1111 case 1:
return volume;
1113 case 2:
return sqrt(volume);
1115 case 3:
return cbrt(volume);
1123Element :: computeVolume()
1128 OOFEM_ERROR(
"Function not overloaded and necessary interpolator isn't available");
1136Element :: computeArea()
1141 OOFEM_ERROR(
"Function not overloaded and necessary interpolator isn't available");
1149Element :: computeLength()
1154 OOFEM_ERROR(
"Function not overloaded and necessary interpolator isn't available");
1168 double maxDis, minDis;
1171 const auto &coords = this->
giveNode(1)->giveCoordinates();
1172 minDis = maxDis = normalToCrackPlane.
dotProduct( coords, coords.giveSize() );
1174 for (
int i = 2; i <= nnode; i++ ) {
1175 const auto &coords = this->
giveNode(i)->giveCoordinates();
1176 double dis = normalToCrackPlane.
dotProduct( coords, coords.giveSize() );
1177 if ( dis > maxDis ) {
1179 }
else if ( dis < minDis ) {
1184 return maxDis - minDis;
1188Element :: giveCharacteristicLengthForPlaneElements(
const FloatArray &normalToCrackPlane)
1196 if ( normalToCrackPlane.
at(3) < 0.5 ) {
1204Element :: giveCharacteristicLengthForAxisymmElements(
const FloatArray &normalToCrackPlane)
1212 if ( normalToCrackPlane.
at(3) < 0.5 ) {
1217 r += this->
giveNode(i)->giveCoordinate(1);
1270 if ( isttype == IST_X_LCS ) {
1272 }
else if ( isttype == IST_Y_LCS ) {
1274 }
else if ( isttype == IST_Z_LCS ) {
1293 OOFEM_ERROR(
"Unable to compute mid-plane normal, not supported");
1300 if ( type == IST_ErrorIndicatorLevel ) {
1313 }
else if ( type == IST_InternalStressError ) {
1323 }
else if ( type == IST_PrimaryUnknownError ) {
1333 }
else if ( type == IST_CrossSectionNumber ) {
1337 }
else if ( type == IST_ElementNumber ) {
1341 }
else if ( type == IST_X_LCS || type == IST_Y_LCS || type == IST_Z_LCS ) {
1356 int ret = this->
giveIPValue(ans, gp, type, tStep);
1357 if ( ret == 0 )
return 0;
1370 OOFEM_ERROR(
"Unsupported internal state value type for computing global IP value");
1379 answer.
at(4) += answer.
at(7);
1380 answer.
at(5) += answer.
at(8);
1381 answer.
at(6) += answer.
at(9);
1386 return this->
giveIPValue(answer, gp, type, tStep);
1391Element :: giveSpatialDimension()
1402 case EGT_triangle_1:
1403 case EGT_triangle_2:
1407 case EGT_quad_1_interface:
1408 case EGT_quad_21_interface:
1425 OOFEM_ERROR(
"failure (maybe new element type was registered)");
1430Element :: giveNumberOfBoundarySides()
1439 case EGT_quad_1_interface:
1440 case EGT_quad_21_interface:
1443 case EGT_triangle_1:
1444 case EGT_triangle_2:
1470 OOFEM_ERROR(
"failure, unsupported geometry type (%s)",
1476Element :: giveNumberOfEdges()
const
1483 case EGT_quad_1_interface:
1484 case EGT_quad_21_interface:
1487 case EGT_triangle_1:
1488 case EGT_triangle_2:
1514 OOFEM_ERROR(
"failure, unsupported geometry type (%s)",
1519Element :: giveNumberOfSurfaces()
const
1525 case EGT_quad_1_interface:
1526 case EGT_quad_21_interface:
1527 case EGT_triangle_1:
1528 case EGT_triangle_2:
1552 OOFEM_ERROR(
"failure, unsupported geometry type (%s)",
1560 case EGT_triangle_1:
1568 case EGT_triangle_2:
1577 OOFEM_ERROR(
"failure, unsupported geometry type (%s)",
1587 return EGT_triangle_1;
1589 return EGT_triangle_2;
1595 if (
id<3)
return EGT_triangle_1;
1596 else return EGT_quad_1;
1598 OOFEM_ERROR(
"failure, unsupported geometry type (%s)",
1610 for (
auto &gp: *iRule ) {
1614 result &= interface->MMI_map(gp, oldd, tStep);
1631 Set sourceElemSet =
Set(0, & iOldDom);
1644 if ( interface == NULL ) {
1645 OOFEM_ERROR(
"Failed to fetch MaterialStatusMapperInterface.");
1648 result &= interface->
MSMI_map( *gp, iOldDom, sourceElemSet, iTStep, * ( ms ) );
1669 result &= interface->MMI_finish(tStep);
1693Element :: giveIntegrationDomain()
const
1739 result &= this->
giveCrossSection()->unpackAndUpdateUnknowns( buff, tStep, gp );
1763Element :: predictRelativeComputationalCost()
1808 p [ 0 ].x = p [ 0 ].y = p [ 0 ].z = 0.0;
1811 if ( ( node = this->
giveNode(i) ) ) {
1824 EASValsSetColor(
gc.getElementColor() );
1827 go = CreateAnnText3D(p, num);
1828 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK, go);
1829 EMAddGraphicsToModel(ESIModel(), go);
1837 if ( type == IST_RelMeshDensity ) {
1841 answer.
at(1) = this->
giveDomain()->giveErrorEstimator()->giveRemeshingCrit()->
virtual Material * giveMaterial(IntegrationPoint *ip) const =0
hidden by virtual oofem::Material* TransportCrossSection::giveMaterial() const
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
int giveGlobalNumber() const
double giveCoordinate(int i) const
void printOutputAt(FILE *file, TimeStep *tStep) override
const IntArray & giveElementsWithMaterialNum(int iMaterialNum) const
virtual void drawAnnotation(oofegGraphicContext &gc, TimeStep *tStep)
int giveGlobalNumber() const
Node * giveNode(int i) const
virtual int computeNumberOfGlobalDofs()
static ParamKey IPK_Element_crosssect
IntArray boundaryLoadArray
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
virtual void computeGaussPoints()
virtual bool computeGtoLRotationMatrix(FloatMatrix &answer)
virtual bool computeDofTransformationMatrix(FloatMatrix &answer, const IntArray &nodes, bool includeInternal)
IntArray dofManArray
Array containing dofmanager numbers.
virtual bool isActivated(TimeStep *tStep)
virtual double giveLengthInDir(const FloatArray &normalToCrackPlane)
static ParamKey IPK_Element_nodes
virtual FEInterpolation * giveInterpolation() const
static ParamKey IPK_Element_bodyload
virtual void giveInternalDofManDofIDMask(int inode, IntArray &answer) const
virtual int giveSpatialDimension()
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary)
virtual int giveNumberOfNodes() const
virtual IntArray giveBoundaryEdgeNodes(int boundary, bool includeHierarchical=false) const
virtual int giveNumberOfInternalDofManagers() const
virtual Element_Geometry_Type giveSurfaceGeometryType(int id) const
Returns the receiver surface geometry type.
virtual int computeNumberOfDofs()
static ParamKey IPK_Element_activityTimeFunction
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
virtual void giveLocalCoordinateSystemVector(InternalStateType isttype, FloatArray &answer)
virtual double computeVolumeAreaOrLength()
Computes the volume, area or length of the element depending on its spatial dimension.
virtual Material * giveMaterial()
virtual IntArray giveBoundarySurfaceNodes(int boundary, bool includeHierarchical=false) const
static ParamKey IPK_Element_nip
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary)
virtual double giveRelativeSelfComputationalCost()
int numberOfDofMans
Number of dofmanagers.
virtual IntArray giveBoundaryNodes(int boundary) const
int computeNumberOfPrimaryMasterDofs()
int activityTimeFunction
Element activity time function. If defined, nonzero value indicates active receiver,...
virtual int giveLocalCoordinateSystem(FloatMatrix &answer)
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
static ParamKey IPK_Element_remote
int material
Number of associated material.
virtual DofManager * giveInternalDofManager(int i) const
int crossSection
Number of associated cross section.
virtual int giveNumberOfDofManagers() const
IntArray globalSurfaceIDs
DofManager * giveDofManager(int i) const
FloatMatrix elemLocalCS
Transformation material matrix, used in orthotropic and anisotropic materials, global->local transfor...
CrossSection * giveCrossSection()
static ParamKey IPK_Element_boundaryload
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
virtual void drawDeformedGeometry(oofegGraphicContext &gc, TimeStep *tStep, UnknownType)
virtual Element_Geometry_Type giveEdgeGeometryType(int id) const
Returns the receiver edge geometry type.
static ParamKey IPK_Element_partitions
static ParamKey IPK_Element_mat
virtual void drawSpecial(oofegGraphicContext &gc, TimeStep *tStep)
static ParamKey IPK_Element_lcs
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
virtual double computeVolumeAround(GaussPoint *gp)
elementParallelMode parallel_mode
Determines the parallel mode of the element.
virtual Element_Geometry_Type giveGeometryType() const =0
virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep)=0
virtual double giveLength(const FEICellGeometry &cellgeo) const
virtual double giveArea(const FEICellGeometry &cellgeo) const
virtual double giveVolume(const FEICellGeometry &cellgeo) const
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
virtual IntArray boundaryEdgeGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const =0
virtual IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type) const =0
virtual int global2local(FloatArray &answer, const FloatArray &gcoords, const FEICellGeometry &cellgeo) const =0
virtual IntArray boundarySurfaceGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const =0
virtual integrationDomain giveIntegrationDomain(const Element_Geometry_Type) const =0
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary, const Element_Geometry_Type) const
virtual void local2global(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * giveDomain() const
virtual Interface * giveInterface(InterfaceType t)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int number
Component number.
FEMComponent(int n, Domain *d)
double dotProduct(const FloatArray &x) const
void resizeWithValues(Index s, std::size_t allocChunk=0)
void copySubVector(const FloatArray &src, int si)
void rotatedWith(FloatMatrix &r, char mode)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beVectorForm(const FloatMatrix &aMatrix)
void beRowOf(const FloatMatrix &mat, Index row)
void rotatedWith(const FloatMatrix &r, char mode='n')
void resizeWithData(Index, Index)
void resize(Index rows, Index cols)
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
int giveNumberOfColumns() const
Returns number of columns of receiver.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void zero()
Zeroes all coefficient of receiver.
bool isNotEmpty() const
Tests for empty matrix.
void beMatrixForm(const FloatArray &aArray)
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
void beUnitMatrix()
Sets receiver to unity matrix.
CrossSection * giveCrossSection()
Returns reference to cross section associated to related element of receiver.
void followedBy(const IntArray &b, int allocChunk=0)
void enumerate(int maxVal)
contextIOResultType storeYourself(DataStream &stream) const
virtual int MMI_finish(TimeStep *tStep)=0
virtual int MSMI_map(const GaussPoint &iGP, const Domain &iOldDom, Set &sourceSet, const TimeStep &iTStep, MaterialStatus &oStatus)
int giveNodalVector(const FloatArray *&ptr, int node)
void setElementList(IntArray newElements)
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
#define CM_DefinitionGlobal
#define OOFEM_WARNING(...)
const char * __InternalStateTypeToString(InternalStateType _value)
double cbrt(double x)
Returns the cubic root of x.
@ Element_remote
Element in active domain is only mirror of some remote element.
@ Element_local
Element is local, there are no contributions from other domains to this element.
const char * __Element_Geometry_TypeToString(Element_Geometry_Type _value)
@ _UnknownIntegrationDomain
@ OGC_eigenVectorGeometry
InternalStateMode
Determines the mode of internal variable.
InternalStateValueType
Determines the type of internal variable.
@ ISVT_TENSOR_S3E
symmetric 3x3 tensor, packed with off diagonal components multiplied by 2 (engineering strain vector,...
@ ISVT_TENSOR_S3
Symmetric 3x3 tensor.
@ ISVT_TENSOR_G
General tensor.
ClassFactory & classFactory
@ MaterialModelMapperInterfaceType
InternalStateValueType giveInternalStateValueType(InternalStateType type)
@ CIO_IOERR
General IO error.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_ELEMENT_ANNOTATION_LAYER
#define PM_UPDATE_PARAMETER_AND_REPORT(_val, _pm, _ir, _componentnum, _paramkey, _prio, _flag)
#define PM_CHECK_FLAG_AND_REPORT(_pm, _ir, _componentnum, _paramkey, _prio, _flag)
#define PM_ELEMENT_ERROR_IFNOTSET(_pm, _componentnum, _paramkey)
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)