ENH: restructuring of ensight output files

- changed ensightOutput from a class solely comprising static methods to
  a namespace and added in sub-namespaces Detail and Serial.

  This makes it easier to "mix-in" functions at different levels.
  Refactored and combined some serial/parallel code where possible.

  The general ensightOutput namespace has now shifted to be in the
  fileFormats lib, while leaving volField outputs in the conversion lib
  and cloud outputs in the lagrangian-intermediate lib.

  The ensightCloud namespace is now simply folded into the new
  ensightOutput namespace.

  These changes clean up some code, reduce fragmentation and
  duplication and removes the previous libconversion dependency for
  sampling.

- use int for ensight nTypes constexpr

Note: issue #1176 is unaffected except for the change in file name:

   ensightOutputTemplates.C -> ensightOutputVolFieldTemplates.C
This commit is contained in:
Mark Olesen
2019-01-29 15:18:17 +01:00
parent 1982f1df89
commit b7fb6116c3
23 changed files with 820 additions and 738 deletions

View File

@ -56,7 +56,7 @@ if (doLagrangian)
{
autoPtr<ensightFile> os = ensCase.newCloud(cloudName);
ensightCloud::writePositions
ensightOutput::writeCloudPositions
(
mesh,
cloudName,
@ -104,7 +104,7 @@ if (doLagrangian)
autoPtr<ensightFile> os =
ensCase.newCloudData<scalar>(cloudName, fieldName);
wrote = ensightCloud::writeCloudField<scalar>
wrote = ensightOutput::writeCloudField<scalar>
(
fieldObject, fieldExists, os
);
@ -114,7 +114,7 @@ if (doLagrangian)
autoPtr<ensightFile> os =
ensCase.newCloudData<vector>(cloudName, fieldName);
wrote = ensightCloud::writeCloudField<vector>
wrote = ensightOutput::writeCloudField<vector>
(
fieldObject, fieldExists, os
);

View File

@ -99,8 +99,8 @@ Note
#include "ensightCase.H"
#include "ensightGeoFile.H"
#include "ensightMesh.H"
#include "ensightOutput.H"
#include "ensightOutputCloud.H"
#include "ensightOutputVolField.H"
#include "fvMeshSubsetProxy.H"
// local files

View File

@ -62,11 +62,11 @@ bool writeVolField
autoPtr<ensightFile> os = ensCase.newData<Type>(field.name());
bool wrote = ensightOutput::writeField<Type>
bool wrote = ensightOutput::writeVolField<Type>
(
field,
ensMesh,
os,
os.ref(),
nodeValues
);

View File

@ -55,7 +55,7 @@ if (doLagrangian)
{
autoPtr<ensightFile> os = ensCase.newCloud(cloudName);
ensightCloud::writePositions
ensightOutput::writeCloudPositions
(
mesh,
cloudName,
@ -103,7 +103,7 @@ if (doLagrangian)
autoPtr<ensightFile> os =
ensCase.newCloudData<scalar>(cloudName, fieldName);
wrote = ensightCloud::writeCloudField<scalar>
wrote = ensightOutput::writeCloudField<scalar>
(
fieldObject, fieldExists, os
);
@ -113,7 +113,7 @@ if (doLagrangian)
autoPtr<ensightFile> os =
ensCase.newCloudData<vector>(cloudName, fieldName);
wrote = ensightCloud::writeCloudField<vector>
wrote = ensightOutput::writeCloudField<vector>
(
fieldObject, fieldExists, os
);

View File

@ -94,8 +94,8 @@ Note
#include "ensightCase.H"
#include "ensightGeoFile.H"
#include "ensightParts.H"
#include "ensightSerialOutput.H"
#include "ensightOutputCloud.H"
#include "ensightOutputVolField.H"
#include "fvMeshSubsetProxy.H"
// local files

View File

@ -61,11 +61,12 @@ bool writeVolField
autoPtr<ensightFile> os = ensCase.newData<Type>(field.name());
bool wrote = ensightSerialOutput::writeField<Type>
// Currently serial only
bool wrote = ensightOutput::Serial::writeVolField<Type>
(
field,
ensParts,
os
os.ref()
);
tfield.clear();