Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Nektar::FieldUtils::OutputVtk Class Referencefinal

Converter from fld to vtk. More...

#include <OutputVtk.h>

Inheritance diagram for Nektar::FieldUtils::OutputVtk:
[legend]

Public Member Functions

 OutputVtk (FieldSharedPtr f)
 
 ~OutputVtk () final=default
 
- Public Member Functions inherited from Nektar::FieldUtils::OutputVtkBase
 OutputVtkBase (FieldSharedPtr f)
 
 ~OutputVtkBase () override
 
- Public Member Functions inherited from Nektar::FieldUtils::OutputFileBase
 OutputFileBase (FieldSharedPtr f)
 
 ~OutputFileBase () override
 
- Public Member Functions inherited from Nektar::FieldUtils::OutputModule
 OutputModule (FieldSharedPtr p_f)
 
FIELD_UTILS_EXPORT void OpenStream ()
 Open a file for output. More...
 
- Public Member Functions inherited from Nektar::FieldUtils::Module
FIELD_UTILS_EXPORT Module (FieldSharedPtr p_f)
 
virtual ~Module ()=default
 
void Process (po::variables_map &vm)
 
std::string GetModuleName ()
 
std::string GetModuleDescription ()
 
const ConfigOptionGetConfigOption (const std::string &key) const
 
ModulePriority GetModulePriority ()
 
std::vector< ModuleKeyGetModulePrerequisites ()
 
FIELD_UTILS_EXPORT void RegisterConfig (std::string key, std::string value="")
 Register a configuration option with a module. More...
 
FIELD_UTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
FIELD_UTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
FIELD_UTILS_EXPORT void AddFile (std::string fileType, std::string fileName)
 
FIELD_UTILS_EXPORT void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 

Static Public Member Functions

static std::shared_ptr< Modulecreate (const FieldSharedPtr &f)
 Creates an instance of this class. More...
 
- Static Public Member Functions inherited from Nektar::FieldUtils::OutputVtkBase
static std::shared_ptr< Modulecreate (FieldSharedPtr f)
 Creates an instance of this class. More...
 

Static Public Attributes

static ModuleKey m_className
 
- Static Public Attributes inherited from Nektar::FieldUtils::OutputVtkBase
static ModuleKey m_className
 

Protected Member Functions

std::string v_GetModuleName () final
 
void v_OutputFromPts (po::variables_map &vm) final
 Write from pts to output file. More...
 
void v_OutputFromExp (po::variables_map &vm) final
 Write from m_exp to output file. More...
 
void v_OutputFromData (po::variables_map &vm) final
 Write from data to output file. More...
 
- Protected Member Functions inherited from Nektar::FieldUtils::OutputVtkBase
std::string v_GetModuleName () override
 
void v_OutputFromPts (po::variables_map &vm) override
 Write from pts to output file. More...
 
void v_OutputFromExp (po::variables_map &vm) override
 Write from m_exp to output file. More...
 
void v_OutputFromData (po::variables_map &vm) override
 Write from data to output file. More...
 
fs::path v_GetPath (std::string &filename, po::variables_map &vm) override
 
fs::path v_GetFullOutName (std::string &filename, po::variables_map &vm) override
 
std::string PrepareOutput (po::variables_map &vm)
 
- Protected Member Functions inherited from Nektar::FieldUtils::OutputFileBase
void v_Process (po::variables_map &vm) override
 Write fld to output file. More...
 
std::string v_GetModuleName () override
 
std::string v_GetModuleDescription () override
 
ModulePriority v_GetModulePriority () override
 
virtual void v_OutputFromPts (po::variables_map &vm)=0
 Write from pts to output file. More...
 
virtual void v_OutputFromExp (po::variables_map &vm)=0
 Write from m_exp to output file. More...
 
virtual void v_OutputFromData (po::variables_map &vm)=0
 Write from data to output file. More...
 
virtual fs::path v_GetPath (std::string &filename, po::variables_map &vm)
 
fs::path GetPath (std::string &filename, po::variables_map &vm)
 
virtual fs::path v_GetFullOutName (std::string &filename, po::variables_map &vm)
 
fs::path GetFullOutName (std::string &filename, po::variables_map &vm)
 
- Protected Member Functions inherited from Nektar::FieldUtils::Module
 Module ()
 
virtual void v_Process (po::variables_map &vm)
 
virtual std::string v_GetModuleName ()
 
virtual std::string v_GetModuleDescription ()
 
virtual ModulePriority v_GetModulePriority ()
 
virtual std::vector< ModuleKeyv_GetModulePrerequisites ()
 

Protected Attributes

vtkSmartPointer< vtkUnstructuredGrid > m_vtkMesh
 Cache file for unstructured grid VTK mesh data. More...
 
int m_numPlanes = 1
 Number of planes if homogeneous. More...
 
bool m_extraPlane = false
 Flag if extra plane in case of fourier expansion in homogeneous dir. More...
 
bool m_cachedMesh = false
 Flag if mesh has been cached. More...
 
- Protected Attributes inherited from Nektar::FieldUtils::OutputFileBase
bool m_requireEquiSpaced
 
- Protected Attributes inherited from Nektar::FieldUtils::OutputModule
std::ofstream m_fldFile
 Output stream. More...
 
- Protected Attributes inherited from Nektar::FieldUtils::Module
std::map< std::string, ConfigOptionm_config
 List of configuration values. More...
 
std::set< std::string > m_allowedFiles
 List of allowed file formats. More...
 

Private Member Functions

vtkSmartPointer< vtkUnstructuredGrid > OutputFromExpHighOrder (po::variables_map &vm)
 Prepare high order Lagrange VTK output. More...
 
void AddFieldDataToVTKHighOrder (po::variables_map &vm, std::string &filename, vtkSmartPointer< vtkUnstructuredGrid > &vtkMesh)
 Add field data to high order Lagrange VTK output. More...
 
vtkSmartPointer< vtkUnstructuredGrid > OutputFromExpLowOrder ()
 Prepare low order VTK output. More...
 
void AddFieldDataToVTKLowOrder (po::variables_map &vm, std::string &filename, vtkSmartPointer< vtkUnstructuredGrid > &vtkMesh)
 Add field data to low order VTK output. More...
 
void OutputFromExpLowOrderMultiBlock (po::variables_map &vm, std::string &filename)
 Prepare low order multi-block VTK output & add field data. More...
 
void WriteVTK (vtkDataObject *vtkMesh, std::string &filename, po::variables_map &vm)
 Write VTK file using. More...
 
void WritePVtu (po::variables_map &vm)
 Write the parallel .pvtu file. More...
 

Additional Inherited Members

- Public Attributes inherited from Nektar::FieldUtils::Module
FieldSharedPtr m_f
 Field object. More...
 

Detailed Description

Converter from fld to vtk.

Definition at line 49 of file OutputVtk.h.

Constructor & Destructor Documentation

◆ OutputVtk()

Nektar::FieldUtils::OutputVtk::OutputVtk ( FieldSharedPtr  f)
explicit

Definition at line 56 of file OutputVtk.cpp.

56 : OutputVtkBase(std::move(f))
57{
59 m_config["legacy"] =
60 ConfigOption(true, "0", "Output using legacy manual file writers");
61 m_config["highorder"] = ConfigOption(
62 true, "0", "Output using new high-order Lagrange elements");
63 m_config["multiblock"] = ConfigOption(
64 true, "0", "Output using multi-blocks to separate composites");
65 m_config["uncompress"] = ConfigOption(true, "0", "Uncompress xml sections");
66}
std::map< std::string, ConfigOption > m_config
List of configuration values.
Definition: Module.h:272

References Nektar::FieldUtils::Module::m_config, and Nektar::FieldUtils::OutputFileBase::m_requireEquiSpaced.

◆ ~OutputVtk()

Nektar::FieldUtils::OutputVtk::~OutputVtk ( )
finaldefault

Member Function Documentation

◆ AddFieldDataToVTKHighOrder()

void Nektar::FieldUtils::OutputVtk::AddFieldDataToVTKHighOrder ( po::variables_map &  vm,
std::string &  filename,
vtkSmartPointer< vtkUnstructuredGrid > &  vtkMesh 
)
private

Add field data to high order Lagrange VTK output.

Definition at line 1427 of file OutputVtk.cpp.

1430{
1431 // Convert expansion to an equispaced points field
1432 if (m_cachedMesh)
1433 {
1434 auto equispaced =
1436 equispaced->Process(vm);
1437 }
1438 LibUtilities::PtsFieldSharedPtr fPts = m_f->m_fieldPts;
1439
1440 int nPts = static_cast<int>(fPts->GetNpoints());
1441 int dim = static_cast<int>(fPts->GetDim());
1442
1443 Array<OneD, Array<OneD, NekDouble>> pts;
1444 fPts->GetPts(pts);
1445
1446 // Insert field information
1447 for (int i = 0; i < fPts->GetNFields(); ++i)
1448 {
1449 vtkNew<vtkDoubleArray> fieldData;
1450 fieldData->SetArray(&pts[dim + i][0], nPts, 1);
1451 fieldData->SetName(&fPts->GetFieldName(i)[0]);
1452 vtkMesh->GetPointData()->AddArray(fieldData.GetPointer());
1453 }
1454
1455 WriteVTK(vtkMesh, filename, vm);
1456}
FieldSharedPtr m_f
Field object.
Definition: Module.h:239
void WriteVTK(vtkDataObject *vtkMesh, std::string &filename, po::variables_map &vm)
Write VTK file using.
Definition: OutputVtk.cpp:1458
bool m_cachedMesh
Flag if mesh has been cached.
Definition: OutputVtk.h:89
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:184

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), m_cachedMesh, Nektar::FieldUtils::Module::m_f, and WriteVTK().

Referenced by v_OutputFromExp().

◆ AddFieldDataToVTKLowOrder()

void Nektar::FieldUtils::OutputVtk::AddFieldDataToVTKLowOrder ( po::variables_map &  vm,
std::string &  filename,
vtkSmartPointer< vtkUnstructuredGrid > &  vtkMesh 
)
private

Add field data to low order VTK output.

Definition at line 975 of file OutputVtk.cpp.

978{
979 // Insert field information we iterate by element from first plane to last,
980 // while the fld file iterates by plane from first element to last
981 int nElmts = static_cast<int>(m_f->m_exp[0]->GetNumElmts());
982 int numPtsPerPlane = m_f->m_exp[0]->GetTotPoints() / m_numPlanes;
983 for (int v = 0; v < m_f->m_variables.size(); ++v)
984 {
985 vtkNew<vtkDoubleArray> fieldData;
986 for (int i = 0; i < nElmts; ++i)
987 {
988 int elmtOffset = m_f->m_exp[v]->GetPhys_Offset(i);
989 int nPtsPerElmtPerPlane = m_f->m_exp[v]->GetExp(i)->GetTotPoints();
990
991 for (int j = 0; j < m_numPlanes; ++j)
992 {
993 int planeOffset = j * numPtsPerPlane;
994 for (int k = 0; k < nPtsPerElmtPerPlane; ++k)
995 {
996 fieldData->InsertNextValue(
997 m_f->m_exp[v]->GetPhys()[elmtOffset + planeOffset + k]);
998 }
999 }
1000
1001 // if extra plane we copy the first plane values in to last plane
1002 if (m_extraPlane)
1003 {
1004 for (int k = 0; k < nPtsPerElmtPerPlane; ++k)
1005 {
1006 fieldData->InsertNextValue(
1007 m_f->m_exp[v]->GetPhys()[elmtOffset + k]);
1008 }
1009 }
1010 }
1011
1012 fieldData->SetName(&m_f->m_variables[v][0]);
1013 vtkMesh->GetPointData()->AddArray(fieldData.GetPointer());
1014 }
1015
1016 WriteVTK(vtkMesh, filename, vm);
1017}
bool m_extraPlane
Flag if extra plane in case of fourier expansion in homogeneous dir.
Definition: OutputVtk.h:86
int m_numPlanes
Number of planes if homogeneous.
Definition: OutputVtk.h:83

References m_extraPlane, Nektar::FieldUtils::Module::m_f, m_numPlanes, and WriteVTK().

Referenced by v_OutputFromExp().

◆ create()

static std::shared_ptr< Module > Nektar::FieldUtils::OutputVtk::create ( const FieldSharedPtr f)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file OutputVtk.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

◆ OutputFromExpHighOrder()

vtkSmartPointer< vtkUnstructuredGrid > Nektar::FieldUtils::OutputVtk::OutputFromExpHighOrder ( po::variables_map &  vm)
private

Prepare high order Lagrange VTK output.

Definition at line 1298 of file OutputVtk.cpp.

1300{
1301 ASSERTL0(
1302 m_f->m_numHomogeneousDir == 0,
1303 "High order VTK is not implemented for homogeneous expansion types.")
1304
1305 // Save shapetypes before convert to equispaced because that nukes the
1306 // explist
1307 std::vector<LibUtilities::ShapeType> sType;
1308 for (auto &i : *m_f->m_exp[0]->GetExp())
1309 {
1310 sType.emplace_back(i->GetGeom()->GetShapeType());
1311 }
1312
1313 // Convert expansion to an equispaced points field
1314 auto equispaced =
1316 equispaced->Process(vm);
1317
1318 // Insert points
1319 vtkNew<vtkPoints> vtkPoints;
1320 LibUtilities::PtsFieldSharedPtr fPts = m_f->m_fieldPts;
1321 vtkPoints->SetDataType(VTK_DOUBLE);
1322
1323 Array<OneD, Array<OneD, NekDouble>> pts;
1324 fPts->GetPts(pts);
1325
1326 int dim = static_cast<int>(fPts->GetDim());
1327 int nPts = static_cast<int>(fPts->GetNpoints());
1328 switch (dim)
1329 {
1330 case 3:
1331 for (int i = 0; i < nPts; ++i)
1332 {
1333 vtkPoints->InsertNextPoint(pts[0][i], pts[1][i], pts[2][i]);
1334 }
1335 break;
1336 case 2:
1337 for (int i = 0; i < nPts; ++i)
1338 {
1339 vtkPoints->InsertNextPoint(pts[0][i], pts[1][i], 0.0);
1340 }
1341 break;
1342 case 1:
1343 for (int i = 0; i < nPts; ++i)
1344 {
1345 vtkPoints->InsertNextPoint(pts[0][i], 0.0, 0.0);
1346 }
1347 break;
1348 default:
1349 break;
1350 }
1351
1352 // Mesh file to output
1353 vtkSmartPointer<vtkUnstructuredGrid> vtkMesh =
1354 vtkSmartPointer<vtkUnstructuredGrid>::New();
1355 vtkMesh->SetPoints(vtkPoints.GetPointer());
1356
1357 // Cache ordering for shape type & npts so we aren't recreating mappings
1358 std::unordered_map<size_t, std::vector<long long>> mappingCache;
1359
1360 // Get offset per element in a vector from ppe
1361 std::vector<int> ppe = m_f->m_fieldPts->GetPointsPerElement();
1362 Array<OneD, int> ppeOffset(ppe.size() + 1, 0.0);
1363 std::partial_sum(ppe.begin(), ppe.end(), &ppeOffset[1]);
1364
1365 // Insert elements
1366 for (int i = 0; i < ppe.size(); ++i)
1367 {
1368 // Construct inverse of input reordering.
1369 // First try to find it in our mapping cache.
1370 auto oIt = mappingCache.find(key2(sType[i], ppe[i]));
1371 if (oIt == mappingCache.end())
1372 {
1373 std::vector<long long> p(ppe[i]);
1374 std::iota(p.begin(), p.end(), 0);
1375 switch (sType[i])
1376 {
1378 p = quadTensorNodeOrdering(p);
1379 break;
1381 p = triTensorNodeOrdering(p);
1382 break;
1384 p = tetTensorNodeOrdering(p);
1385 break;
1387 p = hexTensorNodeOrdering(p);
1388 break;
1390 p = prismTensorNodeOrdering(p);
1391 break;
1392 default:
1394 "High-order VTU output not set up for the " +
1395 static_cast<std::string>(
1396 LibUtilities::ShapeTypeMap[sType[i]]) +
1397 " shape type.");
1398 break;
1399 }
1400
1401 // Invert the ordering as this is for spectral -> recursive (VTU)
1402 std::vector<long long> inv(ppe[i]);
1403 for (int j = 0; j < ppe[i]; ++j)
1404 {
1405 inv[p[j]] = j;
1406 }
1407
1408 oIt =
1409 mappingCache.insert(std::make_pair(key2(sType[i], ppe[i]), inv))
1410 .first;
1411 }
1412
1413 // Add offset to reordering
1414 std::vector<long long> p = oIt->second;
1415 for (long long &j : p)
1416 {
1417 j += ppeOffset[i];
1418 }
1419
1420 vtkMesh->InsertNextCell(GetHighOrderVtkCellType(sType[i]), ppe[i],
1421 &p[0]);
1422 }
1423
1424 return vtkMesh;
1425}
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:208
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:202
const char *const ShapeTypeMap[SIZE_ShapeType]
Definition: ShapeType.hpp:75

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::ErrorUtil::efatal, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, Nektar::FieldUtils::Module::m_f, NEKERROR, CellMLToNektar.cellml_metadata::p, and Nektar::LibUtilities::ShapeTypeMap.

Referenced by v_OutputFromExp().

◆ OutputFromExpLowOrder()

vtkSmartPointer< vtkUnstructuredGrid > Nektar::FieldUtils::OutputVtk::OutputFromExpLowOrder ( )
private

Prepare low order VTK output.

Definition at line 852 of file OutputVtk.cpp.

853{
854 // Mesh file to output
855 vtkSmartPointer<vtkUnstructuredGrid> vtkMesh =
856 vtkSmartPointer<vtkUnstructuredGrid>::New();
857
858 // Cache ordering so we aren't recreating mappings
859 std::unordered_map<size_t, std::vector<long long>> mappingCache;
860
861 // Choose cell types and num quad points based on dimension
862 int nDim = m_f->m_exp[0]->GetShapeDimension();
863 int nHomoDir = m_f->m_numHomogeneousDir;
864
865 auto type = (nDim + nHomoDir == 3) ? VTK_HEXAHEDRON
866 : (nDim + nHomoDir == 2) ? VTK_QUAD
867 : VTK_LINE;
868 int nQpts = (nDim + nHomoDir == 3) ? 8 : (nDim + nHomoDir == 2) ? 4 : 2;
869
870 // Fill homogeneous info
871 if (nHomoDir != 0)
872 {
873 ASSERTL0(nHomoDir == 1 &&
874 m_f->m_exp[0]->GetExpType() == MultiRegions::e3DH1D,
875 "Only regular expansions and the 3DH1D homogeneous expansion "
876 "are supported in the new VTK writer. Please use the 'legacy' "
877 "option for all other expansion types.")
878
879 m_numPlanes = m_f->m_exp[0]->GetHomogeneousBasis()->GetNumModes();
880 // Extra plane if fourier
881 m_extraPlane = (m_f->m_exp[0]->GetHomogeneousBasis()->GetBasisType() ==
882 LibUtilities::eFourier &&
883 m_f->m_exp[0]->GetHomogeneousBasis()->GetPointsType() ==
884 LibUtilities::eFourierEvenlySpaced);
885 }
886
887 // Insert points
888 vtkNew<vtkPoints> vtkPoints;
889 vtkPoints->SetDataType(VTK_DOUBLE);
890
891 int offset = 0;
892 int nElmts = static_cast<int>(m_f->m_exp[0]->GetNumElmts());
893 for (int i = 0; i < nElmts; ++i)
894 {
895 Array<OneD, int> nquad(3, 0);
896 for (int j = 0; j < nDim; ++j)
897 {
898 nquad[j] = m_f->m_exp[0]->GetExp(i)->GetNumPoints(j);
899 }
900
901 // Add homogeneous direction num points
902 if (nHomoDir != 0)
903 {
904 nquad[nDim] = m_numPlanes;
905
906 // Add extra plane if fourier
907 if (m_extraPlane)
908 {
909 nquad[nDim]++;
910 }
911 }
912
913 // Get total points by multiplying all nquads together (accounts for
914 // homo)
915 int nPts = nquad[0];
916 for (int j = 1; j < nDim + nHomoDir; ++j)
917 {
918 nPts *= nquad[j];
919 }
920
921 // Get all coordinates at quadrature points in this element
922 Array<OneD, NekDouble> x(nPts, 0.0), y(nPts, 0.0), z(nPts, 0.0);
923 m_f->m_exp[0]->GetCoords(i, x, y, z);
924
925 // If add extra plane for fourier need to fill last plane coordinates
926 if (m_extraPlane)
927 {
928 // Copy x & y to extra plane
929 Array<OneD, NekDouble> tmp;
930 Vmath::Vcopy(nquad[0] * nquad[1], x, 1,
931 tmp = x + (nquad[2] - 1) * nquad[0] * nquad[1], 1);
932 Vmath::Vcopy(nquad[0] * nquad[1], y, 1,
933 tmp = y + (nquad[2] - 1) * nquad[0] * nquad[1], 1);
934
935 // Fill z on extra plane
936 NekDouble zDouble = z[nquad[0] * nquad[1] * (nquad[2] - 1) - 1] +
937 (z[nquad[0] * nquad[1]] - z[0]);
938 Vmath::Fill(nquad[0] * nquad[1], zDouble,
939 tmp = z + (nquad[2] - 1) * nquad[0] * nquad[1], 1);
940 }
941
942 // Insert points in to vtk mesh
943 for (int j = 0; j < nPts; ++j)
944 {
945 vtkPoints->InsertNextPoint(x[j], y[j], z[j]);
946 }
947
948 // Insert elements
949 auto oIt = mappingCache.find(key3(nquad[0], nquad[1], nquad[2]));
950 if (oIt == mappingCache.end())
951 {
952 auto p = lowOrderMapping(nDim + nHomoDir, nquad);
953 oIt = mappingCache
954 .insert(
955 std::make_pair(key3(nquad[0], nquad[1], nquad[2]), p))
956 .first;
957 }
958
959 auto p = oIt->second;
960 std::for_each(p.begin(), p.end(),
961 [offset](long long &d) { d += offset; });
962 for (int j = 0; j < p.size(); j += nQpts)
963 {
964 vtkMesh->InsertNextCell(type, nQpts, &p[j]);
965 }
966
967 offset += nPts;
968 }
969
970 vtkMesh->SetPoints(vtkPoints.GetPointer());
971
972 return vtkMesh;
973}
@ eFourierEvenlySpaced
1D Evenly-spaced points using Fourier Fit
Definition: PointsType.h:74
@ eFourier
Fourier Expansion .
Definition: BasisType.h:55
std::vector< double > z(NPUPPER)
std::vector< double > d(NPUPPER *NPUPPER)
double NekDouble
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.hpp:54
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.hpp:825

References ASSERTL0, Nektar::UnitTests::d(), Nektar::MultiRegions::e3DH1D, Nektar::LibUtilities::eFourier, Nektar::LibUtilities::eFourierEvenlySpaced, Vmath::Fill(), m_extraPlane, Nektar::FieldUtils::Module::m_f, m_numPlanes, CellMLToNektar.cellml_metadata::p, Vmath::Vcopy(), and Nektar::UnitTests::z().

Referenced by v_OutputFromExp().

◆ OutputFromExpLowOrderMultiBlock()

void Nektar::FieldUtils::OutputVtk::OutputFromExpLowOrderMultiBlock ( po::variables_map &  vm,
std::string &  filename 
)
private

Prepare low order multi-block VTK output & add field data.

Definition at line 1019 of file OutputVtk.cpp.

1021{
1022 ASSERTL0(
1023 m_f->m_numHomogeneousDir == 0,
1024 "Multi block VTK is not implemented for homogeneous expansion types.")
1025
1026 ASSERTL0(m_f->m_comm->GetSpaceComm()->IsSerial(),
1027 "Multi block VTK is not implemented in parallel.")
1028
1029 int dim = m_f->m_graph->GetMeshDimension();
1030
1031 // Create mappings from geometry id to expansion ids
1032 std::array<std::map<int, std::pair<int, int>>, 4> geomIdToExpId;
1033 int nElmts = static_cast<int>(m_f->m_exp[0]->GetNumElmts());
1034 for (int i = 0; i < nElmts; ++i)
1035 {
1036 auto geom = m_f->m_exp[0]->GetExp(i)->GetGeom();
1037 geomIdToExpId[geom->GetShapeDim()][geom->GetGlobalID()] =
1038 std::make_pair(i, -1);
1039
1040 for (int j = 0; j < geom->GetNumFaces(); ++j)
1041 {
1042 geomIdToExpId[2][geom->GetFid(j)] = std::make_pair(i, j);
1043 }
1044
1045 for (int j = 0; j < geom->GetNumEdges(); ++j)
1046 {
1047 geomIdToExpId[1][geom->GetEid(j)] = std::make_pair(i, j);
1048 }
1049 }
1050
1051 // Cache ordering so we aren't recreating mappings
1052 std::unordered_map<size_t, std::vector<long long>> mappingCache;
1053
1054 std::map<int, vtkNew<vtkUnstructuredGrid>> vtkMesh;
1055 std::map<int, SpatialDomains::CompositeSharedPtr> composites =
1056 m_f->m_graph->GetComposites();
1057 std::map<int, std::string> compositeNames;
1058 for (auto &comp : composites)
1059 {
1060 // Vector of field data
1061 std::vector<vtkNew<vtkDoubleArray>> fieldData(m_f->m_variables.size());
1062
1063 // Insert points
1064 vtkNew<vtkPoints> vtkPoints;
1065 vtkPoints->SetDataType(VTK_DOUBLE);
1066
1067 int compId = comp.first;
1068 std::vector<std::shared_ptr<SpatialDomains::Geometry>> geomVec =
1069 comp.second->m_geomVec;
1070
1071 unsigned int offset = 0;
1072 for (auto &geom : geomVec)
1073 {
1074 int geomId = geom->GetGlobalID();
1075 int sDim = geom->GetShapeDim();
1076 auto type = (sDim == 3) ? VTK_HEXAHEDRON
1077 : (sDim == 2) ? VTK_QUAD
1078 : VTK_LINE;
1079 int nQpts = (sDim == 3) ? 8 : (sDim == 2) ? 4 : 2;
1080
1082 m_f->m_exp[0]->GetExp(geomIdToExpId[sDim][geomId].first);
1083
1084 unsigned int nPts = exp->GetTotPoints();
1085 Array<OneD, NekDouble> x(nPts, 0.0), y(nPts, 0.0), z(nPts, 0.0);
1086 exp->GetCoords(x, y, z);
1087
1088 int offsetPhys = m_f->m_exp[0]->GetPhys_Offset(
1089 geomIdToExpId[sDim][geomId].first);
1090 if (sDim == dim)
1091 {
1092 for (int j = 0; j < nPts; ++j)
1093 {
1094 vtkPoints->InsertNextPoint(x[j], y[j], z[j]);
1095
1096 // Add field data
1097 for (int k = 0; k < m_f->m_variables.size(); ++k)
1098 {
1099 fieldData[k]->InsertNextValue(
1100 m_f->m_exp[k]->GetPhys()[j + offsetPhys]);
1101 }
1102 }
1103 }
1104 else
1105 {
1106 Array<OneD, int> pointsMap;
1107 exp->GetTracePhysMap(geomIdToExpId[sDim][geomId].second,
1108 pointsMap);
1109 for (int j : pointsMap)
1110 {
1111 vtkPoints->InsertNextPoint(x[j], y[j], z[j]);
1112
1113 // Add field data
1114 for (int k = 0; k < m_f->m_variables.size(); ++k)
1115 {
1116 fieldData[k]->InsertNextValue(
1117 m_f->m_exp[k]->GetPhys()[offsetPhys + j]);
1118 }
1119 }
1120
1121 exp = exp->GetTraceExp(geomIdToExpId[sDim][geomId].second);
1122 nPts = pointsMap.size();
1123 }
1124
1125 Array<OneD, int> nquad(3, 0);
1126 for (int j = 0; j < sDim; ++j)
1127 {
1128 nquad[j] = exp->GetNumPoints(j);
1129 }
1130
1131 auto oIt = mappingCache.find(key3(nquad[0], nquad[1], nquad[2]));
1132 if (oIt == mappingCache.end())
1133 {
1134 auto p = lowOrderMapping(sDim, nquad);
1135 oIt = mappingCache
1136 .insert(std::make_pair(
1137 key3(nquad[0], nquad[1], nquad[2]), p))
1138 .first;
1139 }
1140
1141 auto p = oIt->second;
1142 std::for_each(p.begin(), p.end(),
1143 [offset](long long &d) { d += offset; });
1144
1145 for (int j = 0; j < p.size(); j += nQpts)
1146 {
1147 vtkMesh[compId]->InsertNextCell(type, nQpts, &p[j]);
1148 }
1149
1150 offset += nPts;
1151 }
1152
1153 vtkMesh[compId]->SetPoints(vtkPoints.GetPointer());
1154
1155 // Add all fields to vtkMesh
1156 for (int k = 0; k < m_f->m_variables.size(); ++k)
1157 {
1158 fieldData[k]->SetName(&m_f->m_variables[k][0]);
1159 vtkMesh[compId]->GetPointData()->AddArray(
1160 fieldData[k].GetPointer());
1161 }
1162
1163 // Find composite names if exists and store in map
1164 // Set name as boundary label if it exists otherwise index ID
1165 compositeNames[compId] = "Composite ID " + std::to_string(compId);
1166 auto clabels = m_f->m_graph->GetCompositesLabels();
1167 auto oIt = clabels.find(compId);
1168 if (oIt != clabels.end())
1169 {
1170 compositeNames[compId] = oIt->second;
1171 }
1172 }
1173
1174 // Main multi-block set
1175 vtkNew<vtkMultiBlockDataSet> mainBlock;
1176
1177 std::set<int> compSet;
1178
1179 // Fill domain multi blocks from composites
1180 vtkNew<vtkMultiBlockDataSet> mainDomainBlock;
1181 auto domains = m_f->m_graph->GetDomain();
1182 std::vector<vtkNew<vtkMultiBlockDataSet>> domainMultiBlocks(domains.size());
1183 for (int i = 0; i < domains.size(); ++i)
1184 {
1185 auto dom = domains[i];
1186
1187 // Loop over composites and see if in domain
1188 for (auto &comp : composites)
1189 {
1190 int compId = comp.first;
1191 if (dom.find(compId) != dom.end())
1192 {
1193 unsigned int nBlock = domainMultiBlocks[i]->GetNumberOfBlocks();
1194 domainMultiBlocks[i]->SetBlock(nBlock,
1195 vtkMesh[compId].GetPointer());
1196 domainMultiBlocks[i]->GetMetaData(nBlock)->Set(
1197 vtkCompositeDataSet::NAME(),
1198 compositeNames[compId].c_str());
1199 compSet.insert(compId);
1200 }
1201 }
1202
1203 unsigned int nBlock = mainDomainBlock->GetNumberOfBlocks();
1204 mainDomainBlock->SetBlock(nBlock, domainMultiBlocks[i].GetPointer());
1205 mainDomainBlock->GetMetaData(nBlock)->Set(
1206 vtkCompositeDataSet::NAME(),
1207 ("Domain ID " + std::to_string(i)).c_str());
1208 }
1209
1210 if (mainDomainBlock->GetNumberOfBlocks() != 0)
1211 {
1212 auto nBlock = static_cast<unsigned int>(mainBlock->GetNumberOfBlocks());
1213 mainBlock->SetBlock(nBlock, mainDomainBlock.GetPointer());
1214 mainBlock->GetMetaData(nBlock)->Set(vtkCompositeDataSet::NAME(),
1215 "Domains");
1216 }
1217
1218 // Fill boundary multi blocks from composites
1219 SpatialDomains::BoundaryConditions bcs(m_f->m_session,
1220 m_f->m_exp[0]->GetGraph());
1222 bcs.GetBoundaryRegions();
1223
1224 vtkNew<vtkMultiBlockDataSet> mainBoundaryBlock;
1225 std::vector<vtkNew<vtkMultiBlockDataSet>> boundaryMultiBlocks(
1226 bregions.size());
1227 int cnt = 0;
1228 for (auto &boundary : bregions)
1229 {
1230 // Loop over composites and see if in boundary
1231 for (auto &comp : composites)
1232 {
1233 int compId = comp.first;
1234 if (boundary.second->find(compId) != boundary.second->end())
1235 {
1236 unsigned int nBlock =
1237 boundaryMultiBlocks[cnt]->GetNumberOfBlocks();
1238 boundaryMultiBlocks[cnt]->SetBlock(
1239 nBlock, vtkMesh[compId].GetPointer());
1240 boundaryMultiBlocks[cnt]->GetMetaData(nBlock)->Set(
1241 vtkCompositeDataSet::NAME(),
1242 compositeNames[compId].c_str());
1243 compSet.insert(compId);
1244 }
1245 }
1246
1247 unsigned int nBlock = mainBoundaryBlock->GetNumberOfBlocks();
1248 mainBoundaryBlock->SetBlock(nBlock,
1249 boundaryMultiBlocks[cnt++].GetPointer());
1250
1251 // Set name as boundary label if it exists otherwise index ID
1252 std::string name = "Boundary ID " + std::to_string(boundary.first);
1253 auto blabels = bcs.GetBoundaryLabels();
1254 auto oIt = blabels.find(boundary.first);
1255 if (oIt != blabels.end())
1256 {
1257 name = oIt->second;
1258 }
1259
1260 mainBoundaryBlock->GetMetaData(nBlock)->Set(vtkCompositeDataSet::NAME(),
1261 name.c_str());
1262 }
1263
1264 if (mainBoundaryBlock->GetNumberOfBlocks() != 0)
1265 {
1266 auto nBlock = static_cast<unsigned int>(mainBlock->GetNumberOfBlocks());
1267 mainBlock->SetBlock(nBlock, mainBoundaryBlock.GetPointer());
1268 mainBlock->GetMetaData(nBlock)->Set(vtkCompositeDataSet::NAME(),
1269 "Boundaries");
1270 }
1271
1272 // Include all other composites (not domains or boundaries)
1273 vtkNew<vtkMultiBlockDataSet> compsMultiBlocks;
1274 cnt = 0;
1275 for (auto &comp : composites)
1276 {
1277 int compId = comp.first;
1278 if (compSet.find(compId) == compSet.end())
1279 {
1280 unsigned int nBlock = compsMultiBlocks->GetNumberOfBlocks();
1281 compsMultiBlocks->SetBlock(nBlock, vtkMesh[compId].GetPointer());
1282 compsMultiBlocks->GetMetaData(nBlock)->Set(
1283 vtkCompositeDataSet::NAME(), compositeNames[compId].c_str());
1284 }
1285 }
1286
1287 if (compsMultiBlocks->GetNumberOfBlocks() != 0)
1288 {
1289 auto nBlock = static_cast<unsigned int>(mainBlock->GetNumberOfBlocks());
1290 mainBlock->SetBlock(nBlock, compsMultiBlocks.GetPointer());
1291 mainBlock->GetMetaData(nBlock)->Set(vtkCompositeDataSet::NAME(),
1292 "Other composites");
1293 }
1294
1295 WriteVTK(mainBlock.GetPointer(), filename, vm);
1296}
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:66
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:210

References ASSERTL0, Nektar::UnitTests::d(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryLabels(), Nektar::SpatialDomains::BoundaryConditions::GetBoundaryRegions(), Nektar::FieldUtils::Module::m_f, CellMLToNektar.pycml::name, CellMLToNektar.cellml_metadata::p, WriteVTK(), and Nektar::UnitTests::z().

Referenced by v_OutputFromExp().

◆ v_GetModuleName()

std::string Nektar::FieldUtils::OutputVtk::v_GetModuleName ( )
inlinefinalprotectedvirtual

Reimplemented from Nektar::FieldUtils::OutputFileBase.

Definition at line 65 of file OutputVtk.h.

66 {
67 return "OutputVtk";
68 }

◆ v_OutputFromData()

void Nektar::FieldUtils::OutputVtk::v_OutputFromData ( po::variables_map &  vm)
finalprotectedvirtual

Write from data to output file.

Implements Nektar::FieldUtils::OutputFileBase.

Definition at line 1592 of file OutputVtk.cpp.

1593{
1595 "OutputVtk can't write using only FieldData. You may need "
1596 "to add a mesh XML file to your input files.");
1597}

References Nektar::ErrorUtil::efatal, and NEKERROR.

◆ v_OutputFromExp()

void Nektar::FieldUtils::OutputVtk::v_OutputFromExp ( po::variables_map &  vm)
finalprotectedvirtual

Write from m_exp to output file.

Implements Nektar::FieldUtils::OutputFileBase.

Definition at line 1604 of file OutputVtk.cpp.

1605{
1606 if (m_config["legacy"].m_beenSet)
1607 {
1608 ASSERTL0(!m_config["multiblock"].m_beenSet,
1609 "Multi block VTK is not implemented for legacy output.")
1610
1611 ASSERTL0(!m_config["highorder"].m_beenSet,
1612 "High order VTK is not implemented for legacy output.")
1613
1614 // No caching of mesh data in legacy output
1616 return;
1617 }
1618
1619 // Extract the output filename and extension
1620 std::string filename = OutputVtkBase::PrepareOutput(vm);
1621
1622 // Save mesh state (if using filter this allows us to only ProcessEquispaced
1623 // if needed)
1625
1626 if (m_config["highorder"].m_beenSet)
1627 {
1628 ASSERTL0(!m_config["multiblock"].m_beenSet,
1629 "Multi block VTK is not implemented for high-order output.")
1630
1631 if (!m_cachedMesh)
1632 {
1634 }
1635
1637 }
1638 else if (m_config["multiblock"].m_beenSet)
1639 {
1640 // No mesh caching for multiblock due to complexity of field data
1641 OutputFromExpLowOrderMultiBlock(vm, filename);
1642 }
1643 else
1644 {
1645 if (!m_cachedMesh)
1646 {
1648 }
1649
1650 AddFieldDataToVTKLowOrder(vm, filename, m_vtkMesh);
1651 }
1652}
std::string PrepareOutput(po::variables_map &vm)
vtkSmartPointer< vtkUnstructuredGrid > OutputFromExpLowOrder()
Prepare low order VTK output.
Definition: OutputVtk.cpp:852
void AddFieldDataToVTKHighOrder(po::variables_map &vm, std::string &filename, vtkSmartPointer< vtkUnstructuredGrid > &vtkMesh)
Add field data to high order Lagrange VTK output.
Definition: OutputVtk.cpp:1427
void OutputFromExpLowOrderMultiBlock(po::variables_map &vm, std::string &filename)
Prepare low order multi-block VTK output & add field data.
Definition: OutputVtk.cpp:1019
vtkSmartPointer< vtkUnstructuredGrid > m_vtkMesh
Cache file for unstructured grid VTK mesh data.
Definition: OutputVtk.h:80
void v_OutputFromExp(po::variables_map &vm) final
Write from m_exp to output file.
Definition: OutputVtk.cpp:1604
void AddFieldDataToVTKLowOrder(po::variables_map &vm, std::string &filename, vtkSmartPointer< vtkUnstructuredGrid > &vtkMesh)
Add field data to low order VTK output.
Definition: OutputVtk.cpp:975
vtkSmartPointer< vtkUnstructuredGrid > OutputFromExpHighOrder(po::variables_map &vm)
Prepare high order Lagrange VTK output.
Definition: OutputVtk.cpp:1298

References AddFieldDataToVTKHighOrder(), AddFieldDataToVTKLowOrder(), ASSERTL0, m_cachedMesh, Nektar::FieldUtils::Module::m_config, m_vtkMesh, OutputFromExpHighOrder(), OutputFromExpLowOrder(), OutputFromExpLowOrderMultiBlock(), Nektar::FieldUtils::OutputVtkBase::PrepareOutput(), and Nektar::FieldUtils::OutputVtkBase::v_OutputFromExp().

◆ v_OutputFromPts()

void Nektar::FieldUtils::OutputVtk::v_OutputFromPts ( po::variables_map &  vm)
finalprotectedvirtual

Write from pts to output file.

Implements Nektar::FieldUtils::OutputFileBase.

Definition at line 1599 of file OutputVtk.cpp.

1600{
1602}
void v_OutputFromPts(po::variables_map &vm) override
Write from pts to output file.

References Nektar::FieldUtils::OutputVtkBase::v_OutputFromPts().

◆ WritePVtu()

void Nektar::FieldUtils::OutputVtk::WritePVtu ( po::variables_map &  vm)
private

Write the parallel .pvtu file.

Definition at line 1520 of file OutputVtk.cpp.

1521{
1522 std::string filename = m_config["outfile"].as<std::string>();
1523 int dot = static_cast<int>(filename.find_last_of('.'));
1524 std::string body = filename.substr(0, dot);
1525 filename = body + ".pvtu";
1526
1527 std::ofstream outfile(filename.c_str());
1528
1529 int nprocs = m_f->m_comm->GetSpaceComm()->GetSize();
1530 std::string path =
1532
1533 outfile << "<?xml version=\"1.0\"?>" << endl;
1534 outfile << R"(<VTKFile type="PUnstructuredGrid" version="0.1" )"
1535 << "byte_order=\"LittleEndian\">" << endl;
1536 outfile << " <PUnstructuredGrid GhostLevel=\"0\">" << endl;
1537
1538 // Add time if exists
1539 if (!m_f->m_fieldMetaDataMap["Time"].empty())
1540 {
1541 outfile << " <FieldData> " << endl;
1542 outfile << " <DataArray type=\"Float64\" Name=\"TimeValue\" "
1543 "NumberOfTuples=\"1\" format=\"ascii\">"
1544 << endl;
1545 outfile << m_f->m_fieldMetaDataMap["Time"] << std::endl;
1546 outfile << " </DataArray>" << std::endl;
1547 outfile << " </FieldData> " << endl;
1548 }
1549
1550 // Add point coordinates
1551 outfile << " <PPoints> " << endl;
1552 outfile << R"( <PDataArray type="Float64" NumberOfComponents=")" << 3
1553 << "\"/> " << endl;
1554 outfile << " </PPoints>" << endl;
1555
1556 // Add cell information
1557 outfile << " <PCells>" << endl;
1558 outfile << " <PDataArray type=\"Int64\" Name=\"connectivity\" "
1559 "NumberOfComponents=\"1\"/>"
1560 << endl;
1561 outfile << " <PDataArray type=\"Int64\" Name=\"offsets\" "
1562 "NumberOfComponents=\"1\"/>"
1563 << endl;
1564 outfile << " <PDataArray type=\"UInt8\" Name=\"types\" "
1565 "NumberOfComponents=\"1\"/>"
1566 << endl;
1567 outfile << " </PCells>" << endl;
1568
1569 // Add fields (point data)
1570 outfile << " <PPointData>" << endl;
1571 for (auto &var : m_f->m_variables)
1572 {
1573 outfile << R"( <PDataArray type="Float64" Name=")" << var << "\"/>"
1574 << endl;
1575 }
1576 outfile << " </PPointData>" << endl;
1577
1578 // Add parallel files
1579 for (int i = 0; i < nprocs; ++i)
1580 {
1581 boost::format pad("P%1$07d.vtu");
1582 pad % i;
1583 outfile << " <Piece Source=\"" << path << "/" << pad.str() << "\"/>"
1584 << endl;
1585 }
1586 outfile << " </PUnstructuredGrid>" << endl;
1587 outfile << "</VTKFile>" << endl;
1588
1589 cout << "Written file: " << filename << endl;
1590}
fs::path v_GetPath(std::string &filename, po::variables_map &vm) override
static std::string PortablePath(const fs::path &path)
create portable path on different platforms for std::filesystem path.
Definition: Filesystem.hpp:56

References CellMLToNektar.pycml::format, Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, Nektar::LibUtilities::PortablePath(), and Nektar::FieldUtils::OutputVtkBase::v_GetPath().

Referenced by WriteVTK().

◆ WriteVTK()

void Nektar::FieldUtils::OutputVtk::WriteVTK ( vtkDataObject *  vtkMesh,
std::string &  filename,
po::variables_map &  vm 
)
private

Write VTK file using.

Parameters
vtkMesh

Definition at line 1458 of file OutputVtk.cpp.

1460{
1461 // Initialise base writer class as default structured grid writer
1462 vtkSmartPointer<vtkXMLWriter> vtkMeshWriter =
1463 vtkNew<vtkXMLUnstructuredGridWriter>().GetPointer();
1464
1465 // If multi block we need to switch to the MultiBlock writer
1466 if (m_config["multiblock"].m_beenSet)
1467 {
1468 vtkMeshWriter = vtkNew<vtkXMLMultiBlockDataWriter>().GetPointer();
1469 }
1470
1471 // Choose the correct extension based on which mesh writer is used
1472 int dot = static_cast<int>(filename.find_last_of('.'));
1473 std::string body = filename.substr(0, dot + 1);
1474 filename = body + vtkMeshWriter->GetDefaultFileExtension();
1475
1476 // Set time information if exists
1477 if (!m_f->m_fieldMetaDataMap["Time"].empty())
1478 {
1479 vtkMesh->GetInformation()->Set(
1480 vtkDataObject::DATA_TIME_STEP(),
1481 std::stod(m_f->m_fieldMetaDataMap["Time"]));
1482 }
1483 else if (!m_f->m_fieldMetaDataMap["FinalTime"].empty())
1484 {
1485 vtkMesh->GetInformation()->Set(
1486 vtkDataObject::DATA_TIME_STEP(),
1487 std::stod(m_f->m_fieldMetaDataMap["FinalTime"]));
1488 }
1489
1490 // Write out the new mesh in XML format (don't support legacy
1491 // format here as we still have standard OutputVtk.cpp)
1492 vtkMeshWriter->SetFileName(filename.c_str());
1493
1494#if VTK_MAJOR_VERSION <= 5
1495 vtkMeshWriter->SetInput(vtkMesh);
1496#else
1497 vtkMeshWriter->SetInputData(vtkMesh);
1498#endif
1499
1500 if (m_config["uncompress"].m_beenSet)
1501 {
1502 vtkMeshWriter->SetDataModeToAscii();
1503 }
1504
1505 vtkMeshWriter->Update();
1506
1507 std::cout << "Written file: " << filename << std::endl;
1508
1509 // Output parallel file information if needed - using a manual write.
1510 // We could use the VTK lib to do this, but that requires VTK with MPI
1511 // enabled & messing about with the parallel controller & changing
1512 // our file naming scheme as VTK forces _${proc-number} as a suffix...
1513 if (m_f->m_comm->GetSpaceComm()->TreatAsRankZero() &&
1514 !m_f->m_comm->GetSpaceComm()->IsSerial())
1515 {
1516 WritePVtu(vm);
1517 }
1518}
void WritePVtu(po::variables_map &vm)
Write the parallel .pvtu file.
Definition: OutputVtk.cpp:1520

References Nektar::FieldUtils::Module::m_config, Nektar::FieldUtils::Module::m_f, and WritePVtu().

Referenced by AddFieldDataToVTKHighOrder(), AddFieldDataToVTKLowOrder(), and OutputFromExpLowOrderMultiBlock().

Member Data Documentation

◆ m_cachedMesh

bool Nektar::FieldUtils::OutputVtk::m_cachedMesh = false
protected

Flag if mesh has been cached.

Definition at line 89 of file OutputVtk.h.

Referenced by AddFieldDataToVTKHighOrder(), and v_OutputFromExp().

◆ m_className

ModuleKey Nektar::FieldUtils::OutputVtk::m_className
static
Initial value:
ModuleKey(eOutputModule, "vtu"), OutputVtk::create, "Writes a VTU file.")
static std::shared_ptr< Module > create(const FieldSharedPtr &f)
Creates an instance of this class.
Definition: OutputVtk.h:53
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:197
std::pair< ModuleType, std::string > ModuleKey
Definition: Module.h:180
ModuleFactory & GetModuleFactory()
Definition: Module.cpp:47

Definition at line 58 of file OutputVtk.h.

◆ m_extraPlane

bool Nektar::FieldUtils::OutputVtk::m_extraPlane = false
protected

Flag if extra plane in case of fourier expansion in homogeneous dir.

Definition at line 86 of file OutputVtk.h.

Referenced by AddFieldDataToVTKLowOrder(), and OutputFromExpLowOrder().

◆ m_numPlanes

int Nektar::FieldUtils::OutputVtk::m_numPlanes = 1
protected

Number of planes if homogeneous.

Definition at line 83 of file OutputVtk.h.

Referenced by AddFieldDataToVTKLowOrder(), and OutputFromExpLowOrder().

◆ m_vtkMesh

vtkSmartPointer<vtkUnstructuredGrid> Nektar::FieldUtils::OutputVtk::m_vtkMesh
protected

Cache file for unstructured grid VTK mesh data.

Definition at line 80 of file OutputVtk.h.

Referenced by v_OutputFromExp().