OOFEM 3.0
Loading...
Searching...
No Matches
vtkxmlexportmodule.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "vtkxmlexportmodule.h"
36#include "element.h"
37#include "gausspoint.h"
38#include "timestep.h"
39#include "engngm.h"
40#include "node.h"
41#include "dof.h"
42#include "materialinterface.h"
43#include "mathfem.h"
44#include "cltypes.h"
45#include "material.h"
46#include "classfactory.h"
47#include "crosssection.h"
49
50#include "xfem/xfemmanager.h"
51#include "xfem/enrichmentitem.h"
52
55
56#ifdef __PFEM_MODULE
57 #include "pfem/pfemparticle.h"
58#endif
59
60#include <string>
61#include <sstream>
62#include <ctime>
63
64#ifdef __VTK_MODULE
65 #include <vtkPoints.h>
66 #include <vtkPointData.h>
67 #include <vtkDoubleArray.h>
68 #include <vtkCellArray.h>
69 #include <vtkCellData.h>
70 #include <vtkXMLUnstructuredGridWriter.h>
71 #include <vtkXMLPUnstructuredGridWriter.h>
72 #include <vtkUnstructuredGrid.h>
73 #include <vtkSmartPointer.h>
74#endif
75
76namespace oofem {
78
79
80VTKXMLExportModule::VTKXMLExportModule(int n, EngngModel *e) : VTKBaseExportModule(n, e), internalVarsToExport(), primaryVarsToExport()
81{}
82
83
85
86
87void
107
108
109void
111{
112 this->smoother = nullptr;
113 this->primVarSmoother = nullptr;
115}
116
117
118void
121
122std::string
124{
125 return this->giveOutputBaseFileName(tStep) + ".vtu";
126}
127
128
129std::ofstream
131{
132 std::string fileName = giveOutputFileName(tStep);
133 std::ofstream streamF;
134
135 if ( pythonExport ) {
136 streamF = std::ofstream(NULL_DEVICE);//do not write anything
137 } else {
138 streamF = std::ofstream(fileName);
139 }
140
141 if ( !streamF.good() ) {
142 OOFEM_ERROR("failed to open file %s", fileName.c_str() );
143 }
144
145 streamF.fill('0');//zero padding
146 return streamF;
147}
148
149
150void
151VTKXMLExportModule::doOutput(TimeStep *tStep, bool forcedOutput)
152{
153 if ( !( testTimeStepOutput(tStep) || forcedOutput ) ) {
154 return;
155 }
156
157#ifdef __VTK_MODULE
158 this->fileStream = vtkSmartPointer< vtkUnstructuredGrid >::New();
159 this->nodes = vtkSmartPointer< vtkPoints >::New();
160 this->elemNodeArray = vtkSmartPointer< vtkIdList >::New();
161
162#else
163 this->fileStream = this->giveOutputStream(tStep);
164 struct tm *current;
165 time_t now;
166 time(& now);
167 current = localtime(& now);
168
169#endif
170
171 // Write output: VTK header
172#ifndef __VTK_MODULE
173 this->fileStream << "<!-- TimeStep " << tStep->giveTargetTime() * timeScale << " Computed " << current->tm_year + 1900 << "-" << setw(2) << current->tm_mon + 1 << "-" << setw(2) << current->tm_mday << " at " << current->tm_hour << ":" << current->tm_min << ":" << setw(2) << current->tm_sec << " -->\n";
174 this->fileStream << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
175 this->fileStream << "<UnstructuredGrid>\n";
176#endif
177
178 this->giveSmoother(); // make sure smoother is created, Necessary? If it doesn't exist it is created /JB
179
180 /* Loop over pieces ///@todo: this feature has been broken but not checked if it currently works /JB
181 * Start default pieces containing all single cell elements. Elements built up from several vtk
182 * cells (composite elements) are exported as individual pieces after the default ones.
183 */
184 int nPiecesToExport = this->giveNumberOfRegions(); //old name: region, meaning: sets
185 int anyPieceNonEmpty = 0;
188
189 for ( int pieceNum = 1; pieceNum <= nPiecesToExport; pieceNum++ ) {
190 // Fills a data struct (VTKPiece) with all the necessary data.
191 Set* region = this->giveRegionSet(pieceNum);
192 this->setupVTKPiece(this->defaultVTKPiece, tStep, *region);
193 this->writeVTKPieceProlog(this->defaultVTKPiece, tStep);
194 // Export primary, internal and XFEM variables as nodal quantities
196 this->exportIntVars(this->defaultVTKPiece, *region, internalVarsToExport, *smoother, tStep);
197 this->exportExternalForces(this->defaultVTKPiece, *region, externalForcesToExport, tStep);
198 this->exportCellVars(this->defaultVTKPiece, *region, cellVarsToExport, tStep);
200 this->exportSetMembership(this->defaultVTKPiece, *region, tStep);
201 }
202
203 // Write the VTK piece to file.
204 anyPieceNonEmpty += this->writeVTKPieceVariables(this->defaultVTKPiece, tStep);
205 this->writeVTKPieceEpilog(this->defaultVTKPiece, tStep);
206 this->defaultVTKPiece.clear();
207 }
208
209 /*
210 * Output all composite elements - one piece per composite element
211 * Each element is responsible of setting up a VTKPiece which can then be exported
212 */
213 Domain *d = emodel->giveDomain(1);
214 for ( int pieceNum = 1; pieceNum <= nPiecesToExport; pieceNum++ ) {
215 const IntArray &elements = this->giveRegionSet(pieceNum)->giveElementList();
216 for ( int i = 1; i <= elements.giveSize(); i++ ) {
217 Element *el = d->giveElement(elements.at(i) );
218 if ( this->isElementComposite(el) ) {
219 if ( el->giveParallelMode() != Element_local ) {
220 continue;
221 }
222
223#ifndef __VTK_MODULE
224 //this->exportCompositeElement(this->defaultVTKPiece, el, tStep);
225 this->exportCompositeElement(this->defaultVTKPieces, el, tStep);
226
227 for ( int j = 0; j < ( int ) this->defaultVTKPieces.size(); j++ ) {
228 this->writeVTKPieceProlog(this->defaultVTKPieces[j], tStep);
229 anyPieceNonEmpty += this->writeVTKPieceVariables(this->defaultVTKPieces [ j ], tStep);
230 this->writeVTKPieceEpilog(this->defaultVTKPieces[j], tStep);
231 this->defaultVTKPieces [ j ].clear();
232 }
233#else
234 // No support for binary export yet
235#endif
236 }
237 }
238 } // end loop over composite elements
239
240#ifndef __VTK_MODULE
241 if ( anyPieceNonEmpty == 0 ) {
242 // write empty piece, Otherwise ParaView complains if the whole vtu file is without <Piece></Piece>
243 this->fileStream << "<Piece NumberOfPoints=\"0\" NumberOfCells=\"0\">\n";
244 this->fileStream << "<Cells>\n<DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\"> </DataArray>\n</Cells>\n";
245 this->fileStream << "</Piece>\n";
246 }
247#endif
248
249 // Finalize the output:
250 std::string fname = giveOutputFileName(tStep);
251#ifdef __VTK_MODULE
252
253 #if 0
254 // Code fragment intended for future support of composite elements in binary format
255 // Doesn't as well as I would want it to, interface to VTK is to limited to control this.
256 // * The PVTU-file is written by every process (seems to be impossible to avoid).
257 // * Part files are renamed and time step and everything else is cut off => name collisions
258 vtkSmartPointer< vtkXMLPUnstructuredGridWriter >writer = vtkSmartPointer< vtkXMLPUnstructuredGridWriter >::New();
259 writer->SetTimeStep(tStep->giveNumber() - 1);
260 writer->SetNumberOfPieces(this->emodel->giveNumberOfProcesses() );
261 writer->SetStartPiece(this->emodel->giveRank() );
262 writer->SetEndPiece(this->emodel->giveRank() );
263
264
265 #else
266 vtkSmartPointer< vtkXMLUnstructuredGridWriter >writer = vtkSmartPointer< vtkXMLUnstructuredGridWriter >::New();
267 #endif
268
269 writer->SetFileName(fname.c_str() );
270 //writer->SetInput(this->fileStream); // VTK 4
271 writer->SetInputData(this->fileStream); // VTK 6
272
273 // Optional - set the mode. The default is binary.
274 //writer->SetDataModeToBinary();
275 writer->SetDataModeToAscii();
276 writer->Write();
277#else
278 this->fileStream << "</UnstructuredGrid>\n</VTKFile>";
279 if(this->fileStream){
280 this->fileStream.close();
281 }
282#endif
283
284 // export raw ip values (if required), works only on one domain
285 if ( !this->ipInternalVarsToExport.isEmpty() ) {
287 if ( !emodel->isParallel() && tStep->giveNumber() >= 1 ) { // For non-parallel enabled OOFEM, then we only check for multiple steps.
288 std::ostringstream pvdEntry;
289 std::stringstream subStep;
291 subStep << "." << tStep->giveSubStepNumber();
292 }
293 pvdEntry << "<DataSet timestep=\"" << tStep->giveTargetTime() * this->timeScale << subStep.str() << "\" group=\"\" part=\"\" file=\"" << this->giveOutputBaseFileName(tStep) + ".gp.vtu" << "\"/>";
294 this->gpPvdBuffer.push_back(pvdEntry.str() );
295 this->writeGPVTKCollection();
296 }
297 }
298
299 // Write the *.pvd-file. Currently only contains time step information. It's named "timestep" but is actually the total time.
300 // First we check to see that there are more than 1 time steps, otherwise it is redundant;
301 if ( emodel->isParallel() && emodel->giveRank() == 0 ) {
303 // For this to work, all processes must have an identical output file name.
304 for ( int i = 0; i < this->emodel->giveNumberOfProcesses(); ++i ) {
305 std::ostringstream pvdEntry;
306 std::stringstream subStep;
307 char fext [ 100 ];
308 if ( this->emodel->giveNumberOfProcesses() > 1 ) {
309 sprintf(fext, "_%03d.m%d.%d", i, this->number, tStep->giveNumber() );
310 } else {
311 sprintf(fext, "m%d.%d", this->number, tStep->giveNumber() );
312 }
314 subStep << "." << tStep->giveSubStepNumber();
315 }
316 pvdEntry << "<DataSet timestep=\"" << tStep->giveTargetTime() * this->timeScale << subStep.str() << "\" group=\"\" part=\"" << i << "\" file=\"" << this->emodel->giveOutputBaseFileName() << fext << ".vtu\"/>";
317 this->pvdBuffer.push_back(pvdEntry.str() );
318 }
319
320 this->writeVTKCollection();
321 } else if ( !emodel->isParallel() && tStep->giveNumber() >= 1 ) { // For non-parallel, then we only check for multiple steps.
322 std::ostringstream pvdEntry;
323 std::stringstream subStep;
325 subStep << "." << tStep->giveSubStepNumber();
326 }
327 pvdEntry << "<DataSet timestep=\"" << tStep->giveTargetTime() * this->timeScale << subStep.str() << "\" group=\"\" part=\"\" file=\"" << fname << "\"/>";
328 this->pvdBuffer.push_back(pvdEntry.str() );
329 this->writeVTKCollection();
330 }
331}
332
333
334bool
336{
337 // Writes a VTK piece header + geometry to file.
338 // This could be the whole domain (most common case) or it can be a
339 // (so-called) composite element consisting of several VTK cells (layered structures, XFEM, etc.).
340
341 // Write output: node coords
342 int numNodes = vtkPiece.giveNumberOfNodes();
343 int numEl = vtkPiece.giveNumberOfCells();
344 FloatArray coords;
345
346 if ( !vtkPiece.giveNumberOfCells() ) {
347 return false;
348 }
349
350#ifdef __VTK_MODULE
351 FloatArray vtkCoords(3);
352 for ( int inode = 1; inode <= numNodes; inode++ ) {
353 coords = vtkPiece.giveNodeCoords(inode);
354 vtkCoords.zero();
355 for ( int i = 1; i <= coords.giveSize(); i++ ) {
356 vtkCoords.at(i) = coords.at(i);
357 }
358
359 this->nodes->InsertNextPoint(vtkCoords.at(1), vtkCoords.at(2), vtkCoords.at(3) );
360 this->fileStream->SetPoints(nodes);
361 }
362
363#else
364 this->fileStream << "<Piece NumberOfPoints=\"" << numNodes << "\" NumberOfCells=\"" << numEl << "\">\n";
365 this->fileStream << "<Points>\n <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\"> ";
366
367 for ( int inode = 1; inode <= numNodes; inode++ ) {
368 coords = vtkPiece.giveNodeCoords(inode);
370 for ( int i = 1; i <= coords.giveSize(); i++ ) {
371 this->fileStream << scientific << coords.at(i) << " ";
372 }
373
374 for ( int i = coords.giveSize() + 1; i <= 3; i++ ) {
375 this->fileStream << scientific << 0.0 << " ";
376 }
377 }
378
379 this->fileStream << "</DataArray>\n</Points>\n";
380#endif
381
382
383 // Write output: connectivity, offsets, cell types
384
385 // output the connectivity data
386#ifdef __VTK_MODULE
387 this->fileStream->Allocate(numEl);
388#else
389 this->fileStream << "<Cells>\n";
390 this->fileStream << " <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\"> ";
391#endif
392 IntArray cellNodes;
393 for ( int ielem = 1; ielem <= numEl; ielem++ ) {
394 cellNodes = vtkPiece.giveCellConnectivity(ielem);
395
396#ifdef __VTK_MODULE
397 elemNodeArray->Reset();
398 elemNodeArray->SetNumberOfIds(cellNodes.giveSize() );
399#endif
400 for ( int i = 1; i <= cellNodes.giveSize(); i++ ) {
401#ifdef __VTK_MODULE
402 elemNodeArray->SetId(i - 1, cellNodes.at(i) - 1);
403#else
404 this->fileStream << cellNodes.at(i) - 1 << " ";
405#endif
406 }
407
408#ifdef __VTK_MODULE
409 this->fileStream->InsertNextCell(vtkPiece.giveCellType(ielem), elemNodeArray);
410#else
411 this->fileStream << " ";
412#endif
413 }
414
415#ifndef __VTK_MODULE
416 this->fileStream << "</DataArray>\n";
417
418 // output the offsets (index of individual element data in connectivity array)
419 this->fileStream << " <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\"> ";
420
421 for ( int ielem = 1; ielem <= numEl; ielem++ ) {
422 this->fileStream << vtkPiece.giveCellOffset(ielem) << " ";
423 }
424
425 this->fileStream << "</DataArray>\n";
426
427
428 // output cell (element) types
429 this->fileStream << " <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\"> ";
430 for ( int ielem = 1; ielem <= numEl; ielem++ ) {
431 this->fileStream << vtkPiece.giveCellType(ielem) << " ";
432 }
433
434 this->fileStream << "</DataArray>\n";
435 this->fileStream << "</Cells>\n";
436#endif
437 return true;
438
439}
440
441bool
443{
444 if ( !vtkPiece.giveNumberOfCells() ) {
445 return false;
446 }
447
448#ifndef __VTK_MODULE
449 this->fileStream << "</Piece>\n";
450#endif
451 return true;
452}
453
454
455
456bool
458{
459 // Write a VTK piece variables to file.
460 // This could be the whole domain (most common case) or it can be a
461 // (so-called) composite element consisting of several VTK cells (layered structures, XFEM, etc.).
462
463 if ( !vtkPiece.giveNumberOfCells() ) {
464 return false;
465 }
466
467
468#ifndef __VTK_MODULE
470 std::string pointHeader, cellHeader;
471 this->giveDataHeaders(pointHeader, cellHeader);
472
473 this->fileStream << pointHeader.c_str();
474#endif
475
476 this->writePrimaryVars(vtkPiece); // Primary field
477 this->writeIntVars(vtkPiece); // Internal State Type variables smoothed to the nodes
478 this->writeExternalForces(vtkPiece); // External forces
479 if (this->exportSetMembershipFlag) {
480 this->writeVertexSetMembership(vtkPiece); // Set membership (region number) of the nodes
481 }
482
483 //if ( emodel->giveDomain(1)->hasXfemManager() ) {
484 // this->writeXFEMVars(vtkPiece); // XFEM State Type variables associated with XFEM structure
485 //}
486
487#ifndef __VTK_MODULE
488 this->fileStream << "</PointData>\n";
489 this->fileStream << cellHeader.c_str();
490#endif
491 this->writeCellVars(vtkPiece); // Single cell variables ( if given in the integration points then an average will be exported)
492 if (this->exportSetMembershipFlag) {
493 this->writeCellSetMembership(vtkPiece); // Set membership (region number) of the nodes
494 }
495#ifndef __VTK_MODULE
496 this->fileStream << "</CellData>\n";
497#endif
498 return true;
499}
500
501#ifndef __VTK_MODULE
502void
503VTKXMLExportModule::giveDataHeaders(std::string &pointHeader, std::string &cellHeader)
504{
505 std::string scalars, vectors, tensors;
506
507 for ( int i = 1; i <= primaryVarsToExport.giveSize(); i++ ) {
509 if ( type == DisplacementVector || type == EigenVector || type == VelocityVector || type == DirectorField || type == MacroSlipVector || type == ResidualForce ) {
510 vectors += __UnknownTypeToString(type);
511 vectors.append(" ");
512 } else if ( type == FluxVector || type == PressureVector || type == Temperature || type == Humidity || type == DeplanationFunction || type == Concentration) {
513 scalars += __UnknownTypeToString(type);
514 scalars.append(" ");
515 } else {
516 OOFEM_ERROR("unsupported UnknownType %s", __UnknownTypeToString(type) );
517 }
518 }
519
520 for ( int i = 1; i <= internalVarsToExport.giveSize(); i++ ) {
523
524 if ( vtype == ISVT_SCALAR ) {
525 scalars += __InternalStateTypeToString(isttype);
526 scalars.append(" ");
527 } else if ( vtype == ISVT_VECTOR ) {
528 vectors += __InternalStateTypeToString(isttype);
529 vectors.append(" ");
530 } else if ( vtype == ISVT_TENSOR_S3 || vtype == ISVT_TENSOR_S3E || vtype == ISVT_TENSOR_G ) {
531 tensors += __InternalStateTypeToString(isttype);
532 tensors.append(" ");
533 } else {
534 OOFEM_ERROR("unsupported variable type %s\n", __InternalStateTypeToString(isttype) );
535 }
536 }
537
538 for ( int i = 1; i <= externalForcesToExport.giveSize(); i++ ) {
540 if ( type == DisplacementVector || type == VelocityVector || type == DirectorField ) {
541 vectors += std::string("Load") + __UnknownTypeToString(type);
542 vectors.append(" ");
543 } else if ( type == FluxVector || type == PressureVector || type == Temperature || type == Humidity ) {
544 scalars += std::string("Load") + __UnknownTypeToString(type);
545 scalars.append(" ");
546 } else {
547 OOFEM_ERROR("unsupported UnknownType %s", __UnknownTypeToString(type) );
548 }
549 }
550
551 if (this->exportSetMembershipFlag) {
552 scalars.append("VertexSetMembership ");
553 }
554 // print header
555 pointHeader = "<PointData Scalars=\"" + scalars + "\" "
556 + "Vectors=\"" + vectors + "\" "
557 + "Tensors=\"" + tensors + "\" >\n";
558
559
560 scalars.clear();
561 vectors.clear();
562 tensors.clear();
563 // prepare header
564 for ( int i = 1; i <= this->cellVarsToExport.giveSize(); i++ ) {
567
568 if ( vtype == ISVT_SCALAR ) {
569 scalars += __InternalStateTypeToString(isttype);
570 scalars.append(" ");
571 } else if ( vtype == ISVT_VECTOR ) {
572 vectors += __InternalStateTypeToString(isttype);
573 vectors.append(" ");
574 } else if ( vtype == ISVT_TENSOR_S3 || vtype == ISVT_TENSOR_S3E || vtype == ISVT_TENSOR_G ) {
575 tensors += __InternalStateTypeToString(isttype);
576 tensors.append(" ");
577 } else {
578 OOFEM_WARNING("unsupported variable type %s\n", __InternalStateTypeToString(isttype) );
579 }
580 }
581 if (this->exportSetMembershipFlag) {
582 vectors.append("CellSetMembership ");
583 }
584
585 // print header
586 cellHeader = "<CellData Scalars=\"" + scalars + "\" "
587 + "Vectors=\"" + vectors + "\" "
588 + "Tensors=\"" + tensors + "\" >\n";
589}
590#endif
591
592
593void
595{
596 int n = internalVarsToExport.giveSize();
597 for ( int i = 1; i <= n; i++ ) {
599 int ncomponents;
600
601 const char *name = __InternalStateTypeToString(type);
602 ( void ) name;//silence warning
603 int numNodes = vtkPiece.giveNumberOfNodes();
604 FloatArray valueArray;
605 valueArray = vtkPiece.giveInternalVarInNode(type, 1);
606 ncomponents = valueArray.giveSize();
607 ( void ) ncomponents;//silence warning
608
609 // Header
610#ifdef __VTK_MODULE
611 vtkSmartPointer< vtkDoubleArray >varArray = vtkSmartPointer< vtkDoubleArray >::New();
612 varArray->SetName(name);
613 varArray->SetNumberOfComponents(ncomponents);
614 varArray->SetNumberOfTuples(numNodes);
615
616 for ( int inode = 1; inode <= numNodes; inode++ ) {
617 valueArray = vtkPiece.giveInternalVarInNode(type, inode);
618 for ( int i = 1; i <= ncomponents; ++i ) {
619 varArray->SetComponent(inode - 1, i - 1, valueArray.at(i) );
620 }
621 }
622
623 this->writeVTKPointData(name, varArray);
624
625#else
626
627 this->fileStream << " <DataArray type=\"Float64\" Name=\"" << name << "\" NumberOfComponents=\"" << ncomponents << "\" format=\"ascii\"> ";
628 for ( int inode = 1; inode <= numNodes; inode++ ) {
629 valueArray = vtkPiece.giveInternalVarInNode(type, inode);
630 this->writeVTKPointData(valueArray);
631 }
632
633#endif
634 // Footer
635#ifndef __VTK_MODULE
636 this->fileStream << "</DataArray>\n";
637#endif
638
639 } //end of for
640}
641
642
643
644//----------------------------------------------------
645// Misc. functions
646//----------------------------------------------------
647#ifdef __VTK_MODULE
648void
649VTKXMLExportModule::writeVTKPointData(const char *name, vtkSmartPointer< vtkDoubleArray >varArray)
650{
651 // Write the data to file
652 int ncomponents = varArray->GetNumberOfComponents();
653 switch ( ncomponents ) {
654 case 1:
655 this->fileStream->GetPointData()->SetActiveScalars(name);
656 this->fileStream->GetPointData()->SetScalars(varArray);
657 break;
658 case 3:
659 this->fileStream->GetPointData()->SetActiveVectors(name);
660 this->fileStream->GetPointData()->SetVectors(varArray);
661 break;
662 case 9:
663 this->fileStream->GetPointData()->SetActiveTensors(name);
664 this->fileStream->GetPointData()->SetTensors(varArray);
665 break;
666 }
667}
668#else
669void
671{
672 // Write the data to file
673 for ( int i = 1; i <= valueArray.giveSize(); i++ ) {
674 this->fileStream << scientific << valueArray.at(i) << " ";
675 }
676}
677#endif
678
679
680#ifdef __VTK_MODULE
681void
682VTKXMLExportModule::writeVTKCellData(const char *name, vtkSmartPointer< vtkDoubleArray >varArray)
683{
684 // Write the data to file
685 int ncomponents = varArray->GetNumberOfComponents();
686 switch ( ncomponents ) {
687 case 1:
688 this->fileStream->GetCellData()->SetActiveScalars(name);
689 this->fileStream->GetCellData()->SetScalars(varArray);
690 break;
691 case 3:
692 this->fileStream->GetCellData()->SetActiveVectors(name);
693 this->fileStream->GetCellData()->SetVectors(varArray);
694 break;
695 case 9:
696 this->fileStream->GetCellData()->SetActiveTensors(name);
697 this->fileStream->GetCellData()->SetTensors(varArray);
698 break;
699 }
700}
701
702#else
703
704void
706{
707 // Write the data to file ///@todo exact copy of writeVTKPointData so remove
708 for ( int i = 1; i <= valueArray.giveSize(); i++ ) {
709 this->fileStream << valueArray.at(i) << " ";
710 }
711}
712#endif
713
714
715void
717{
718 for ( int i = 1; i <= primaryVarsToExport.giveSize(); i++ ) {
721 int ncomponents = giveInternalStateTypeSize(valType);
722 ( void ) ncomponents; //silence the warning
723 int numNodes = vtkPiece.giveNumberOfNodes();
724 const char *name = __UnknownTypeToString(type);
725 ( void ) name; //silence the warning
726
727 // Header
728#ifdef __VTK_MODULE
729 vtkSmartPointer< vtkDoubleArray >varArray = vtkSmartPointer< vtkDoubleArray >::New();
730 varArray->SetName(name);
731 varArray->SetNumberOfComponents(ncomponents);
732 varArray->SetNumberOfTuples(numNodes);
733
734 for ( int inode = 1; inode <= numNodes; inode++ ) {
735 FloatArray &valueArray = vtkPiece.givePrimaryVarInNode(type, inode);
736 for ( int j = 1; j <= ncomponents; ++j ) {
737 varArray->SetComponent(inode - 1, j - 1, valueArray.at(j) );
738 }
739 }
740
741 this->writeVTKPointData(name, varArray);
742
743#else
744 this->fileStream << " <DataArray type=\"Float64\" Name=\"" << name << "\" NumberOfComponents=\"" << ncomponents << "\" format=\"ascii\"> ";
745 for ( int inode = 1; inode <= numNodes; inode++ ) {
746 FloatArray &valueArray = vtkPiece.givePrimaryVarInNode(type, inode);
747 this->writeVTKPointData(valueArray);
748 }
749 this->fileStream << "</DataArray>\n";
750
751#endif
752 }
753}
754
755
756void
758{
759 for ( int i = 1; i <= externalForcesToExport.giveSize(); i++ ) {
762 int ncomponents = giveInternalStateTypeSize(valType);
763 ( void ) ncomponents; //silence the warning
764 int numNodes = vtkPiece.giveNumberOfNodes();
765 std::string name = std::string("Load") + __UnknownTypeToString(type);
766
767 // Header
768#ifdef __VTK_MODULE
769 vtkSmartPointer< vtkDoubleArray >varArray = vtkSmartPointer< vtkDoubleArray >::New();
770 varArray->SetName(name.c_str() );
771 varArray->SetNumberOfComponents(ncomponents);
772 varArray->SetNumberOfTuples(numNodes);
773
774 for ( int inode = 1; inode <= numNodes; inode++ ) {
775 FloatArray &valueArray = vtkPiece.giveLoadInNode(i, inode);
776 for ( int j = 1; j <= ncomponents; ++j ) {
777 varArray->SetComponent(inode - 1, j - 1, valueArray.at(j) );
778 }
779 }
780
781 this->writeVTKPointData(name.c_str(), varArray);
782
783#else
784 this->fileStream << " <DataArray type=\"Float64\" Name=\"" << name << "\" NumberOfComponents=\"" << ncomponents << "\" format=\"ascii\"> ";
785 for ( int inode = 1; inode <= numNodes; inode++ ) {
786 FloatArray &valueArray = vtkPiece.giveLoadInNode(i, inode);
787 this->writeVTKPointData(valueArray);
788 }
789 this->fileStream << "</DataArray>\n";
790#endif
791 }
792}
793
794void
796{
797 // Write the set membership to file
798 int numSetGroups = vtkPiece.giveNumberOfSetGroups();
799 this->fileStream << "<DataArray type=\"UInt8\" Name=\"" << "VertexSetMembership" << "\" NumberOfComponents=\"" << numSetGroups << "\" format=\"ascii\"> ";
800 for (int inode = 1; inode <= vtkPiece.giveNumberOfNodes(); inode++ ) {
801 const std::vector<uint8_t>& setMembership = vtkPiece.getVertexSetMembershipGroup(inode);
802 for ( auto val : setMembership ) {
803 this->fileStream << static_cast<int>(val) << " ";
804 }
805 }
806 this->fileStream << "</DataArray>\n";
807}
808
809
810void
812{
813 // Write the set membership to file
814 int numSetGroups = vtkPiece.giveNumberOfSetGroups();
815
816 this->fileStream << "<DataArray type=\"UInt8\" Name=\"" << "CellSetMembership" << "\" NumberOfComponents=\"" << numSetGroups << "\" format=\"ascii\"> ";
817 for (int icell = 1; icell <= vtkPiece.giveNumberOfCells(); icell++ ) {
818 const std::vector<uint8_t>& setMembership = vtkPiece.getCellSetMembershipGroup(icell);
819 for ( auto val : setMembership ) {
820 this->fileStream << static_cast<int>(val) << " ";
821 }
822 }
823 this->fileStream << "</DataArray>\n";
824}
825
826
827
828void
830{
831 FloatArray valueArray;
832 int numCells = vtkPiece.giveNumberOfCells();
833 for ( int i = 1; i <= cellVarsToExport.giveSize(); i++ ) {
836 int ncomponents = giveInternalStateTypeSize(valType);
837 const char *name = __InternalStateTypeToString(type);
838 ( void ) name; //silence the warning
839
840 // Header
841#ifdef __VTK_MODULE
842 vtkSmartPointer< vtkDoubleArray >cellVarsArray = vtkSmartPointer< vtkDoubleArray >::New();
843 cellVarsArray->SetName(name);
844 cellVarsArray->SetNumberOfComponents(ncomponents);
845 cellVarsArray->SetNumberOfTuples(numCells);
846 for ( int ielem = 1; ielem <= numCells; ielem++ ) {
847 valueArray = vtkPiece.giveCellVar(i, ielem);
848 for ( int i = 1; i <= ncomponents; ++i ) {
849 cellVarsArray->SetComponent(ielem - 1, i - 1, valueArray.at(i) );
850 }
851 }
852
853 this->writeVTKCellData(name, cellVarsArray);
854
855#else
856 this->fileStream << " <DataArray type=\"Float64\" Name=\"" << name << "\" NumberOfComponents=\"" << ncomponents << "\" format=\"ascii\"> ";
857 valueArray.resize(ncomponents);
858 for ( int ielem = 1; ielem <= numCells; ielem++ ) {
859 valueArray = vtkPiece.giveCellVar(type, ielem);
860 this->writeVTKCellData(valueArray);
861 }
862 this->fileStream << "</DataArray>\n";
863#endif
864
865 }//end of for
866}
867
868void
870{
871 struct tm *current;
872 time_t now;
873 time(& now);
874 current = localtime(& now);
875 char buff [ 1024 ];
876 std::string fname;
877
879 fname = this->emodel->giveOutputBaseFileName() + ".m" + std::to_string(this->number) + ".substep.pvd";
880 } else {
881 fname = this->emodel->giveOutputBaseFileName() + ".m" + std::to_string(this->number) + ".pvd";
882 }
883
884 std::ofstream streamP;
885 if ( pythonExport ) {
886 streamP = std::ofstream(NULL_DEVICE);//do not write anything
887 } else {
888 streamP = std::ofstream(fname.c_str() );
889 }
890
891 if ( !streamP.good() ) {
892 OOFEM_ERROR("failed to open file %s", fname.c_str() );
893 }
894
895 sprintf(buff, "<!-- Computation started %d-%02d-%02d at %02d:%02d:%02d -->\n", current->tm_year + 1900, current->tm_mon + 1, current->tm_mday, current->tm_hour, current->tm_min, current->tm_sec);
896 // outfile << buff;
897
898 streamP << "<?xml version=\"1.0\"?>\n<VTKFile type=\"Collection\" version=\"0.1\">\n<Collection>\n";
899 for ( auto pvd : this->pvdBuffer ) {
900 streamP << pvd << "\n";
901 }
902
903 streamP << "</Collection>\n</VTKFile>";
904
905 if (streamP){
906 streamP.close();
907 }
908}
909
910void
912{
913 struct tm *current;
914 time_t now;
915 time(& now);
916 current = localtime(& now);
917 char buff [ 1024 ];
918 std::string fname;
919
921 fname = this->emodel->giveOutputBaseFileName() + ".m" + std::to_string(this->number) + ".substep.gp.pvd";
922 } else {
923 fname = this->emodel->giveOutputBaseFileName() + ".m" + std::to_string(this->number) + ".gp.pvd";
924 }
925
926 std::ofstream outfile(fname.c_str() );
927
928 sprintf(buff, "<!-- Computation started %d-%02d-%02d at %02d:%02d:%02d -->\n", current->tm_year + 1900, current->tm_mon + 1, current->tm_mday, current->tm_hour, current->tm_min, current->tm_sec);
929 // outfile << buff;
930
931 outfile << "<?xml version=\"1.0\"?>\n<VTKFile type=\"Collection\" version=\"0.1\">\n<Collection>\n";
932 for ( auto pvd : this->gpPvdBuffer ) {
933 outfile << pvd << "\n";
934 }
935
936 outfile << "</Collection>\n</VTKFile>";
937
938 if (outfile){
939 outfile.close();
940 }
941}
942
943// Export of composite elements
944
946{
949 if ( interface ) {
950 interface->giveCompositeExportData(vtkPiece, this->primaryVarsToExport, this->internalVarsToExport, this->cellVarsToExport, tStep);
951
952 //this->writeVTKPiece(this->defaultVTKPiece, tStep);
953 }
954}
955
956void VTKXMLExportModule::exportCompositeElement(std::vector< ExportRegion > &vtkPieces, Element *el, TimeStep *tStep)
957{
960 if ( interface ) {
961 interface->giveCompositeExportData(vtkPieces, this->primaryVarsToExport, this->internalVarsToExport, this->cellVarsToExport, tStep);
962
963 //this->writeVTKPiece(this->defaultVTKPiece, tStep);
964 }
965}
966
969{
970 Domain *d = emodel->giveDomain(1);
971
972 if ( !this->smoother ) {
973 this->smoother = classFactory.createNodalRecoveryModel(this->stype, d);
974 }
975
976 return this->smoother.get();
977}
978
979
982{
983 Domain *d = emodel->giveDomain(1);
984
985 if ( !this->primVarSmoother ) {
986 this->primVarSmoother = classFactory.createNodalRecoveryModel(NodalRecoveryModel::NRM_NodalAveraging, d);
987 }
988
989 return this->primVarSmoother.get();
990}
991
992
993void
995{
996 Domain *d = emodel->giveDomain(1);
997 int nc = 0;
998 ( void ) nc; //silence the warning
999 FloatArray gc, value;
1000 std::ofstream stream;
1001 InternalStateType isttype;
1003 std::string scalars, vectors, tensors;
1004
1005 // output nodes Region By Region
1006 int nregions = this->giveNumberOfRegions(); // aka sets
1007 // open output stream
1008 std::string outputFileName = this->giveOutputBaseFileName(tStep) + ".gp.vtu";
1009 std::ofstream streamG;
1010 if ( pythonExport ) {
1011 streamG = std::ofstream(NULL_DEVICE);
1012 } else {
1013 streamG = std::ofstream(outputFileName);
1014 }
1015
1016 if ( !streamG.good() ) {
1017 OOFEM_ERROR("failed to open file %s", outputFileName.c_str() );
1018 }
1019
1020 streamG << "<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">\n";
1021 streamG << "<UnstructuredGrid>\n";
1022
1023 /* loop over regions */
1024 for ( int ireg = 1; ireg <= nregions; ireg++ ) {
1025 const IntArray &elements = this->giveRegionSet(ireg)->giveElementList();
1026 int nip = 0;
1027 for ( int i = 1; i <= elements.giveSize(); i++ ) {
1029 }
1030
1031 //Create one cell per each GP
1032 streamG << "<Piece NumberOfPoints=\"" << nip << "\" NumberOfCells=\"" << nip << "\">\n";
1033 streamG << "<Points>\n <DataArray type=\"Float64\" NumberOfComponents=\"3\" format=\"ascii\"> ";
1034 for ( int i = 1; i <= elements.giveSize(); i++ ) {
1035 int ielem = elements.at(i);
1036
1037 for ( GaussPoint *gp : * d->giveElement(ielem)->giveDefaultIntegrationRulePtr() ) {
1038 d->giveElement(ielem)->computeGlobalCoordinates(gc, gp->giveNaturalCoordinates() );
1039 for ( double c : gc ) {
1040 ( void ) c; //silence the warning
1041 streamG << scientific << c << " ";
1042 }
1043
1044 for ( int k = gc.giveSize() + 1; k <= 3; k++ ) {
1045 streamG << scientific << 0.0 << " ";
1046 }
1047 }
1048 }
1049
1050 streamG << " </DataArray>\n";
1051 streamG << "</Points>\n";
1052 streamG << "<Cells>\n";
1053 streamG << " <DataArray type=\"Int32\" Name=\"connectivity\" format=\"ascii\">";
1054 for ( int j = 0; j < nip; j++ ) {
1055 streamG << j << " ";
1056 }
1057
1058 streamG << " </DataArray>\n";
1059 streamG << " <DataArray type=\"Int32\" Name=\"offsets\" format=\"ascii\">";
1060 for ( int j = 1; j <= nip; j++ ) {
1061 streamG << j << " ";
1062 }
1063
1064 streamG << " </DataArray>\n";
1065 streamG << " <DataArray type=\"UInt8\" Name=\"types\" format=\"ascii\">";
1066 for ( int j = 1; j <= nip; j++ ) {
1067 streamG << "1 ";
1068 }
1069
1070 streamG << " </DataArray>\n";
1071 streamG << "</Cells>\n";
1072 // prepare the data header
1073 for ( int vi = 1; vi <= valIDs.giveSize(); vi++ ) {
1074 isttype = ( InternalStateType ) valIDs.at(vi);
1075 vtype = giveInternalStateValueType(isttype);
1076
1077 if ( vtype == ISVT_SCALAR ) {
1078 scalars += __InternalStateTypeToString(isttype);
1079 scalars.append(" ");
1080 } else if ( vtype == ISVT_VECTOR ) {
1081 vectors += __InternalStateTypeToString(isttype);
1082 vectors.append(" ");
1083 } else if ( vtype == ISVT_TENSOR_S3 || vtype == ISVT_TENSOR_S3E || vtype == ISVT_TENSOR_G ) {
1084 tensors += __InternalStateTypeToString(isttype);
1085 tensors.append(" ");
1086 } else {
1087 OOFEM_WARNING("unsupported variable type %s\n", __InternalStateTypeToString(isttype) );
1088 }
1089 }
1090
1091 // print collected data summary in header
1092 streamG << "<PointData Scalars=\"" << scalars.c_str() << "\" Vectors=\"" << vectors.c_str() << "\" Tensors=\"" << tensors.c_str() << "\" >\n";
1093 scalars.clear();
1094 vectors.clear();
1095 tensors.clear();
1096
1097 // export actual data, loop over individual IDs to export
1098 for ( int vi = 1; vi <= valIDs.giveSize(); vi++ ) {
1099 isttype = ( InternalStateType ) valIDs.at(vi);
1100 vtype = giveInternalStateValueType(isttype);
1101 if ( vtype == ISVT_SCALAR ) {
1102 nc = 1;
1103 } else if ( vtype == ISVT_VECTOR ) {
1104 nc = 3;
1105 if ( isttype == IST_BeamForceMomentTensor ) { //AS: to make the hack work
1106 nc = 6;
1107 }
1108 } else if ( vtype == ISVT_TENSOR_S3 || vtype == ISVT_TENSOR_S3E || vtype == ISVT_TENSOR_G ) {
1109 nc = 9;
1110 } else {
1111 OOFEM_WARNING("unsupported variable type %s\n", __InternalStateTypeToString(isttype) );
1112 }
1113
1114 streamG << " <DataArray type=\"Float64\" Name=\"" << __InternalStateTypeToString(isttype) << "\" NumberOfComponents=\"" << nc << "\" format=\"ascii\">";
1115 for ( int i = 1; i <= elements.giveSize(); i++ ) {
1116 int ielem = elements.at(i);
1117
1118 // loop over default IRule gps
1119 for ( GaussPoint *gp : * d->giveElement(ielem)->giveDefaultIntegrationRulePtr() ) {
1120 d->giveElement(ielem)->giveIPValue(value, gp, isttype, tStep);
1121
1122 if ( vtype == ISVT_VECTOR ) {
1123 // bp: hack for BeamForceMomentTensor, which should be splitted into force and momentum vectors
1124 if ( isttype == IST_BeamForceMomentTensor ) {
1125 value.resizeWithValues(6);
1126 } else {
1127 value.resizeWithValues(3);
1128 }
1129 } else if ( vtype == ISVT_TENSOR_S3 || vtype == ISVT_TENSOR_S3E || vtype == ISVT_TENSOR_G ) {
1130 FloatArray help = value;
1131 this->makeFullTensorForm(value, help, vtype);
1132 }
1133
1134 for ( double v : value ) {
1135 ( void ) v; //silence the warning
1136 streamG << scientific << v << " ";
1137 }
1138 } // end loop over IPs
1139 } // end loop over elements
1140
1141 streamG << " </DataArray>\n";
1142 } // end loop over values to be exported
1143 streamG << "</PointData>\n</Piece>\n";
1144 } // end loop over regions
1145
1146 streamG << "</UnstructuredGrid>\n";
1147 streamG << "</VTKFile>\n";
1148 if(streamG){
1149 streamG.close();
1150 }
1151}
1152
1153
1154} // end namespace oofem
#define REGISTER_ExportModule(class)
Element * giveElement(int n)
Definition domain.C:165
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
Definition element.C:1225
elementParallelMode giveParallelMode() const
Definition element.h:1139
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Definition element.h:886
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Definition element.C:1298
double timeScale
Scaling time in output, e.g. conversion from seconds to hours.
std::string giveOutputBaseFileName(TimeStep *tStep)
int number
Component number.
virtual void initializeFrom(InputRecord &ir)
Initializes receiver according to object description stored in input record.
bool pythonExport
Output is carried out as a python list instead of writing files.
Set * giveRegionSet(int i)
Returns element set.
int giveNumberOfRegions()
Returns number of regions (aka regionSets).
EngngModel * emodel
Problem pointer.
bool testTimeStepOutput(TimeStep *tStep)
Stores all neccessary data (of a region) in a VTKPiece so it can be exported later.
FloatArray & givePrimaryVarInNode(UnknownType type, int nodeNum)
FloatArray & giveInternalVarInNode(InternalStateType type, int nodeNum)
FloatArray & giveLoadInNode(int varNum, int nodeNum)
FloatArray & giveCellVar(InternalStateType type, int cellNum)
const std::vector< setMembershipGroupType > & getCellSetMembershipGroup(int icell)
FloatArray & giveNodeCoords(int nodeNum)
const std::vector< setMembershipGroupType > & getVertexSetMembershipGroup(int inode)
IntArray & giveCellConnectivity(int cellNum)
int giveCellType(int cellNum)
int giveCellOffset(int cellNum)
virtual Interface * giveInterface(InterfaceType t)
Definition femcmpnn.h:181
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
Index giveSize() const
Returns the size of receiver.
Definition floatarray.h:261
void resizeWithValues(Index s, std::size_t allocChunk=0)
Definition floatarray.C:103
void zero()
Zeroes all coefficients of receiver.
Definition floatarray.C:683
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
int & at(std::size_t i)
Definition intarray.h:104
int giveSize() const
Definition intarray.h:211
int giveNumberOfIntegrationPoints() const
double giveTargetTime()
Returns target time.
Definition timestep.h:164
int giveNumber()
Returns receiver's number.
Definition timestep.h:144
int giveSubStepNumber()
Returns receiver's substep number.
Definition timestep.h:155
void exportSetMembership(ExportRegion &piece, Set &region, TimeStep *tStep)
bool isElementComposite(Element *elem)
void exportCellVars(ExportRegion &piece, Set &region, IntArray &cellVarsToExport, TimeStep *tStep)
Exports cell variables (typically internal variables).
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.
virtual void exportIntVars(ExportRegion &piece, Set &region, IntArray &internalVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
void exportExternalForces(ExportRegion &piece, int region, TimeStep *tStep)
virtual void setupVTKPiece(ExportRegion &vtkPiece, TimeStep *tStep, Set &region)
virtual void exportPrimaryVars(ExportRegion &piece, Set &region, IntArray &primaryVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
virtual ~VTKXMLExportModule()
Destructor.
std::list< std::string > pvdBuffer
Buffer for earlier time steps exported to *.pvd file.
NodalRecoveryModel::NodalRecoveryModelType stype
Smoother type.
virtual void giveDataHeaders(std::string &pointHeader, std::string &cellHeader)
IntArray internalVarsToExport
List of InternalStateType values, identifying the selected vars for export.
void initializeFrom(InputRecord &ir) override
Initializes receiver according to object description stored in input record.
std::unique_ptr< NodalRecoveryModel > smoother
Smoother.
void writeIntVars(ExportRegion &vtkPiece)
void exportIntVarsInGpAs(IntArray valIDs, TimeStep *tStep)
void writeExternalForces(ExportRegion &vtkPiece)
IntArray externalForcesToExport
List of primary unknowns to export.
IntArray primaryVarsToExport
List of primary unknowns to export.
IntArray ipInternalVarsToExport
List of internal variables to export directly in Integration Points (no smoothing to nodes).
std::string giveOutputFileName(TimeStep *tStep)
Returns the filename for the given time step.
NodalRecoveryModel * givePrimVarSmoother()
Returns the smoother for primary variables (nodal averaging).
std::list< std::string > gpPvdBuffer
Buffer for earlier time steps with gauss points exported to *.gp.pvd file.
std::ofstream giveOutputStream(TimeStep *tStep)
Returns the output stream for given solution step.
void writeVertexSetMembership(ExportRegion &vtkPiece)
void exportCompositeElement(ExportRegion &vtkPiece, Element *el, TimeStep *tStep)
VTKXMLExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager. By default all components are selected.
void writeVTKPointData(FloatArray &valueArray)
IntArray cellVarsToExport
List of cell data to export.
bool writeVTKPieceVariables(ExportRegion &vtkPiece, TimeStep *tStep)
void writeVTKCellData(FloatArray &valueArray)
void writeCellSetMembership(ExportRegion &vtkPiece)
void doOutput(TimeStep *tStep, bool forcedOutput=false) override
bool exportSetMembershipFlag
Flag whether to export setMembership (byte encoded array).
void writePrimaryVars(ExportRegion &vtkPiece)
std::vector< ExportRegion > defaultVTKPieces
void writeGPVTKCollection()
Writes a VTK collection file for Gauss points.
bool writeVTKPieceProlog(ExportRegion &vtkPiece, TimeStep *tStep)
NodalRecoveryModel * giveSmoother()
Returns the internal smoother.
bool writeVTKPieceEpilog(ExportRegion &vtkPiece, TimeStep *tStep)
void writeCellVars(ExportRegion &vtkPiece)
std::unique_ptr< NodalRecoveryModel > primVarSmoother
Smoother for primary variables.
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
const char * __InternalStateTypeToString(InternalStateType _value)
Definition cltypes.C:309
@ Element_local
Element is local, there are no contributions from other domains to this element.
Definition element.h:88
int giveInternalStateTypeSize(InternalStateValueType valType)
Definition cltypes.C:229
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_SCALAR
Scalar.
@ ISVT_TENSOR_S3
Symmetric 3x3 tensor.
@ ISVT_VECTOR
Vector.
@ ISVT_TENSOR_G
General tensor.
const char * __UnknownTypeToString(UnknownType _value)
Definition cltypes.C:313
ClassFactory & classFactory
@ VTKXMLExportModuleElementInterfaceType
InternalStateValueType giveInternalStateValueType(InternalStateType type)
Definition cltypes.C:75
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define NULL_DEVICE
#define _IFT_VTKXMLExportModule_ipvars
#define _IFT_VTKXMLExportModule_vars
#define _IFT_VTKXMLExportModule_externalForces
#define _IFT_VTKXMLExportModule_primvars
#define _IFT_VTKXMLExportModule_cellvars
#define _IFT_VTKXMLExportModule_stype
#define _IFT_VTKXMLExportModule_exportSetMembershipFlag

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011