37 #include "../sm/Materials/structuralmaterial.h" 38 #include "../sm/CrossSections/structuralcrosssection.h" 156 for (
size_t i = 0; i < nodeEiIndices.size(); i++ ) {
185 const double regularizationCoeff =
mRegCoeff;
187 for(
int i = 0; i < numRows; i++) {
188 if( fabs(answer(i,i)) < tol ) {
189 answer(i,i) += regularizationCoeff;
213 return EGT_Composite;
215 return EGT_Composite;
218 return EGT_triangle_2;
281 const int numCells =
mSubTri.size();
285 vtkPieces[0].setNumberOfCells(1);
287 int numTotalNodes = 6;
288 vtkPieces[0].setNumberOfNodes(numTotalNodes);
291 std :: vector< FloatArray >nodeCoords;
292 for(
int i = 1; i <= 6; i++) {
296 vtkPieces[0].setNodeCoords(i, x);
300 IntArray nodes1 = {1, 2, 3, 4, 5, 6};
301 vtkPieces[0].setConnectivity(1, nodes1);
305 vtkPieces[0].setOffset(1, offset);
308 vtkPieces[0].setCellType(1, 22);
314 vtkPieces[0].setNumberOfPrimaryVarsToExport(primaryVarsToExport.
giveSize(), numTotalNodes);
316 for (
int fieldNum = 1; fieldNum <= primaryVarsToExport.
giveSize(); fieldNum++ ) {
319 for (
int nodeInd = 1; nodeInd <= numTotalNodes; nodeInd++ ) {
321 if ( type == DisplacementVector ) {
344 u = {uTemp[0], uTemp[1], 0.0};
347 vtkPieces[0].setPrimaryVarInNode(fieldNum, nodeInd, u);
349 printf(
"fieldNum: %d\n", fieldNum);
362 vtkPieces[0].setNumberOfInternalVarsToExport(0, numTotalNodes);
366 vtkPieces[0].setNumberOfCellVarsToExport(cellVarsToExport.
giveSize(), 1);
367 for (
int i = 1; i <= cellVarsToExport.
giveSize(); i++ ) {
373 average = {0., 0., 0., 0., 0., 0.};
377 vtkPieces[0].setCellVar( i, 1, average );
382 averageV9.
at(1) = average.
at(1);
383 averageV9.
at(5) = average.
at(2);
384 averageV9.
at(9) = average.
at(3);
385 averageV9.
at(6) = averageV9.
at(8) = average.
at(4);
386 averageV9.
at(3) = averageV9.
at(7) = average.
at(5);
387 averageV9.
at(2) = averageV9.
at(4) = average.
at(6);
389 vtkPieces[0].setCellVar( i, 1, averageV9 );
407 for (
int enrItIndex = 1; enrItIndex <= nEnrIt; enrItIndex++ ) {
409 for (
int nodeInd = 1; nodeInd <= numTotalNodes; nodeInd++ ) {
420 if ( xfemstype == XFEMST_LevelSetPhi ) {
421 double levelSet = 0.0, levelSetInNode = 0.0;
423 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
427 levelSet += N.
at(elNodeInd)*levelSetInNode;
432 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
434 }
else if ( xfemstype == XFEMST_LevelSetGamma ) {
435 double levelSet = 0.0, levelSetInNode = 0.0;
437 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
441 levelSet += N.
at(elNodeInd)*levelSetInNode;
446 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
448 }
else if ( xfemstype == XFEMST_NodeEnrMarker ) {
449 double nodeEnrMarker = 0.0, nodeEnrMarkerInNode = 0.0;
451 for(
int elNodeInd = 1; elNodeInd <= nDofMan; elNodeInd++) {
455 nodeEnrMarker += N.
at(elNodeInd)*nodeEnrMarkerInNode;
460 vtkPieces[0].setInternalXFEMVarInNode(field, enrItIndex, nodeInd, valueArray);
std::vector< Triangle > mSubTri
virtual void computeField(ValueModeType mode, TimeStep *tStep, const FloatArray &lcoords, FloatArray &answer)
Computes the unknown vector interpolated at the specified local coordinates.
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
virtual ~QTrPlaneStress2dXFEM()
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
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)
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.
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
Returns local vector of unknowns.
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.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual void postInitialize()
Performs post initialization steps.
Elements with geometry defined as EGT_Composite are exported using individual pieces.
virtual FloatArray * giveCoordinates()
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.
virtual FEInterpolation * giveInterpolation() const
virtual void initializeCZMaterial()
Base class for dof managers.
virtual int computeNumberOfDofs()
Computes or simply returns total number of element's local DOFs.
virtual void giveDofManDofIDMask(int inode, IntArray &answer) const
Returns dofmanager dof mask for node.
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)
XfemManager * giveXfemManager()
virtual int giveNumberOfDofManagers() const
virtual IRResultType initializeCZFrom(InputRecord *ir)
virtual void computeCohesiveTangent(FloatMatrix &answer, TimeStep *tStep)
virtual void giveCompositeExportData(std::vector< VTKPiece > &vtkPieces, IntArray &primaryVarsToExport, IntArray &internalVarsToExport, IntArray cellVarsToExport, TimeStep *tStep)
VTK Interface.
Class representing a general abstraction for finite element interpolation class.
int giveNumberOfEnrichmentItems() const
void updateYourselfCZ(TimeStep *tStep)
int giveNumberOfDofs() const
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
virtual MaterialMode giveMaterialMode()
Returns material mode for receiver integration points.
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
virtual void computeBmatrixAt(GaussPoint *gp, FloatMatrix &answer, int lowerIndx=1, int upperIndx=ALL_STRAINS)
Computes the geometrical matrix of receiver in given integration point.
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 giveDofManPlaceInArray(int iGlobalDofManNum) const
Returns the array index of the dofman with global number iGlobalDofManNum, so that it can be fetched ...
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...
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
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.
Implementation of matrix containing floating point numbers.
MaterialMode giveMaterialMode()
This class manages the xfem part.
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 computeNmatrixAt(const FloatArray &iLocCoord, FloatMatrix &answer)
Computes interpolation matrix for element unknowns.
virtual void postInitialize()
Performs post initialization steps.
bool isElementEnriched(const Element *elem)
virtual void computeStiffnessMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
Computes the stiffness matrix of receiver.
void followedBy(const IntArray &b, int allocChunk=0)
Appends array b at the end of receiver.
virtual void updateYourself(TimeStep *tStep)
Updates element state after equilibrium in time step has been reached.
EnrichmentItem * giveEnrichmentItem(int n)
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.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
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.
int giveSize() const
Returns the size of receiver.
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 giveInternalForcesVector(FloatArray &answer, TimeStep *tStep, int useUpdatedGpRecord)
Evaluates nodal representation of real internal forces.
virtual void computeGaussPoints()
Initializes the array of integration rules member variable.
int giveNumberOfRows() const
Returns number of rows of receiver.
Class representing integration point in finite element program.
virtual Interface * giveInterface(InterfaceType it)
Interface requesting service.
Class representing solution step.
virtual void XfemElementInterface_computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *, TimeStep *tStep)
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *, TimeStep *tStep)
Computes constitutive matrix of receiver.
virtual void XfemElementInterface_computeStressVector(FloatArray &answer, const FloatArray &strain, GaussPoint *gp, TimeStep *tStep)