Skip to content
Permalink
Browse files

mesh manipulation utilities: Rationalized field handling and added -n…

…oFields option
  • Loading branch information...
Henry Weller
Henry Weller committed Jan 8, 2019
1 parent 28194d9 commit 66c26af922397326b5d67c7d997b210d99896b47
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -62,17 +62,24 @@ int main(int argc, char *argv[])
"remove cells from input cellSet to keep to 2:1 ratio"
" (default is to extend set)"
);
argList::addBoolOption
(
"noFields",
"do not update fields"
);

#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();

const bool overwrite = args.optionFound("overwrite");
const bool minSet = args.optionFound("minSet");
const bool fields = !args.optionFound("noFields");

#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();

word cellSetName(args.args()[1]);
const bool overwrite = args.optionFound("overwrite");

const bool minSet = args.optionFound("minSet");

Info<< "Reading cells to refine from cellSet " << cellSetName
<< nl << endl;
@@ -87,46 +94,13 @@ int main(int argc, char *argv[])
// Read objects in time directory
IOobjectList objects(mesh, runTime.timeName());

// Read vol fields.

PtrList<volScalarField> vsFlds;
ReadFields(mesh, objects, vsFlds);

PtrList<volVectorField> vvFlds;
ReadFields(mesh, objects, vvFlds);

PtrList<volSphericalTensorField> vstFlds;
ReadFields(mesh, objects, vstFlds);

PtrList<volSymmTensorField> vsymtFlds;
ReadFields(mesh, objects, vsymtFlds);

PtrList<volTensorField> vtFlds;
ReadFields(mesh, objects, vtFlds);

// Read surface fields.

PtrList<surfaceScalarField> ssFlds;
ReadFields(mesh, objects, ssFlds);

PtrList<surfaceVectorField> svFlds;
ReadFields(mesh, objects, svFlds);

PtrList<surfaceSphericalTensorField> sstFlds;
ReadFields(mesh, objects, sstFlds);

PtrList<surfaceSymmTensorField> ssymtFlds;
ReadFields(mesh, objects, ssymtFlds);

PtrList<surfaceTensorField> stFlds;
ReadFields(mesh, objects, stFlds);
if (fields) Info<< "Reading geometric fields" << nl << endl;

// Read point fields
PtrList<pointScalarField> psFlds;
ReadFields(pointMesh::New(mesh), objects, psFlds);
#include "readVolFields.H"
#include "readSurfaceFields.H"
#include "readPointFields.H"

PtrList<pointVectorField> pvFlds;
ReadFields(pointMesh::New(mesh), objects, pvFlds);
Info<< endl;


// Construct refiner without unrefinement. Read existing point/cell level.
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -41,25 +41,34 @@ Description
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H"

using namespace Foam;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //


int main(int argc, char *argv[])
{
#include "addOverwriteOption.H"
argList::validArgs.append("faceSet");
argList::addBoolOption
(
"noFields",
"do not update fields"
);


#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();

const bool overwrite = args.optionFound("overwrite");
const bool fields = !args.optionFound("noFields");

#include "createMesh.H"
const word oldInstance = mesh.pointsInstance();

const word setName = args[1];
const bool overwrite = args.optionFound("overwrite");

// Read faces
faceSet candidateSet(mesh, setName);
@@ -106,37 +115,13 @@ int main(int argc, char *argv[])
// Read objects in time directory
IOobjectList objects(mesh, runTime.timeName());

// Read vol fields.
PtrList<volScalarField> vsFlds;
ReadFields(mesh, objects, vsFlds);

PtrList<volVectorField> vvFlds;
ReadFields(mesh, objects, vvFlds);

PtrList<volSphericalTensorField> vstFlds;
ReadFields(mesh, objects, vstFlds);

PtrList<volSymmTensorField> vsymtFlds;
ReadFields(mesh, objects, vsymtFlds);

PtrList<volTensorField> vtFlds;
ReadFields(mesh, objects, vtFlds);

// Read surface fields.
PtrList<surfaceScalarField> ssFlds;
ReadFields(mesh, objects, ssFlds);

PtrList<surfaceVectorField> svFlds;
ReadFields(mesh, objects, svFlds);

PtrList<surfaceSphericalTensorField> sstFlds;
ReadFields(mesh, objects, sstFlds);
if (fields) Info<< "Reading geometric fields" << nl << endl;

PtrList<surfaceSymmTensorField> ssymtFlds;
ReadFields(mesh, objects, ssymtFlds);
#include "readVolFields.H"
#include "readSurfaceFields.H"
#include "readPointFields.H"

PtrList<surfaceTensorField> stFlds;
ReadFields(mesh, objects, stFlds);
Info<< endl;


// Topo changes container
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -117,24 +117,15 @@ Notes:
\*---------------------------------------------------------------------------*/

#include "argList.H"
#include "fvMesh.H"
#include "polyTopoChange.H"
#include "OFstream.H"
#include "meshTools.H"
#include "mappedWallPolyPatch.H"
#include "createShellMesh.H"
#include "syncTools.H"
#include "cyclicPolyPatch.H"
#include "wedgePolyPatch.H"
#include "nonuniformTransformCyclicPolyPatch.H"
#include "extrudeModel.H"
#include "globalIndex.H"
#include "faceSet.H"

#include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H"
//#include "ReadFields.H"
#include "fvMeshTools.H"
#include "OBJstream.H"
#include "PatchTools.H"
@@ -1599,55 +1590,6 @@ int main(int argc, char *argv[])
}




//// Read objects in time directory
// IOobjectList objects(mesh, runTime.timeName());
//
//// Read vol fields.
//
// PtrList<volScalarField> vsFlds;
// ReadFields(mesh, objects, vsFlds);
//
// PtrList<volVectorField> vvFlds;
// ReadFields(mesh, objects, vvFlds);
//
// PtrList<volSphericalTensorField> vstFlds;
// ReadFields(mesh, objects, vstFlds);
//
// PtrList<volSymmTensorField> vsymtFlds;
// ReadFields(mesh, objects, vsymtFlds);
//
// PtrList<volTensorField> vtFlds;
// ReadFields(mesh, objects, vtFlds);
//
//// Read surface fields.
//
// PtrList<surfaceScalarField> ssFlds;
// ReadFields(mesh, objects, ssFlds);
//
// PtrList<surfaceVectorField> svFlds;
// ReadFields(mesh, objects, svFlds);
//
// PtrList<surfaceSphericalTensorField> sstFlds;
// ReadFields(mesh, objects, sstFlds);
//
// PtrList<surfaceSymmTensorField> ssymtFlds;
// ReadFields(mesh, objects, ssymtFlds);
//
// PtrList<surfaceTensorField> stFlds;
// ReadFields(mesh, objects, stFlds);
//
//// Read point fields.
//
// PtrList<pointScalarField> psFlds;
// ReadFields(pointMesh::New(mesh), objects, psFlds);
//
// PtrList<pointVectorField> pvFlds;
// ReadFields(pointMesh::New(mesh), objects, pvFlds);



// Create dummy fv* files
createDummyFvMeshFiles(mesh, shellRegionName);

@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -502,37 +502,9 @@ int main(int argc, char *argv[])

if (fields) Info<< "Reading geometric fields" << nl << endl;

PtrList<volScalarField> vsFlds;
if (fields) ReadFields(mesh, objects, vsFlds);

PtrList<volVectorField> vvFlds;
if (fields) ReadFields(mesh, objects, vvFlds);

PtrList<volSphericalTensorField> vstFlds;
if (fields) ReadFields(mesh, objects, vstFlds);

PtrList<volSymmTensorField> vsymtFlds;
if (fields) ReadFields(mesh, objects, vsymtFlds);

PtrList<volTensorField> vtFlds;
if (fields) ReadFields(mesh, objects, vtFlds);

PtrList<surfaceScalarField> ssFlds;
if (fields) ReadFields(mesh, objects, ssFlds);

PtrList<surfaceVectorField> svFlds;
if (fields) ReadFields(mesh, objects, svFlds);

PtrList<surfaceSphericalTensorField> sstFlds;
if (fields) ReadFields(mesh, objects, sstFlds);

PtrList<surfaceSymmTensorField> ssymtFlds;
if (fields) ReadFields(mesh, objects, ssymtFlds);

PtrList<surfaceTensorField> stFlds;
if (fields) ReadFields(mesh, objects, stFlds);


#include "readVolFields.H"
#include "readSurfaceFields.H"
// #include "readPointFields.H"


// Creating (if necessary) faceZones
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -60,6 +60,7 @@ Description
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H"

using namespace Foam;

@@ -278,35 +279,11 @@ int main(int argc, char *argv[])

if (fields) Info<< "Reading geometric fields" << nl << endl;

PtrList<volScalarField> vsFlds;
if (fields) ReadFields(mesh, objects, vsFlds);
#include "readVolFields.H"
#include "readSurfaceFields.H"
#include "readPointFields.H"

PtrList<volVectorField> vvFlds;
if (fields) ReadFields(mesh, objects, vvFlds);

PtrList<volSphericalTensorField> vstFlds;
if (fields) ReadFields(mesh, objects, vstFlds);

PtrList<volSymmTensorField> vsymtFlds;
if (fields) ReadFields(mesh, objects, vsymtFlds);

PtrList<volTensorField> vtFlds;
if (fields) ReadFields(mesh, objects, vtFlds);

PtrList<surfaceScalarField> ssFlds;
if (fields) ReadFields(mesh, objects, ssFlds);

PtrList<surfaceVectorField> svFlds;
if (fields) ReadFields(mesh, objects, svFlds);

PtrList<surfaceSphericalTensorField> sstFlds;
if (fields) ReadFields(mesh, objects, sstFlds);

PtrList<surfaceSymmTensorField> ssymtFlds;
if (fields) ReadFields(mesh, objects, ssymtFlds);

PtrList<surfaceTensorField> stFlds;
if (fields) ReadFields(mesh, objects, stFlds);
Info<< endl;


// Mesh change engine

0 comments on commit 66c26af

Please sign in to comment.
You can’t perform that action at this time.