35 #include "../sm/Elements/PlaneStress/planstrssxfem.h" 36 #include "../sm/Materials/structuralmaterial.h" 37 #include "../sm/CrossSections/structuralcrosssection.h" 157 for (
size_t i = 0; i < nodeEiIndices.size(); i++ ) {
186 const double tol = 1.0e-6;
187 const double regularizationCoeff = 1.0e-6;
189 for(
int i = 0; i < numRows; i++) {
190 if( fabs(answer(i,i)) < tol ) {
191 answer(i,i) += regularizationCoeff;
215 return EGT_Composite;
218 return EGT_Composite;
244 piRule->givePatch()->draw(context);
275 val = iRule->giveMaterial();
283 val /= iRule->giveNumberOfIntegrationPoints();
285 s.at(1) = s.at(2) = s.at(3) = val;
328 const int numCells =
mSubTri.size();
333 vtkPieces[0].setNumberOfCells(1);
335 int numTotalNodes = 4;
336 vtkPieces[0].setNumberOfNodes(numTotalNodes);
339 std :: vector< FloatArray >nodeCoords;
340 for(
int i = 1; i <= 4; i++) {
344 vtkPieces[0].setNodeCoords(i, x);
349 vtkPieces[0].setConnectivity(1, nodes1);
353 vtkPieces[0].setOffset(1, offset);
356 vtkPieces[0].setCellType(1, 9);
362 vtkPieces[0].setNumberOfPrimaryVarsToExport(primaryVarsToExport.
giveSize(), numTotalNodes);
364 for (
int fieldNum = 1; fieldNum <= primaryVarsToExport.
giveSize(); fieldNum++ ) {
367 for (
int nodeInd = 1; nodeInd <= numTotalNodes; nodeInd++ ) {
369 if ( type == DisplacementVector ) {
392 u = {uTemp[0], uTemp[1], 0.0};
395 vtkPieces[0].setPrimaryVarInNode(fieldNum, nodeInd, u);
397 printf(
"fieldNum: %d\n", fieldNum);
410 vtkPieces[0].setNumberOfInternalVarsToExport(0, numTotalNodes);
414 vtkPieces[0].setNumberOfCellVarsToExport(cellVarsToExport.
giveSize(), 1);
415 for (
int i = 1; i <= cellVarsToExport.
giveSize(); i++ ) {
427 averageVoigt.at(1) = average.
at(1);
428 averageVoigt.at(5) = average.
at(2);
429 averageVoigt.at(9) = average.
at(3);
430 averageVoigt.at(6) = averageVoigt.at(8) = average.
at(4);
431 averageVoigt.at(3) = averageVoigt.at(7) = average.
at(5);
432 averageVoigt.at(2) = averageVoigt.at(4) = average.
at(6);
436 averageVoigt.resize(1);
437 averageVoigt.at(1) = average.
at(1);
441 vtkPieces[0].setCellVar( i, 1, averageVoigt );
458 for (
int enrItIndex = 1; enrItIndex <= nEnrIt; enrItIndex++ ) {
460 for (
int nodeInd = 1; nodeInd <= numTotalNodes; nodeInd++ ) {
471 if ( xfemstype == XFEMST_LevelSetPhi ) {
472 double levelSet = 0.0, levelSetInNode = 0.0;
474 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
478 levelSet += N.
at(elNodeInd)*levelSetInNode;
483 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
485 }
else if ( xfemstype == XFEMST_LevelSetGamma ) {
486 double levelSet = 0.0, levelSetInNode = 0.0;
488 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
492 levelSet += N.
at(elNodeInd)*levelSetInNode;
497 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
499 }
else if ( xfemstype == XFEMST_NodeEnrMarker ) {
500 double nodeEnrMarker = 0.0, nodeEnrMarkerInNode = 0.0;
502 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
506 nodeEnrMarker += N.
at(elNodeInd)*nodeEnrMarkerInNode;
511 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *, TimeStep *tStep)
Computes constitutive matrix of receiver.
std::vector< Triangle > mSubTri
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
int testElementGraphicActivity(Element *)
Test if particular element passed fulfills various filtering criteria for its graphics output...
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)
Computes the geometrical matrix of receiver in given integration point.
Abstract class representing entity, which is included in the FE model using one (or more) global func...
virtual void XfemElementInterface_computeDeformationGradientVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in full form.
bool evalNodeEnrMarkerInNode(double &oNodeEnrMarker, int iNodeInd) const
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo)=0
Evaluates the array of interpolation functions (shape functions) at given point.
void giveSubtriangulationCompositeExportData(std::vector< VTKPiece > &vtkPieces, IntArray &primaryVarsToExport, IntArray &internalVarsToExport, IntArray cellVarsToExport, TimeStep *tStep)
VTK Interface.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
bool isDofManEnriched(const DofManager &iDMan) const
virtual void computeEnrichedDofManDofIdArray(IntArray &oDofIdArray, DofManager &iDMan)
Compute Id's of enriched dofs for a given DofManager.
Element_Geometry_Type
Enumerative type used to classify element geometry Possible values are: EGT_point - point in space EG...
int giveGlobalNumber() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Provides Xfem interface for an element.
const std::vector< int > & giveNodeEnrichmentItemIndices(int iNodeIndex) const
double & at(int i)
Coefficient access function.
void XfemElementInterface_createEnrBHmatrixAt(FloatMatrix &oAnswer, GaussPoint &iGP, Element &iEl)
Creates enriched BH-matrix.
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
virtual void postInitialize()
Performs post initialization steps.
Elements with geometry defined as EGT_Composite are exported using individual pieces.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual FloatArray * giveCoordinates()
virtual void initializeCZMaterial()
Base class for dof managers.
virtual void computeDeformationGradientVector(FloatArray &answer, GaussPoint *gp, TimeStep *tStep)
Computes the deformation gradient in Voigt form at integration point ip and at time step tStep...
MaterialMode
Type representing material mode of integration point.
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
MatResponseMode
Describes the character of characteristic material matrix.
void XfemElementInterface_createEnrBmatrixAt(FloatMatrix &oAnswer, GaussPoint &iGP, Element &iEl)
Creates enriched B-matrix.
virtual void giveCZInputRecord(DynamicInputRecord &input)
virtual void drawScalar(oofegGraphicContext &gc, TimeStep *tStep)
XfemManager * giveXfemManager()
virtual int giveNumberOfDofManagers() const
virtual IRResultType initializeCZFrom(InputRecord *ir)
virtual void computeCohesiveTangent(FloatMatrix &answer, TimeStep *tStep)
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
Class representing a general abstraction for finite element interpolation class.
int giveNumberOfEnrichmentItems() const
InternalStateType giveIntVarType()
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
void updateYourselfCZ(TimeStep *tStep)
int giveNumberOfDofs() const
virtual void computeBHmatrixAt(GaussPoint *gp, FloatMatrix &answer)
Computes a matrix which, multiplied by the column matrix of nodal displacements, gives the displaceme...
UnknownType
Type representing particular unknown (its physical meaning).
bool evalLevelSetNormalInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
void XfemElementInterface_createEnrNmatrixAt(FloatMatrix &oAnswer, const FloatArray &iLocCoord, Element &iEl, bool iSetDiscontContribToZero)
Creates enriched N-matrix.
Wrapper around element definition to provide FEICellGeometry interface.
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
int numberOfGaussPoints
Number of integration points as specified by nip.
InternalStateMode giveIntVarMode()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
bool evalLevelSetTangInNode(double &oLevelSet, int iNodeInd, const FloatArray &iGlobalCoord) const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Class representing vector of real numbers.
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
Implementation of matrix containing floating point numbers.
MaterialMode giveMaterialMode()
This class manages the xfem part.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
static void computeIPAverage(FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep)
Computes a cell average of an InternalStateType varible based on the weights in the integrationpoints...
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
IntArray vtkExportFields
List with the fields that should be exported to VTK.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual void postInitialize()
Performs post initialization steps.
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
bool isElementEnriched(const Element *elem)
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
Evaluates nodal representation of real internal forces.
virtual void drawRawGeometry(oofegGraphicContext &gc, TimeStep *tStep)
EnrichmentItem * giveEnrichmentItem(int n)
virtual FEInterpolation * giveInterpolation() const
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
Computes the element local coordinates from given global coordinates.
std::vector< std::unique_ptr< IntegrationRule > > integrationRulesArray
List of integration rules of receiver (each integration rule contains associated integration points a...
virtual bool XfemElementInterface_updateIntegrationRule()
Updates integration rule based on the triangulation.
Domain * giveDomain() const
InterfaceType
Enumerative type, used to identify interface type.
void push_back(const double &iVal)
Add one element.
virtual void giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord=0)
Evaluates nodal representation of real internal forces.
virtual void computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)
Computes the stress vector of receiver at given integration point, at time step tStep.
int giveSize() const
Returns the size of receiver.
virtual void computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
the oofem namespace is to define a context or scope in which all oofem names are defined.
DofManager * giveDofManager(int i) const
virtual void computeCohesiveForces(FloatArray &answer, TimeStep *tStep)
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
Class representing integration point in finite element program.
Class representing solution step.
virtual void XfemElementInterface_computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *, TimeStep *tStep)
virtual void giveCompositeExportData(std::vector< VTKPiece > &vtkPieces, IntArray &primaryVarsToExport, IntArray &internalVarsToExport, IntArray cellVarsToExport, TimeStep *tStep)
VTK Interface.
Temporary class for testing in the usual case instead of PlaneStress2dXfem there will be the standard...
PatchIntegrationRule provides integration over a triangle patch.
void resize(int s)
Resizes receiver towards requested size.
virtual void XfemElementInterface_computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)