60 1, 5, 9, 8, 7, 4, 6, 3, 2
85 for (
int i = 1; i <= reducedForm.
giveSize(); i++ ) {
97 answer.
at(2) = answer.
at(4);
98 answer.
at(3) = answer.
at(7);
99 answer.
at(6) = answer.
at(8);
109 if ( elemGT == EGT_point ) {
111 }
else if ( elemGT == EGT_line_1 ) {
113 }
else if ( elemGT == EGT_line_2 ) {
115 }
else if ( elemGT == EGT_triangle_1 ) {
117 }
else if ( elemGT == EGT_triangle_2 ) {
119 }
else if ( elemGT == EGT_tetra_1 ) {
121 }
else if ( elemGT == EGT_tetra_2 ) {
123 }
else if ( elemGT == EGT_quad_1) {
125 }
else if ( elemGT == EGT_quad_21_interface ) {
127 }
else if ( elemGT == EGT_quad_2 ) {
129 }
else if ( elemGT == EGT_quad9_2 ) {
131 }
else if ( elemGT == EGT_hexa_1 || elemGT == EGT_quad_1_interface ) {
133 }
else if ( elemGT == EGT_hexa_2 ) {
135 }
else if ( elemGT == EGT_hexa_27 ) {
137 }
else if ( elemGT == EGT_wedge_1 ) {
139 }
else if ( elemGT == EGT_wedge_2 ) {
156 switch ( cellType ) {
207 if ( ( elemGT == EGT_point ) ||
208 ( elemGT == EGT_line_1 ) || ( elemGT == EGT_line_2 ) ||
209 ( elemGT == EGT_triangle_1 ) || ( elemGT == EGT_triangle_2 ) ||
210 ( elemGT == EGT_tetra_1 ) || ( elemGT == EGT_tetra_2 ) ||
211 ( elemGT == EGT_quad_1 ) || ( elemGT == EGT_quad_2 ) ||
212 ( elemGT == EGT_hexa_1 ) || ( elemGT == EGT_quad9_2 ) ||
213 ( elemGT == EGT_wedge_1 ) )
214 {}
else if ( elemGT == EGT_hexa_27 ) {
216 5, 8, 7, 6, 1, 4, 3, 2, 16, 15, 14, 13, 12, 11, 10, 9, 17, 20, 19, 18, 23, 25, 26, 24, 22, 21, 27
218 }
else if ( elemGT == EGT_hexa_2 ) {
220 5, 8, 7, 6, 1, 4, 3, 2, 16, 15, 14, 13, 12, 11, 10, 9, 17, 20, 19, 18
222 }
else if ( elemGT == EGT_wedge_2 ) {
224 4, 6, 5, 1, 3, 2, 12, 11, 10, 9, 8, 7, 13, 15, 14
226 }
else if ( elemGT == EGT_quad_1_interface ) {
228 1, 2, 4, 3, 5, 6, 8, 7
230 }
else if ( elemGT == EGT_quad_21_interface ) {
235 OOFEM_ERROR(
"VTKXMLExportModule: unsupported element geometry type");
239 answer.
resize(nelemNodes);
241 for (
int i = 1; i <= nelemNodes; i++ ) {
245 for (
int i = 1; i <= nelemNodes; i++ ) {
274 if ( numNodes > 0 && numRegionEl > 0 ) {
277 for (
int inode = 1; inode <= numNodes; inode++ ) {
292 for (
int ei = 1; ei <= elems.
giveSize(); ei++ ) {
293 int elNum = elems.
at(ei);
303 if ( !elem->
isCast(tStep) ) {
319 int numElNodes = cellNodes.
giveSize();
321 for (
int i = 1; i <= numElNodes; i++ ) {
322 connectivity.
at(i) = mapG2L.
at(cellNodes.
at(i) );
329 offset += numElNodes;
385 for (
int i = 1, n = primaryVarsToExport.
giveSize(); i <= n; i++ ) {
388 for (
int inode = 1; inode <= mapL2G.
giveSize(); inode++ ) {
413 if ( (type == DisplacementVector) || (type == ResidualForce) ) {
415 ( int ) Undef, (
int ) Undef, ( int ) Undef
417 for (
Dof *dof : * dman ) {
420 dofIDMask.
at(1) = id;
421 }
else if (
id == D_v ) {
422 dofIDMask.
at(2) = id;
423 }
else if (
id == D_w ) {
424 dofIDMask.
at(3) = id;
429 }
else if ( type == VelocityVector ) {
431 ( int ) Undef, (
int ) Undef, ( int ) Undef
433 for (
Dof *dof : * dman ) {
436 dofIDMask.
at(1) = id;
437 }
else if (
id == V_v ) {
438 dofIDMask.
at(2) = id;
439 }
else if (
id == V_w ) {
440 dofIDMask.
at(3) = id;
445 }
else if ( type == EigenVector ) {
447 ( int ) Undef, (
int ) Undef, ( int ) Undef
449 for (
Dof *dof : * dman ) {
451 if ( (
id == V_u ) || (
id == D_u ) ) {
452 dofIDMask.
at(1) = id;
453 }
else if ( (
id == V_v ) || (
id == D_v ) ) {
454 dofIDMask.
at(2) = id;
455 }
else if ( (
id == V_w ) || (
id == D_w ) ) {
456 dofIDMask.
at(3) = id;
461 }
else if ( type == FluxVector || type == Humidity ) {
463 iState = IST_MassConcentration_1;
465 }
else if ( type == DeplanationFunction ) {
467 iState = IST_Temperature;
469 }
else if ( type == Temperature ) {
471 iState = IST_Temperature;
473 }
else if ( type == PressureVector ) {
475 iState = IST_Pressure;
477 }
else if ( type == DirectorField ) {
478 for (
Dof *dof : * dman ) {
480 if ( (
id == W_u ) || (
id == W_v ) || (
id == W_w ) ) {
487 iState = IST_DirectorField;
488 }
else if ( type == MacroSlipVector ) {
489 for (
Dof *dof : * dman ) {
491 if ( (
id == S_u ) || (
id == S_v ) || (
id == S_w ) ) {
496 iState = IST_MacroSlipVector;
497 }
else if ( type == Concentration) {
507 for (
int j = 1; j <= size; j++ ) {
511 }
else if ( iState == IST_DirectorField ) {
516 if ( size == recoveredVal->
giveSize() ) {
517 answer.
at(j) = recoveredVal->
at(j);
519 OOFEM_WARNING(
"Recovered variable size mismatch for %d for id %d", type,
id);
522 }
else if (type == ResidualForce) {
528 }
else if ( iState != IST_Undefined ) {
539 if ( size == recoveredVal->
giveSize() ) {
540 answer.
at(j) = recoveredVal->
at(j);
553 Node *node =
dynamic_cast< Node *
>( dman );
577 for (
int field = 1; field <= internalVarsToExport.
giveSize(); field++ ) {
580 for (
int nodeNum = 1; nodeNum <= mapL2G.
giveSize(); nodeNum++ ) {
618 if ( !( type == IST_DisplacementVector || type == IST_MaterialInterfaceVal ) ) {
627 if ( type == IST_DisplacementVector ) {
631 for (
int i = 1; i <= 3; i++ ) {
634 }
else if ( type == IST_MaterialInterfaceVal ) {
650 answer.
resize(ncomponents);
655 answer.
at(1) = valSize ? val->
at(1) : 0.0;
659 if ( type == IST_BeamForceMomentTensor ) {
685 for (
int field = 1; field <= cellVarsToExport.
giveSize(); field++ ) {
688 for (
int subIndex = 1; subIndex <= elems.
giveSize(); ++subIndex ) {
695 vtkPiece.
setCellVar(type, subIndex, valueArray);
707 answer.
resize(ncomponents);
711 case IST_MaterialNumber:
716 case IST_CrossSectionNumber:
719 case IST_ElementNumber:
730 case IST_AbaqusStateVector:
739 case IST_MaterialOrientation_x:
740 case IST_MaterialOrientation_y:
741 case IST_MaterialOrientation_z:
745 if ( type == IST_MaterialOrientation_x ) {
747 }
else if ( type == IST_MaterialOrientation_y ) {
749 }
else if ( type == IST_MaterialOrientation_z ) {
761 case IST_VOFFraction:
762 case IST_VolumeFraction:
764 if (this->
emodel->giveField(FieldType::FT_VOF, tStep)) {
765 this->
emodel->giveField(FieldType::FT_VOF, tStep)->evaluateAt(answer, el, VM_Total, tStep);
786 }
else if ( ncomponents != answer.
giveSize() ) {
806 int elementNode, node;
813 regionG2LNodalNumbers.
resize(nnodes);
814 regionG2LNodalNumbers.
zero();
815 int regionDofMans = 0;
816 int regionSingleCells = 0;
819 for (
int ie = 1; ie <= elements.
giveSize(); ie++ ) {
820 int ielem = elements.
at(ie);
832 if ( !element->
isCast(tStep) ) {
845 for ( elementNode = 1; elementNode <= elemNodes; elementNode++ ) {
847 if ( regionG2LNodalNumbers.
at(node) == 0 ) {
851 regionG2LNodalNumbers.
at(node) = 1;
857 regionL2GNodalNumbers.
resize(regionDofMans);
859 for (
int i = 1; i <= nnodes; i++ ) {
860 if ( regionG2LNodalNumbers.
at(i) ) {
861 regionG2LNodalNumbers.
at(i) = currOffset++;
862 regionL2GNodalNumbers.
at(regionG2LNodalNumbers.
at(i) ) = i;
882 gptot += ip->giveWeight();
883 answer.
add(ip->giveWeight(), temp);
886 answer.
times(1. / gptot);
901 if ( externalForcesToExport.
giveSize() == 0 ) {
914 for (
int i = 1; i <= externalForcesToExport.
giveSize(); i++ ) {
918 if ( type == VelocityVector ) {
922 }
else if ( type == DisplacementVector ) {
926 }
else if ( type == PressureVector ) {
931 OOFEM_WARNING(
"Unrecognized UnknownType (%d), no external forces exported", type);
934 for (
int inode = 1; inode <= mapL2G.
giveSize(); inode++ ) {
938 for (
int k = 1; k <= dofids.
giveSize(); ++k ) {
943 valueArray.
at(k) = extForces.at(eq);
945 valueArray.
at(k) = extForcesP.
at(eq);
966 for (
int iset = 1; iset <= nsets; iset++ ) {
972 for (
int node : setNodes) {
973 int regionNode = regionG2LNodalNumbers.
at(node);
974 if (regionNode == 0) {
980 for (
int ic=1; ic<=regionElements.
giveSize(); ic++) {
981 int regionCell = regionElements.
at(ic);
bool hasDofID(DofIDItem id) const
double giveCoordinate(int i) const
const FloatArray & giveCoordinates() const
Dof * giveDofWithID(int dofID) const
int giveEquationNumber(const UnknownNumberingScheme &s)
virtual double giveUnknown(ValueModeType mode, TimeStep *tStep)=0
int giveNumberOfSets() const
Returns number of sets.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Element * giveElement(int n)
Node * giveNode(int i) const
virtual bool isActivated(TimeStep *tStep)
virtual int giveNumberOfNodes() const
virtual int giveNumberOfInternalDofManagers() const
virtual Material * giveMaterial()
virtual int giveLocalCoordinateSystem(FloatMatrix &answer)
elementParallelMode giveParallelMode() const
CrossSection * giveCrossSection()
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
virtual bool isCast(TimeStep *tStep)
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
virtual Element_Geometry_Type giveGeometryType() const =0
virtual void initialize()
ExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager with number n.
EngngModel * emodel
Problem pointer.
Stores all neccessary data (of a region) in a VTKPiece so it can be exported later.
void setCellVar(InternalStateType type, int cellNum, FloatArray valueArray)
void setInternalVarInNode(InternalStateType type, int nodeNum, FloatArray valueArray)
void setNumberOfLoadsToExport(int numVars, int numNodes)
void setCellType(int cellNum, int type)
void setNumberOfCellVarsToExport(const IntArray &cellVars, int numCells)
void setNumberOfInternalVarsToExport(const IntArray &ists, int numNodes)
void setLoadInNode(int varNum, int nodeNum, FloatArray valueArray)
void setNumberOfPrimaryVarsToExport(const IntArray &primVars, int numNodes)
IntArray & getRegionCells()
void setConnectivity(int cellNum, IntArray &nodes)
void setVertexSetMembership(int set, int nodeNum)
void setPrimaryVarInNode(UnknownType type, int nodeNum, FloatArray valueArray)
void setNumberOfSetMembershipsToExport(int numSets, int numNodes, int numCells)
void setOffset(int cellNum, int offset)
void setNumberOfCells(int numCells)
void setNodeCoords(int nodeNum, const FloatArray &coords)
void setCellSetMembership(int set, int cellNum)
void setNumberOfNodes(int numNodes)
Index giveSize() const
Returns the size of receiver.
void resizeWithValues(Index s, std::size_t allocChunk=0)
void beColumnOf(const FloatMatrix &mat, int col)
void zero()
Zeroes all coefficients of receiver.
void rotatedWith(FloatMatrix &r, char mode)
void add(const FloatArray &src)
void resize(Index rows, Index cols)
void beUnitMatrix()
Sets receiver to unity matrix.
void followedBy(const IntArray &b, int allocChunk=0)
void zero()
Sets all component to zero.
virtual double giveNodalScalarRepresentation(int)=0
virtual int recoverValues(Set elementSet, InternalStateType type, TimeStep *tStep)=0
int giveNodalVector(const FloatArray *&ptr, int node)
FloatMatrix * giveLocalCoordinateTriplet()
bool hasLocalCS()
Returns nonzero if node has prescribed local coordinate system.
virtual double giveUpdatedCoordinate(int ic, TimeStep *tStep, double scale=1.)
const IntArray & giveSpecifiedNodeList()
bool hasElement(int elem) const
Return True if given element is contained.
const IntArray & giveElementList()
const IntArray & giveNodeList()
void exportSetMembership(ExportRegion &piece, Set ®ion, TimeStep *tStep)
static IntArray redToFull
Map from Voigt to full tensor.
int giveNumberOfNodesPerCell(int cellType)
virtual ~VTKBaseExportModule()
Destructor.
bool isElementComposite(Element *elem)
void exportCellVars(ExportRegion &piece, Set ®ion, IntArray &cellVarsToExport, TimeStep *tStep)
Exports cell variables (typically internal variables).
void giveElementCell(IntArray &answer, Element *elem)
void initialize() override
static void makeFullTensorForm(FloatArray &answer, const FloatArray &reducedForm, InternalStateValueType vtype)
Gives the full form of given symmetrically stored tensors, missing components are filled with zeros.
void getNodalVariableFromIS(FloatArray &answer, Node *node, TimeStep *tStep, InternalStateType type, Set ®ion, NodalRecoveryModel &smoother)
int giveCellType(Element *element)
virtual int initRegionNodeNumbering(ExportRegion &vtkPiece, Domain *domain, TimeStep *tStep, Set ®ion)
VTKBaseExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager. By default all components are selected.
virtual void exportIntVars(ExportRegion &piece, Set ®ion, IntArray &internalVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
void exportExternalForces(ExportRegion &piece, int region, TimeStep *tStep)
void terminate() override
static void computeIPAverage(FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep)
void getCellVariableFromIS(FloatArray &answer, Element *el, InternalStateType type, TimeStep *tStep)
void getNodalVariableFromPrimaryField(FloatArray &answer, DofManager *dman, TimeStep *tStep, UnknownType type, Set ®ion, NodalRecoveryModel &smoother)
virtual void setupVTKPiece(ExportRegion &vtkPiece, TimeStep *tStep, Set ®ion)
virtual void exportPrimaryVars(ExportRegion &piece, Set ®ion, IntArray &primaryVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
#define OOFEM_WARNING(...)
@ Element_local
Element is local, there are no contributions from other domains to this element.
GaussPoint IntegrationPoint
int giveInternalStateTypeSize(InternalStateValueType valType)
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.
const char * __UnknownTypeToString(UnknownType _value)
InternalStateValueType giveInternalStateValueType(InternalStateType type)