69 StructuralElement :: StructuralElement(
int n,
Domain *aDomain) :
74StructuralElement :: ~StructuralElement()
79StructuralElement :: computeConstitutiveMatrixAt(
FloatMatrix &answer,
87 this->giveStructuralCrossSection()->giveCharMaterialStiffnessMatrix(answer, rMode, gp, tStep);
93 if ( type != ExternalForcesVector ) {
113 if ( type != ExternalForcesVector ) {
161 double thickness = 1.0;
168StructuralElement :: computeSurfaceVolumeAround(
GaussPoint *gp,
int iSurf)
189 if ( type != ExternalForcesVector ) {
241StructuralElement :: computeEdgeVolumeAround(
GaussPoint *gp,
int iEdge)
293 answer.
add(dV * dens, ntf);
301StructuralElement :: computePointLoadVectorAt(
FloatArray &answer,
Load *load,
TimeStep *tStep, ValueModeType mode,
bool global)
326StructuralElement :: giveNumberOfIPForMassMtrxIntegration()
337StructuralElement :: computeConsistentMassMatrix(
FloatMatrix &answer,
TimeStep *tStep,
double &mass,
const double *ipDensity)
346 answer.
resize(ndofs, ndofs);
362 if ( ipDensity != NULL ) {
364 density = * ipDensity;
368 mass += density * dV;
373 for (
int i = 1; i <= ndofs; i++ ) {
374 for (
int j = i; j <= ndofs; j++ ) {
377 if ( mask.
at(k) == 0 ) {
381 summ += n.
at(k, i) * n.
at(k, j);
384 answer.
at(i, j) += summ * density * dV;
419 int indx = 0, ldofs, dim;
424 answer.
resize(ndofs, ndofs);
435 for (
int j = 1; j <= nodeDofIDMask.
giveSize(); j++ ) {
438 for (
int k = 1; k <= ldofs; k++ ) {
440 answer.
at(indx, k) = 0.;
441 answer.
at(k, indx) = 0.;
445 if ( ( nodeDofIDMask.
at(j) != D_u ) && ( nodeDofIDMask.
at(j) != D_v ) && ( nodeDofIDMask.
at(j) != D_w ) ) {
447 answer.
at(indx, indx) = 0.;
448 }
else if ( nodeDofIDMask.
at(j) == D_u ) {
450 }
else if ( nodeDofIDMask.
at(j) == D_v ) {
452 }
else if ( nodeDofIDMask.
at(j) == D_w ) {
458 if ( indx != ldofs ) {
462 dim = dimFlag.
at(1) + dimFlag.
at(2) + dimFlag.
at(3);
464 for (
int k = 1; k <= ldofs; k++ ) {
465 summ += answer.
at(k, k);
468 answer.
times(dim * mass / summ);
489 for (
int i = 1; i <= nLoads; i++ ) {
491 load =
domain->giveLoad(n);
494 answer.
add(temperature);
504 for (BCTracker::entryListType::const_iterator it = bcList.begin(); it != bcList.end(); ++it) {
510 answer.
add(temperature);
535 for (
int i = 1; i <= nLoads; i++ ) {
537 load =
domain->giveLoad(n);
540 answer.
add(eigenstrain);
549 for (BCTracker::entryListType::iterator it = bcList.begin(); it != bcList.end(); ++it) {
556 answer.
add(eigenstrain);
575StructuralElement :: computeStiffnessMatrix(
FloatMatrix &answer, MatResponseMode rMode,
579 int iStartIndx, iEndIndx, jStartIndx, jEndIndx;
582 bool matStiffSymmFlag = this->
giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
609 dij.
beSubMatrixOf(d, iStartIndx, iEndIndx, jStartIndx, jEndIndx);
618 if ( matStiffSymmFlag ) {
632 if ( matStiffSymmFlag ) {
640 if ( matStiffSymmFlag ) {
645void StructuralElement :: computeStiffnessMatrix_withIRulesAsSubcells(
FloatMatrix &answer,
646 MatResponseMode rMode,
TimeStep *tStep)
650 bool matStiffSymmFlag = this->
giveCrossSection()->isCharacteristicMtrxSymmetric(rMode);
653 answer.
resize(ndofs, ndofs);
670 if ( matStiffSymmFlag ) {
684 if ( matStiffSymmFlag ) {
719 this->giveStructuralCrossSection()->giveRealStresses(answer, gp, strain, tStep);
724StructuralElement :: giveInternalForcesVector(
FloatArray &answer,
725 TimeStep *tStep,
int useUpdatedGpRecord)
751 if ( useUpdatedGpRecord == 1 ) {
790 StructuralMaterial :: giveReducedSymVectorForm(stressTemp, stress, gp->
giveMaterialMode() );
807StructuralElement :: giveInternalForcesVector_withIRulesAsSubcells(
FloatArray &answer,
808 TimeStep *tStep,
int useUpdatedGpRecord)
843 if ( useUpdatedGpRecord == 1 ) {
893 if ( mtrx == TangentStiffnessMatrix ) {
895 }
else if ( mtrx == SecantStiffnessMatrix ) {
897 }
else if ( mtrx == ElasticStiffnessMatrix ) {
899 }
else if ( mtrx == MassMatrix ) {
901 }
else if ( mtrx == LumpedMassMatrix ) {
903 }
else if ( mtrx == InitialStressMatrix ) {
905 }
else if ( mtrx == LumpedInitialStressMatrix ) {
921 if ( mtrx == ExternalForcesVector ) {
924 }
else if ( ( mtrx == InternalForcesVector ) && ( mode == VM_Total ) ) {
926 }
else if ( ( mtrx == LastEquilibratedInternalForcesVector ) && ( mode == VM_Total ) ) {
931 }
else if ( mtrx == LumpedMassMatrix ) {
936 answer [ i ] = M(i, i);
944StructuralElement :: updateYourself(
TimeStep *tStep)
946 Element :: updateYourself(tStep);
960StructuralElement :: updateInternalState(
TimeStep *tStep)
975StructuralElement :: updateBeforeNonlocalAverage(
TimeStep *tStep)
1002 if ( !materialExt ) {
1012StructuralElement :: checkConsistency()
1036 answer.
resize(dim, dim * numNodes);
1055 double coeff, dii, lii = 0;
1072 if ( !( load->
giveSize() == size ) ) {
1082 for ( i = 1; i <= nkon; i++ ) {
1084 if ( ( ii > size ) || ( ii <= 0 ) ) {
1088 dii = stiff->
at(ii, ii);
1094 for ( j = 1; j <= size; j++ ) {
1095 coeff = -stiff->
at(j, ii) / dii;
1097 for ( k = 1; k <= size; k++ ) {
1098 stiff->
at(j, k) += stiff->
at(ii, k) * coeff;
1103 load->
at(j) += coeff * lii;
1107 gaussCoeff.
at(j) = coeff;
1111 for ( k = 1; k <= size; k++ ) {
1112 stiff->
at(ii, k) = 0.;
1113 stiff->
at(k, ii) = 0.;
1119 for ( j = 1; j <= size; j++ ) {
1120 for ( k = 1; k <= size; k++ ) {
1121 if ( ( ii != j ) && ( ii != k ) ) {
1122 mass->
at(j, k) += mass->
at(j, ii) * gaussCoeff.
at(k) +
1123 mass->
at(ii, k) * gaussCoeff.
at(j) +
1124 mass->
at(ii, ii) * gaussCoeff.
at(j) * gaussCoeff.
at(k);
1129 for ( k = 1; k <= size; k++ ) {
1130 mass->
at(ii, k) = 0.;
1131 mass->
at(k, ii) = 0.;
1141 if ( type == IST_DisplacementVector ) {
1149 return Element :: giveIPValue(answer, gp, type, tStep);
1158 locationArray.
clear();
1165 if ( interface == NULL ) {
1166 locationArray.
clear();
1170 auto integrationDomainList = interface->
1171 NonlocalMaterialStiffnessInterface_giveIntegrationDomainList(ip);
1173 for (
auto &lir : * integrationDomainList ) {
1174 lir.nearGp->giveElement()->giveLocationArray(elemLocArry, s);
1197 if ( interface == NULL ) {
1217 if ( interface == NULL ) {
1221 result &= interface->MMI_update(ip, tStep, & strain);
1230 Element :: giveInputRecord(input);
1241void StructuralElement :: createMaterialStatus()
1258 if ( type == IST_DisplacementVector ) {
1266 return Element :: giveInternalStateAtNode(answer, type, mode, node, tStep);
1275 if ( mtrx == TangentStiffnessMatrix ||
1276 mtrx == SecantStiffnessMatrix || mtrx == ElasticStiffnessMatrix ) {
1285 EASValsSetColor(
gc.getStandardSparseProfileColor() );
1287 EASValsSetFillStyle(FILL_SOLID);
1290 for ( i = 1; i <= n; i++ ) {
1291 if ( loc.
at(i) == 0 ) {
1295 for ( j = i; j <= n; j++ ) {
1296 if ( loc.
at(j) == 0 ) {
1300 if (
gc.getSparseProfileMode() == 0 ) {
1301 p [ 0 ].x = ( FPNum ) loc.
at(i) - 0.5;
1302 p [ 0 ].y = ( FPNum ) loc.
at(j) - 0.5;
1304 p [ 1 ].x = ( FPNum ) loc.
at(i) + 0.5;
1305 p [ 1 ].y = ( FPNum ) loc.
at(j) - 0.5;
1307 p [ 2 ].x = ( FPNum ) loc.
at(i) + 0.5;
1308 p [ 2 ].y = ( FPNum ) loc.
at(j) + 0.5;
1310 p [ 3 ].x = ( FPNum ) loc.
at(i) - 0.5;
1311 p [ 3 ].y = ( FPNum ) loc.
at(j) + 0.5;
1313 go = CreateQuad3D(p);
1314 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
1315 EMAddGraphicsToModel(ESIModel(), go);
1317 p [ 0 ].x = ( FPNum ) loc.
at(j) - 0.5;
1318 p [ 0 ].y = ( FPNum ) loc.
at(i) - 0.5;
1320 p [ 1 ].x = ( FPNum ) loc.
at(j) + 0.5;
1321 p [ 1 ].y = ( FPNum ) loc.
at(i) - 0.5;
1323 p [ 2 ].x = ( FPNum ) loc.
at(j) + 0.5;
1324 p [ 2 ].y = ( FPNum ) loc.
at(i) + 0.5;
1326 p [ 3 ].x = ( FPNum ) loc.
at(j) - 0.5;
1327 p [ 3 ].y = ( FPNum ) loc.
at(i) + 0.5;
1329 go = CreateQuad3D(p);
1330 EGWithMaskChangeAttributes(WIDTH_MASK | FILL_MASK | COLOR_MASK | LAYER_MASK, go);
1331 EMAddGraphicsToModel(ESIModel(), go);
1333 p [ 0 ].x = ( FPNum ) loc.
at(i);
1334 p [ 0 ].y = ( FPNum ) loc.
at(j);
1337 EASValsSetMType(SQUARE_MARKER);
1338 go = CreateMarker3D(p);
1339 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
1340 EMAddGraphicsToModel(ESIModel(), go);
1342 p [ 0 ].x = ( FPNum ) loc.
at(j);
1343 p [ 0 ].y = ( FPNum ) loc.
at(i);
1346 EASValsSetMType(SQUARE_MARKER);
1347 go = CreateMarker3D(p);
1348 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | VECMTYPE_MASK, go);
1349 EMAddGraphicsToModel(ESIModel(), go);
1359 if ( mtrx == TangentStiffnessMatrix ) {
1365 if ( interface == NULL ) {
const entryListType & getElementRecords(int elem)
std::list< Entry > entryListType
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
int giveApproxOrder() override=0
CoordSystType giveCoordSystMode() override
double giveCoordinate(int i) const
Node * giveNode(int i) const
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
virtual bool isActivated(TimeStep *tStep)
virtual FEInterpolation * giveInterpolation() const
virtual int giveSpatialDimension()
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary)
virtual int computeNumberOfDofs()
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
IntArray * giveBodyLoadArray()
Returns array containing load numbers of loads acting on element.
virtual MaterialMode giveMaterialMode()
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary)
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
virtual int giveIntegrationRuleLocalCodeNumbers(IntArray &answer, IntegrationRule &ie)
virtual integrationDomain giveIntegrationDomain() const
int activityTimeFunction
Element activity time function. If defined, nonzero value indicates active receiver,...
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
virtual IntegrationRule * giveIntegrationRule(int i)
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
elementParallelMode giveParallelMode() const
virtual int giveNumberOfDofManagers() const
CrossSection * giveCrossSection()
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Element(int n, Domain *aDomain)
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
virtual double computeVolumeAround(GaussPoint *gp)
virtual Element_Geometry_Type giveGeometryType() const =0
virtual void boundaryEdgeLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double boundarySurfaceGiveTransformationJacobian(int isurf, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual double boundaryEdgeGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int number
Component number.
void assemble(const FloatArray &fe, const IntArray &loc)
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void rotatedWith(FloatMatrix &r, char mode)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void beTProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
void add(const FloatArray &src)
void subtract(const FloatArray &src)
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
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()
void beSubMatrixOf(const FloatMatrix &src, Index topRow, Index bottomRow, Index topCol, Index bottomCol)
void plusProductUnsym(const FloatMatrix &a, const FloatMatrix &b, double dV)
int giveNumberOfColumns() const
Returns number of columns of receiver.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void beNMatrixOf(const FloatArray &n, int nsd)
void zero()
Zeroes all coefficient of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
void assemble(const FloatMatrix &src, const IntArray &loc)
double at(std::size_t i, std::size_t j) const
bool isSquare() const
Returns nonzero if receiver is square matrix.
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
const FloatArray & giveSubPatchCoordinates() const
Returns local sub-patch coordinates of the receiver.
IntegrationPointStatus * giveMaterialStatus(IntegrationPointStatusIDType key=IPSID_Default)
double giveWeight()
Returns integration weight of receiver.
virtual bcGeomType giveBCGeoType() const
virtual bcValType giveBCValType() const
virtual bool isImposed(TimeStep *tStep)
int giveSetNumber() const
void followedBy(const IntArray &b, int allocChunk=0)
virtual int getRequiredNumberOfIntegrationPoints(integrationDomain dType, int approxOrder)
int setUpIntegrationPoints(integrationDomain intdomain, int nPoints, MaterialMode matMode)
const FloatArrayF< 6 > & giveLatticeStress() const
Returns lattice stress.
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)=0
virtual void computeComponentArrayAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual FormulationType giveFormulationType()
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
virtual void NonlocalMaterialStiffnessInterface_addIPContribution(SparseMtrx &dest, const UnknownNumberingScheme &s, GaussPoint *gp, TimeStep *tStep)=0
Computes and adds IP contributions to destination matrix.
virtual void NonlocalMaterialStiffnessInterface_showSparseMtrxStructure(GaussPoint *gp, oofegGraphicContext &gc, TimeStep *)
const FloatArray & giveCoordinates() const
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
CoordSystType giveCoordSystMode() override
virtual void createMaterialStatus(GaussPoint &iGP)=0
virtual int computeLoadLSToLRotationMatrix(FloatMatrix &answer, int iSurf, GaussPoint *gp)
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)=0
virtual void computeLumpedMassMatrix(FloatMatrix &answer, TimeStep *tStep)
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
virtual void computeInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep)
virtual void computeSurfaceNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
StructuralCrossSection * giveStructuralCrossSection()
Helper function which returns the structural cross-section for the element.
virtual void computeConsistentMassMatrix(FloatMatrix &answer, TimeStep *tStep, double &mass, const double *ipDensity=NULL)
virtual void computePointLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, bool global=true)
virtual void setupIRForMassMtrxIntegration(IntegrationRule &iRule)
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
virtual void giveMassMtrxIntegrationgMask(IntArray &answer)
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)=0
virtual void computeLumpedInitialStressMatrix(FloatMatrix &answer, TimeStep *tStep)
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
virtual void computeBodyLoadVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode)
std::unique_ptr< FloatArray > initialDisplacements
Initial displacement vector, describes the initial nodal displacements when element has been casted.
virtual void computeStrainVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
virtual int giveNumberOfIPForMassMtrxIntegration()
virtual int computeLoadLEToLRotationMatrix(FloatMatrix &answer, int iEdge, GaussPoint *gp)
virtual void computeMassMatrix(FloatMatrix &answer, TimeStep *tStep)
virtual int computeLoadGToLRotationMtrx(FloatMatrix &answer)
virtual void computeEdgeNMatrix(FloatMatrix &answer, int boundaryID, const FloatArray &lcoords)
computes edge interpolation matrix
const char * giveClassName() const override
virtual void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)=0
const FloatArrayF< 3 > & giveTraction() const
Returns the const pointer to receiver's traction vector.
const FloatArray & giveStressVector() const
Returns the const pointer to receiver's stress vector.
virtual void updateBeforeNonlocAverage(const FloatArray &strainVector, GaussPoint *gp, TimeStep *tStep) const =0
#define OOFEM_WARNING(...)
@ CS_StructuralCapability
Structural capability.
@ Element_remote
Element in active domain is only mirror of some remote element.
GaussPoint IntegrationPoint
@ BodyLoadBGT
Distributed body load.
const char * __CharTypeToString(CharType _value)
InternalStateMode
Determines the mode of internal variable.
@ NonlocalMaterialStiffnessInterfaceType
@ MaterialModelMapperInterfaceType
@ NonlocalMaterialExtensionInterfaceType
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_SPARSE_PROFILE_WIDTH
#define OOFEG_SPARSE_PROFILE_LAYER