Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (183)
Showing
with 660 additions and 253 deletions
......@@ -45,6 +45,8 @@ Description
int main(int argc, char *argv[])
{
argList::noParallel();
#include "setRootCase.H"
#include "createTime.H"
......
/home/dm2/henry/OpenFOAM/OpenFOAM-dev/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam
Making dependency list for source file reactingMultiphaseEulerFoam.C
clang++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions -O3 -DNoRepository -ftemplate-depth-100 -ImultiphaseSystem/lnInclude -I../phaseSystems/lnInclude -I../interfacialModels/lnInclude -I../interfacialCompositionModels/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/thermophysicalModels/basic/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/transportModels/compressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/compressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/phaseCompressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/finiteVolume/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/fvOptions/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/meshTools/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/sampling/lnInclude -IlnInclude -I. -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -c reactingMultiphaseEulerFoam.C -o /home/dm2/henry/OpenFOAM/OpenFOAM-dev/platforms/linux64ClangDPInt32Opt/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.o
clang++ -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-c++11-extensions -O3 -DNoRepository -ftemplate-depth-100 -ImultiphaseSystem/lnInclude -I../phaseSystems/lnInclude -I../interfacialModels/lnInclude -I../interfacialCompositionModels/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/thermophysicalModels/basic/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/transportModels/compressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/turbulenceModels/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/compressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/TurbulenceModels/phaseCompressible/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/finiteVolume/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/fvOptions/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/meshTools/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/sampling/lnInclude -IlnInclude -I. -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude -I/home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OSspecific/POSIX/lnInclude -fPIC -Xlinker --add-needed /home/dm2/henry/OpenFOAM/OpenFOAM-dev/platforms/linux64ClangDPInt32Opt/applications/solvers/multiphase/reactingEulerFoam/reactingMultiphaseEulerFoam/reactingMultiphaseEulerFoam.o -L/home/dm2/henry/OpenFOAM/OpenFOAM-dev/platforms/linux64ClangDPInt32Opt/lib \
-lreactingPhaseSystem -lreactingMultiphaseSystem -lreactingEulerianInterfacialModels -lreactingEulerianInterfacialCompositionModels -lmultiphaseReactingTurbulenceModels -lfiniteVolume -lfvOptions -lmeshTools -lsampling -lOpenFOAM -ldl \
-lm -o /home/dm2/henry/OpenFOAM/OpenFOAM-dev/platforms/linux64ClangDPInt32Opt/bin/reactingMultiphaseEulerFoam
......@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
}
}
#include "write.H"
runTime.write();
Info<< "ExecutionTime = "
<< runTime.elapsedCpuTime()
......
if (runTime.outputTime())
{
volVectorField Ur
(
IOobject
(
"Ur",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
U1 - U2
);
runTime.write();
}
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -493,21 +493,30 @@ int main(int argc, char *argv[])
// new patchID to neighbour processor)
// - number of new patches (nPatches)
labelList sidePatchID;
labelList edgePatchID;
labelList edgeZoneID;
boolList edgeFlip;
labelList inflateFaceID;
label nPatches;
Map<label> nbrProcToPatch;
Map<label> patchToNbrProc;
addPatchCellLayer::calcSidePatch
addPatchCellLayer::calcExtrudeInfo
(
true, // for internal edges get zone info from any face
mesh,
globalFaces,
edgeGlobalFaces,
extrudePatch,
sidePatchID,
edgePatchID,
nPatches,
nbrProcToPatch,
patchToNbrProc
patchToNbrProc,
edgeZoneID,
edgeFlip,
inflateFaceID
);
......@@ -659,7 +668,12 @@ int main(int argc, char *argv[])
ratio, // expansion ratio
extrudePatch, // patch faces to extrude
sidePatchID, // if boundary edge: patch to use
edgePatchID, // if boundary edge: patch for extruded face
edgeZoneID, // optional zone for extruded face
edgeFlip,
inflateFaceID, // mesh face that zone/patch info is from
exposedPatchID, // if new mesh: patches for exposed faces
nFaceLayers,
nPointLayers,
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -1075,6 +1075,26 @@ int main(int argc, char *argv[])
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
// Optionally read limit shells
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
const dictionary limitDict(refineDict.subOrEmptyDict("limitRegions"));
if (!limitDict.empty())
{
Info<< "Reading limit shells." << endl;
}
shellSurfaces limitShells(allGeometry, limitDict);
if (!limitDict.empty())
{
Info<< "Read refinement shells in = "
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
}
// Read feature meshes
// ~~~~~~~~~~~~~~~~~~~
......@@ -1105,7 +1125,8 @@ int main(int argc, char *argv[])
overwrite, // overwrite mesh files?
surfaces, // for surface intersection refinement
features, // for feature edges/point based refinement
shells // for volume (inside/outside) refinement
shells, // for volume (inside/outside) refinement
limitShells // limit of volume refinement
);
Info<< "Calculated surface intersections in = "
<< mesh.time().cpuTimeIncrement() << " s" << nl << endl;
......@@ -1121,6 +1142,38 @@ int main(int argc, char *argv[])
);
// Refinement parameters
const refinementParameters refineParams(refineDict);
// Snap parameters
const snapParameters snapParams(snapDict);
// Add all the cellZones and faceZones
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 1. cellZones relating to surface (faceZones added later)
const labelList namedSurfaces
(
surfaceZonesInfo::getNamedSurfaces(surfaces.surfZones())
);
labelList surfaceToCellZone = surfaceZonesInfo::addCellZonesToMesh
(
surfaces.surfZones(),
namedSurfaces,
mesh
);
// 2. cellZones relating to locations
refineParams.addCellZonesToMesh(mesh);
// Add all the surface regions as patches
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......@@ -1128,6 +1181,8 @@ int main(int argc, char *argv[])
// (faceZone surfaces)
labelList globalToMasterPatch;
labelList globalToSlavePatch;
{
Info<< nl
<< "Adding patches for surface regions" << nl
......@@ -1148,6 +1203,7 @@ int main(int argc, char *argv[])
const labelList& surfaceGeometry = surfaces.surfaces();
const PtrList<dictionary>& surfacePatchInfo = surfaces.patchInfo();
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
forAll(surfaceGeometry, surfI)
{
......@@ -1157,7 +1213,9 @@ int main(int argc, char *argv[])
Info<< surfaces.names()[surfI] << ':' << nl << nl;
if (surfaces.surfZones()[surfI].faceZoneName().empty())
const word& fzName = surfaces.surfZones()[surfI].faceZoneName();
if (fzName.empty())
{
// 'Normal' surface
forAll(regNames, i)
......@@ -1188,7 +1246,7 @@ int main(int argc, char *argv[])
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(20) << pbm[patchI].type()
<< setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
......@@ -1228,7 +1286,7 @@ int main(int argc, char *argv[])
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(20) << pbm[patchI].type()
<< setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
......@@ -1260,12 +1318,27 @@ int main(int argc, char *argv[])
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(20) << pbm[patchI].type()
<< setw(30) << slaveName << nl;
globalToSlavePatch[globalRegionI] = patchI;
}
}
// For now: have single faceZone per surface. Use first
// region in surface for patch for zoneing
if (regNames.size())
{
label globalRegionI = surfaces.globalRegion(surfI, 0);
meshRefiner.addFaceZone
(
fzName,
pbm[globalToMasterPatch[globalRegionI]].name(),
pbm[globalToSlavePatch[globalRegionI]].name(),
surfaces.surfZones()[surfI].faceType()
);
}
}
Info<< nl;
......@@ -1275,10 +1348,85 @@ int main(int argc, char *argv[])
}
// Add all information for all the remaining faceZones
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HashTable<Pair<word> > faceZoneToPatches;
forAll(mesh.faceZones(), zoneI)
{
const word& fzName = mesh.faceZones()[zoneI].name();
label mpI, spI;
surfaceZonesInfo::faceZoneType fzType;
bool hasInfo = meshRefiner.getFaceZoneInfo(fzName, mpI, spI, fzType);
if (!hasInfo)
{
// faceZone does not originate from a surface but presumably
// from a cellZone pair instead
string::size_type i = fzName.find("_to_");
if (i != string::npos)
{
word cz0 = fzName.substr(0, i);
word cz1 = fzName.substr(i+4, fzName.size()-i+4);
word slaveName(cz1 + "_to_" + cz0);
faceZoneToPatches.insert(fzName, Pair<word>(fzName, slaveName));
}
else
{
// Add as fzName + fzName_slave
const word slaveName = fzName + "_slave";
faceZoneToPatches.insert(fzName, Pair<word>(fzName, slaveName));
}
}
}
if (faceZoneToPatches.size())
{
autoRefineDriver::addFaceZones
(
meshRefiner,
refineParams,
faceZoneToPatches
);
}
// Re-do intersections on meshed boundaries since they use an extrapolated
// other side
{
const labelList adaptPatchIDs(meshRefiner.meshedPatches());
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
label nFaces = 0;
forAll(adaptPatchIDs, i)
{
nFaces += pbm[adaptPatchIDs[i]].size();
}
labelList faceLabels(nFaces);
nFaces = 0;
forAll(adaptPatchIDs, i)
{
const polyPatch& pp = pbm[adaptPatchIDs[i]];
forAll(pp, i)
{
faceLabels[nFaces++] = pp.start()+i;
}
}
meshRefiner.updateIntersections(faceLabels);
}
// Parallel
// ~~~~~~~~
// Decomposition
// Construct decomposition engine. Note: cannot use decompositionModel
// MeshObject since we're clearing out the mesh inside the mesh generation.
autoPtr<decompositionMethod> decomposerPtr
(
decompositionMethod::New
......@@ -1312,14 +1460,17 @@ int main(int argc, char *argv[])
const Switch wantSnap(meshDict.lookup("snap"));
const Switch wantLayers(meshDict.lookup("addLayers"));
// Refinement parameters
const refinementParameters refineParams(refineDict);
// Snap parameters
const snapParameters snapParams(snapDict);
const Switch mergePatchFaces
(
meshDict.lookupOrDefault("mergePatchFaces", true)
);
// Layer addition parameters
const layerParameters layerParams(layerDict, mesh.boundaryMesh());
if (!mergePatchFaces)
{
Info<< "Not merging patch-faces of cell to preserve"
<< " (split)hex cell shape."
<< nl << endl;
}
if (wantRefine)
......@@ -1348,6 +1499,7 @@ int main(int argc, char *argv[])
refineParams,
snapParams,
refineParams.handleSnapProblems(),
mergePatchFaces, // merge co-planar faces
motionDict
);
......@@ -1387,6 +1539,7 @@ int main(int argc, char *argv[])
(
snapDict,
motionDict,
mergePatchFaces,
curvature,
planarAngle,
snapParams
......@@ -1408,6 +1561,9 @@ int main(int argc, char *argv[])
{
cpuTime timer;
// Layer addition parameters
const layerParameters layerParams(layerDict, mesh.boundaryMesh());
autoLayerDriver layerDriver
(
meshRefiner,
......@@ -1433,6 +1589,7 @@ int main(int argc, char *argv[])
layerDict,
motionDict,
layerParams,
mergePatchFaces,
preBalance,
decomposer,
distributor
......
......@@ -71,6 +71,11 @@ geometry
}
};
// Optional: avoid patch-face merging. Allows mesh to be used for
// refinement/unrefinement
//mergePatchFaces off; // default on
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
......@@ -90,10 +95,10 @@ castellatedMeshControls
// actually be a lot less.
maxGlobalCells 2000000;
// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
// The surface refinement loop might spend lots of iterations refining just
// a few cells. This setting will cause refinement to stop if
// <= minimumRefine cells are selected for refinement. Note: it will
// at least do one iteration (unless the number of cells to refine is 0)
minRefinementCells 0;
// Allow a certain level of imbalance during refining
......@@ -177,7 +182,7 @@ castellatedMeshControls
// how to select the cells that are in the cellZone
// (inside / outside / specified insidePoint)
// The orientation of the faceZone is
// - if on cellZone(s) : point out of (maximum) cellZone
// - if on cellZone(s) : point out of (minimum) cellZone
// - if freestanding : oriented according to surface
//faceZone sphere;
......@@ -239,33 +244,107 @@ castellatedMeshControls
}
//sphere.stl
//{
// mode distance;
// levels ((1.0 5) (2.0 3));
// mode inside;
// levels ((1.0 4));
// // Optional override of uniform refinement level such
// // that in small gaps we're getting more cells.
// // The specification is
// // - numGapCells : minimum number of cells in the gap
// // - minLevel : min refinement level at which to kick in
// // - maxLevel : upper refinement level
// // All three settings can be overridden on a surface by
// // surface basis in the refinementSurfaces section.
// gapLevel (<numGapCells> <minLevel> <maxlevel>);
//}
}
// Limit refinement in geometric region
limitRegions
{
}
// Mesh selection
// ~~~~~~~~~~~~~~
// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// section reachable from the location(s)InMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (5 0.28 0.43);
//
// There are two different ways of specifying the regions to keep:
// 1. a single locationInMesh. All the 'zoned' surfaces are marked as such
// in the refinementSurfaces with the faceZone and cellZone keywords.
//
// or
//
// 2. multiple locationsInMesh, with per location the name of the cellZone.
// This uses walking to determine zones and automatically creates
// faceZones on the outside of cellZones.
// Ad 1. Specify a single location and how to treat faces inbetween
// cellZones
locationInMesh (5 0.28 0.43);
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
// 2. Specify multiple locations with optional cellZones for the
// regions. faceZones are automatically constructed from the
// names of the cellZones: <cellZoneA> _to_ <cellZoneB>
// where the cellZoneA is the lowest numbered cellZone (non-cellZone
// cells are in a special region called "none" which is always
// last).
locationsInMesh
(
((-0.09 -0.039 -0.049) bottomAir) // cellZone 0
((-0.09 0.009 -0.049) topAir) // cellZone 1
((-0.09 0.001 -0.049) leftSolid) // cellZone 2
((0.02 0.001 -0.049) rightSolid) // cellZone 3
((-0.001 -0.039 0.0015) heater) // cellZone 4
);
// Per synthesised faceZone name the faceType and type of baffles to
// create
faceZoneControls
{
bottomAir_to_heater
{
// Optional specification of patch type (default is wall). No
// constraint types (cyclic, symmetry) etc. are allowed.
patchInfo
{
type patch;
inGroups (patchPatches);
}
faceType baffle;
}
}
// Optional locations that should not be reachable from
// location(s)InMesh
locationsOutsideMesh ((100 100 100));
// Optional: do not remove cells likely to give snapping problems
// handleSnapProblems false;
// Optional: switch off topological test for cells to-be-squashed
// and use geometric test instead
//useTopologicalSnapDetection false;
// Optional: do not refine surface cells with opposite faces of
// differing refinement levels
//interfaceRefine false;
}
// Settings for the snapping.
......@@ -275,6 +354,11 @@ snapControls
// to surface
nSmoothPatch 3;
// Optional: number of smoothing iterations for internal points on
// refinement interfaces. This will reduce non-orthogonality on
// refinement interfaces.
//nSmoothInternal $nSmoothPatch;
// Maximum relative distance for points to be attracted by surface.
// True distance is this factor times local maximum edge length.
// Note: changed(corrected) w.r.t 17x! (17x used 2* tolerance)
......@@ -287,6 +371,11 @@ snapControls
// before upon reaching a correct mesh.
nRelaxIter 5;
// (wip) disable snapping to opposite near surfaces (revert to 22x
// behaviour)
// detectNearSurfacesSnap false;
// Feature snapping
// Number of feature edge snapping iterations.
......@@ -305,8 +394,28 @@ snapControls
multiRegionFeatureSnap false;
// wip: disable snapping to opposite near surfaces (revert to 22x behaviour)
// detectNearSurfacesSnap false;
//- When to run face splitting (never at first iteration, always
// at last iteration). Is interval. Default -1 (disabled)
//nFaceSplitInterval 5;
// (wip) Optional for explicit feature snapping:
//- Detect baffle edges. Default is true.
//detectBaffles false;
//- Erase attraction close to feature point. Default is false.
//releasePoints true;
//- Walk along feature edges, adding missing ones. Default is true.
//stringFeatures false;
//- If diagonal attraction also attract other face points. Default is
// false
//avoidDiagonal true;
//- When splitting what concave faces to leave intact. Default is 45
// degrees.
//concaveAngle 30;
//- When splitting the minimum area ratio of faces. If face split
// causes ratio of area less than this do not split. Default is 0.3
//minAreaRatio 0.3;
}
// Settings for the layer addition.
......@@ -350,10 +459,10 @@ addLayersControls
// cannot be above minThickness do not add layer.
// If relativeSizes this is relative to undistorted size of cell
// outside layer..
minThickness 0.25;
minThickness 0.1;
// Per final patch (so not geometry!) the layer information
// Per final patch or faceZone (so not geometry!) the layer information
// Note: This behaviour changed after 21x. Any non-mentioned patches
// now slide unless:
// - nSurfaceLayers is explicitly mentioned to be 0.
......@@ -397,6 +506,10 @@ addLayersControls
// are perpendicular
featureAngle 130;
// When to merge patch faces. Default is featureAngle. Useful when
// featureAngle is large.
//mergePatchFacesAngle 45;
// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;
......@@ -433,8 +546,10 @@ addLayersControls
// default is 0.
//nSmoothDisplacement 90;
// (wip)Optional: do not extrude a point if none of the surrounding points is
// not extruded. Default is false.
// (wip)Optional: do not extrude any point where
// (false) : all surrounding faces are not fully extruded
// (true) : all surrounding points are not extruded
// Default is false.
//detectExtrusionIsland true;
......@@ -449,7 +564,8 @@ addLayersControls
// before upon reaching a correct mesh.
nRelaxIter 5;
// Create buffer region for new layer terminations
// Create buffer region for new layer terminations, i.e. gradually
// step down number of layers. Set to <0 to terminate layer in one go.
nBufferCellsNoExtrude 0;
// Overall max number of layer addition iterations. The mesher will
......
......@@ -493,12 +493,15 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry)
// Min length
scalar minDistSqr = magSqr(1e-6 * globalBb.span());
// Non-empty directions
// Geometric directions
const Vector<label> validDirs = (mesh.geometricD() + Vector<label>::one)/2;
Info<< " Mesh (non-empty, non-wedge) directions " << validDirs << endl;
Info<< " Mesh has " << mesh.nGeometricD()
<< " geometric (non-empty/wedge) directions " << validDirs << endl;
// Solution directions
const Vector<label> solDirs = (mesh.solutionD() + Vector<label>::one)/2;
Info<< " Mesh (non-empty) directions " << solDirs << endl;
Info<< " Mesh has " << mesh.nSolutionD()
<< " solution (non-empty) directions " << solDirs << endl;
if (mesh.nGeometricD() < 3)
{
......
......@@ -133,7 +133,11 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << endl;
mesh.update();
for (int i = 0; i<2; i++)
{
mesh.update();
}
mesh.checkMesh(true);
if (checkAMI)
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -202,6 +202,7 @@ void subsetSurfaceFields
(
const fvMesh& mesh,
const fvMesh& subMesh,
const labelList& cellMap,
const labelList& faceMap,
const labelHashSet& addedPatches
)
......@@ -225,6 +226,7 @@ void subsetSurfaceFields
fld,
subMesh,
patchMap,
cellMap,
faceMap
)
);
......@@ -830,6 +832,7 @@ void createAndWriteRegion
(
mesh,
newMesh(),
map().cellMap(),
map().faceMap(),
addedPatches
);
......@@ -837,6 +840,7 @@ void createAndWriteRegion
(
mesh,
newMesh(),
map().cellMap(),
map().faceMap(),
addedPatches
);
......@@ -844,6 +848,7 @@ void createAndWriteRegion
(
mesh,
newMesh(),
map().cellMap(),
map().faceMap(),
addedPatches
);
......@@ -851,6 +856,7 @@ void createAndWriteRegion
(
mesh,
newMesh(),
map().cellMap(),
map().faceMap(),
addedPatches
);
......@@ -858,6 +864,7 @@ void createAndWriteRegion
(
mesh,
newMesh(),
map().cellMap(),
map().faceMap(),
addedPatches
);
......
......@@ -2,6 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/parallel/decompose/decompose/lnInclude \
-I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
......@@ -12,5 +13,6 @@ EXE_LIBS = \
-lgenericPatchFields \
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
-llagrangian \
-ldynamicMesh \
-lmeshTools \
-lregionModels
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -96,6 +96,7 @@ Usage
#include "fvFieldDecomposer.H"
#include "pointFieldDecomposer.H"
#include "lagrangianFieldDecomposer.H"
#include "decompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -142,6 +143,12 @@ int main(int argc, char *argv[])
);
argList::noParallel();
Foam::argList::addOption
(
"decomposeParDict",
"file",
"read decomposePar dictionary from specified location"
);
#include "addRegionOption.H"
argList::addBoolOption
(
......@@ -199,6 +206,17 @@ int main(int argc, char *argv[])
instantList times = timeSelector::selectIfPresent(runTime, args);
// Allow override of decomposeParDict location
fileName decompDictFile;
if (args.optionReadIfPresent("decomposeParDict", decompDictFile))
{
if (isDir(decompDictFile))
{
decompDictFile = decompDictFile/"decomposeParDict";
}
}
wordList regionNames;
wordList regionDirs;
if (allRegions)
......@@ -260,21 +278,27 @@ int main(int argc, char *argv[])
++nProcs;
}
// get requested numberOfSubdomains
// get requested numberOfSubdomains. Note: have no mesh yet so
// cannot use decompositionModel::New
const label nDomains = readLabel
(
IOdictionary
(
IOobject
decompositionModel::selectIO
(
"decomposeParDict",
runTime.time().system(),
regionDir, // use region if non-standard
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
IOobject
(
"decomposeParDict",
runTime.time().system(),
regionDir, // use region if non-standard
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
),
decompDictFile
)
).lookup("numberOfSubdomains")
);
......@@ -288,8 +312,7 @@ int main(int argc, char *argv[])
<< nProcs << " domains"
<< nl
<< "instead of " << nDomains
<< " domains as specified in decomposeParDict"
<< nl
<< " domains as specified in decomposeParDict" << nl
<< exit(FatalError);
}
}
......@@ -351,7 +374,8 @@ int main(int argc, char *argv[])
IOobject::NO_READ,
IOobject::NO_WRITE,
false
)
),
decompDictFile
);
// Decompose the mesh
......@@ -447,15 +471,15 @@ int main(int argc, char *argv[])
// Construct the vol fields
// ~~~~~~~~~~~~~~~~~~~~~~~~
PtrList<volScalarField> volScalarFields;
readFields(mesh, objects, volScalarFields);
readFields(mesh, objects, volScalarFields, false);
PtrList<volVectorField> volVectorFields;
readFields(mesh, objects, volVectorFields);
readFields(mesh, objects, volVectorFields, false);
PtrList<volSphericalTensorField> volSphericalTensorFields;
readFields(mesh, objects, volSphericalTensorFields);
readFields(mesh, objects, volSphericalTensorFields, false);
PtrList<volSymmTensorField> volSymmTensorFields;
readFields(mesh, objects, volSymmTensorFields);
readFields(mesh, objects, volSymmTensorFields, false);
PtrList<volTensorField> volTensorFields;
readFields(mesh, objects, volTensorFields);
readFields(mesh, objects, volTensorFields, false);
// Construct the dimensioned fields
......@@ -476,15 +500,15 @@ int main(int argc, char *argv[])
// Construct the surface fields
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PtrList<surfaceScalarField> surfaceScalarFields;
readFields(mesh, objects, surfaceScalarFields);
readFields(mesh, objects, surfaceScalarFields, false);
PtrList<surfaceVectorField> surfaceVectorFields;
readFields(mesh, objects, surfaceVectorFields);
readFields(mesh, objects, surfaceVectorFields, false);
PtrList<surfaceSphericalTensorField> surfaceSphericalTensorFields;
readFields(mesh, objects, surfaceSphericalTensorFields);
readFields(mesh, objects, surfaceSphericalTensorFields, false);
PtrList<surfaceSymmTensorField> surfaceSymmTensorFields;
readFields(mesh, objects, surfaceSymmTensorFields);
readFields(mesh, objects, surfaceSymmTensorFields, false);
PtrList<surfaceTensorField> surfaceTensorFields;
readFields(mesh, objects, surfaceTensorFields);
readFields(mesh, objects, surfaceTensorFields, false);
// Construct the point fields
......@@ -492,15 +516,15 @@ int main(int argc, char *argv[])
const pointMesh& pMesh = pointMesh::New(mesh);
PtrList<pointScalarField> pointScalarFields;
readFields(pMesh, objects, pointScalarFields);
readFields(pMesh, objects, pointScalarFields, false);
PtrList<pointVectorField> pointVectorFields;
readFields(pMesh, objects, pointVectorFields);
readFields(pMesh, objects, pointVectorFields, false);
PtrList<pointSphericalTensorField> pointSphericalTensorFields;
readFields(pMesh, objects, pointSphericalTensorFields);
readFields(pMesh, objects, pointSphericalTensorFields, false);
PtrList<pointSymmTensorField> pointSymmTensorFields;
readFields(pMesh, objects, pointSymmTensorFields);
readFields(pMesh, objects, pointSymmTensorFields, false);
PtrList<pointTensorField> pointTensorFields;
readFields(pMesh, objects, pointTensorFields);
readFields(pMesh, objects, pointTensorFields, false);
// Construct the Lagrangian fields
......@@ -820,16 +844,6 @@ int main(int argc, char *argv[])
processorDb.setTime(runTime);
// remove files remnants that can cause horrible problems
// - mut and nut are used to mark the new turbulence models,
// their existence prevents old models from being upgraded
{
fileName timeDir(processorDb.path()/processorDb.timeName());
rm(timeDir/"mut");
rm(timeDir/"nut");
}
// read the mesh
if (!procMeshList.set(procI))
{
......
......@@ -17,11 +17,61 @@ FoamFile
numberOfSubdomains 2;
// Optional decomposition constraints
//constraints
//{
// preserveBaffles
// {
// //- Keep owner and neighbour of baffles on same processor (i.e.
// // keep it detectable as a baffle). Baffles are two boundary face
// // sharing the same points
// type preserveBaffles;
// }
// preserveFaceZones
// {
// //- Keep owner and neighbour on same processor for faces in zones
// type preserveFaceZones;
// zones (".*");
// }
// preservePatches
// {
// //- Keep owner and neighbour on same processor for faces in patches
// // (only makes sense for cyclic patches. Not suitable for e.g.
// // cyclicAMI since these are not coupled on the patch level. Use
// // singleProcessorFaceSets for those)
// type preservePatches;
// patches (".*");
// }
// singleProcessorFaceSets
// {
// //- Keep all of faceSet on a single processor. This puts all cells
// // connected with a point, edge or face on the same processor.
// // (just having face connected cells might not guarantee a balanced
// // decomposition)
// // The processor can be -1 (the decompositionMethod chooses the
// // processor for a good load balance) or explicitly provided (upsets
// // balance)
// type singleProcessorFaceSets;
// singleProcessorFaceSets ((f1 -1));
// }
// refinementHistory
// {
// //- Decompose cells such that all cell originating from single cell
// // end up on same processor
// type refinementHistory;
// }
//}
// Deprecated form of specifying decomposition constraints:
//- Keep owner and neighbour on same processor for faces in zones:
// preserveFaceZones (heater solid1 solid3);
//- Keep owner and neighbour on same processor for faces in patches:
// (makes sense only for cyclic patches)
// (makes sense only for cyclic patches. Not suitable for e.g. cyclicAMI
// since these are not coupled on the patch level. Use
// singleProcessorFaceSets for those)
//preservePatches (cyclic_half0 cyclic_half1);
//- Keep all of faceSet on a single processor. This puts all cells
......@@ -32,12 +82,13 @@ numberOfSubdomains 2;
// for a good load balance) or explicitly provided (upsets balance).
//singleProcessorFaceSets ((f0 -1));
//- Keep owner and neighbour of baffles on same processor (i.e. keep it
// detectable as a baffle). Baffles are two boundary face sharing the
// same points.
//preserveBaffles true;
//- Use the volScalarField named here as a weight for each cell in the
// decomposition. For example, use a particle population field to decompose
// for a balanced number of particles in a lagrangian simulation.
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -31,14 +31,14 @@ License
#include "fvMesh.H"
#include "OSspecific.H"
#include "Map.H"
#include "globalMeshData.H"
#include "DynamicList.H"
#include "fvFieldDecomposer.H"
#include "IOobjectList.H"
#include "cellSet.H"
#include "faceSet.H"
#include "pointSet.H"
#include "uniformDimensionedFields.H"
#include "decompositionModel.H"
#include "hexRef8Data.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
......@@ -69,7 +69,12 @@ void Foam::domainDecomposition::mark
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::domainDecomposition::domainDecomposition(const IOobject& io)
// from components
Foam::domainDecomposition::domainDecomposition
(
const IOobject& io,
const fileName& decompDictFile
)
:
fvMesh(io),
facesInstancePointsPtr_
......@@ -90,18 +95,18 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
)
: NULL
),
decompositionDict_
decompDictFile_(decompDictFile),
nProcs_
(
IOobject
readInt
(
"decomposeParDict",
time().system(),
*this,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE
decompositionModel::New
(
*this,
decompDictFile
).lookup("numberOfSubdomains")
)
),
nProcs_(readInt(decompositionDict_.lookup("numberOfSubdomains"))),
distributed_(false),
cellToProc_(nCells()),
procPointAddressing_(nProcs_),
......@@ -115,7 +120,11 @@ Foam::domainDecomposition::domainDecomposition(const IOobject& io)
procProcessorPatchSubPatchIDs_(nProcs_),
procProcessorPatchSubPatchStarts_(nProcs_)
{
decompositionDict_.readIfPresent("distributed", distributed_);
decompositionModel::New
(
*this,
decompDictFile
).readIfPresent("distributed", distributed_);
}
......@@ -195,57 +204,20 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
}
autoPtr<labelIOList> cellLevelPtr;
{
IOobject io
(
"cellLevel",
facesInstance(),
polyMesh::meshSubDir,
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
cellLevelPtr.reset(new labelIOList(io));
}
}
autoPtr<labelIOList> pointLevelPtr;
{
IOobject io
(
"pointLevel",
facesInstance(),
polyMesh::meshSubDir,
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
pointLevelPtr.reset(new labelIOList(io));
}
}
autoPtr<uniformDimensionedScalarField> level0EdgePtr;
{
IOobject io
// Load refinement data (if any)
hexRef8Data baseMeshData
(
IOobject
(
"level0Edge",
"dummy",
facesInstance(),
polyMesh::meshSubDir,
*this,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (io.headerOk())
{
Info<< "Reading hexRef8 data : " << io.name() << endl;
level0EdgePtr.reset(new uniformDimensionedScalarField(io));
}
}
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
);
......@@ -816,8 +788,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
}
}
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);
// Set the precision of the points data to be min 10
IOstream::defaultPrecision(max(10u, IOstream::defaultPrecision()));
procMesh.write();
......@@ -887,64 +859,23 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
}
// hexRef8 data
if (cellLevelPtr.valid())
{
labelIOList
(
IOobject
(
cellLevelPtr().name(),
facesInstance(),
polyMesh::meshSubDir,
procMesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
UIndirectList<label>
(
cellLevelPtr(),
procCellAddressing_[procI]
)()
).write();
}
if (pointLevelPtr.valid())
{
labelIOList
(
IOobject
(
pointLevelPtr().name(),
facesInstance(),
polyMesh::meshSubDir,
procMesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
UIndirectList<label>
(
pointLevelPtr(),
procPointAddressing_[procI]
)()
).write();
}
if (level0EdgePtr.valid())
{
uniformDimensionedScalarField
// Optional hexRef8 data
hexRef8Data
(
IOobject
(
IOobject
(
level0EdgePtr().name(),
facesInstance(),
polyMesh::meshSubDir,
procMesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
level0EdgePtr()
).write();
}
"dummy",
facesInstance(),
polyMesh::meshSubDir,
procMesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
baseMeshData,
procCellAddressing_[procI],
procPointAddressing_[procI]
).write();
// Statistics
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -61,8 +61,8 @@ class domainDecomposition
//- Optional: points at the facesInstance
autoPtr<pointIOField> facesInstancePointsPtr_;
//- Mesh decomposition control dictionary
IOdictionary decompositionDict_;
//- Optional non-standard file for decomposeParDict
const fileName decompDictFile_;
//- Number of processors in decomposition
label nProcs_;
......@@ -159,8 +159,13 @@ public:
// Constructors
//- Construct from IOobject
domainDecomposition(const IOobject& io);
//- Construct from IOobjects (for mesh and optional non-standard
// decomposeParDict location)
domainDecomposition
(
const IOobject& io,
const fileName& decompDictFile = ""
);
//- Destructor
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -30,6 +30,7 @@ License
#include "regionSplit.H"
#include "Tuple2.H"
#include "faceSet.H"
#include "decompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -39,15 +40,17 @@ void Foam::domainDecomposition::distributeCells()
cpuTime decompositionTime;
autoPtr<decompositionMethod> decomposePtr = decompositionMethod::New
const decompositionModel& method = decompositionModel::New
(
decompositionDict_
*this,
decompDictFile_
);
scalarField cellWeights;
if (decompositionDict_.found("weightField"))
if (method.found("weightField"))
{
word weightName = decompositionDict_.lookup("weightField");
word weightName = method.lookup("weightField");
volScalarField weights
(
......@@ -64,7 +67,7 @@ void Foam::domainDecomposition::distributeCells()
cellWeights = weights.internalField();
}
cellToProc_ = decomposePtr().decompose(*this, cellWeights);
cellToProc_ = method.decomposer().decompose(*this, cellWeights);
Info<< "\nFinished decomposition in "
<< decompositionTime.elapsedCpuTime()
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -23,18 +23,22 @@ License
\*---------------------------------------------------------------------------*/
#include "GeometricField.H"
#include "readFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Mesh, class GeoField>
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::readFields
(
const Mesh& mesh,
const typename GeoMesh::Mesh& mesh,
const IOobjectList& objects,
PtrList<GeoField>& fields
PtrList<GeometricField<Type, PatchField, GeoMesh> >& fields,
const bool readOldTime
)
{
typedef GeometricField<Type, PatchField, GeoMesh> GeoField;
// Search list of objects for fields of type GeomField
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
......@@ -45,17 +49,48 @@ void Foam::readFields
fieldObjects.erase(celDistIter);
}
// Get sorted set of names (different processors might read objects in
// different order)
const wordList masterNames(fieldObjects.sortedNames());
// Construct the fields
fields.setSize(masterNames.size());
forAll(masterNames, i)
{
const IOobject& io = *fieldObjects[masterNames[i]];
fields.set(i, new GeoField(io, mesh, readOldTime));
}
}
template<class Mesh, class GeoField>
void Foam::readFields
(
const Mesh& mesh,
const IOobjectList& objects,
PtrList<GeoField>& fields
)
{
// Search list of objects for fields of type GeomField
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
// Construct the fields
fields.setSize(fieldObjects.size());
label fieldI = 0;
forAllIter(IOobjectList, fieldObjects, iter)
// Get sorted set of names (different processors might read objects in
// different order)
const wordList masterNames(fieldObjects.sortedNames());
// Construct the fields
fields.setSize(masterNames.size());
forAll(masterNames, i)
{
fields.set
(
fieldI++,
new GeoField(*iter(), mesh)
);
const IOobject& io = *fieldObjects[masterNames[i]];
fields.set(i, new GeoField(io, mesh));
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -41,6 +41,16 @@ SourceFiles
namespace Foam
{
// Read the fields and hold on the pointer list
template<class Type, template<class> class PatchField, class GeoMesh>
void readFields
(
const typename GeoMesh::Mesh& mesh,
const IOobjectList& objects,
PtrList<GeometricField<Type, PatchField, GeoMesh> >& fields,
const bool readOldTime
);
// Read the fields and hold on the pointer list
template<class Mesh, class GeoField>
void readFields
......
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/parallel/reconstruct/reconstruct/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
......@@ -9,6 +10,7 @@ EXE_LIBS = \
-lfiniteVolume \
-lgenericPatchFields \
-llagrangian \
-ldynamicMesh \
-lmeshTools \
-lreconstruct \
-lregionModels
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -45,6 +45,8 @@ Description
#include "faceSet.H"
#include "pointSet.H"
#include "hexRef8Data.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
bool haveAllTimes
......@@ -865,6 +867,78 @@ int main(int argc, char *argv[])
pointSets[i].write();
}
}
// Reconstruct refinement data
{
PtrList<hexRef8Data> procData(procMeshes.meshes().size());
forAll(procMeshes.meshes(), procI)
{
const fvMesh& procMesh = procMeshes.meshes()[procI];
procData.set
(
procI,
new hexRef8Data
(
IOobject
(
"dummy",
procMesh.time().timeName(),
polyMesh::meshSubDir,
procMesh,
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
)
);
}
// Combine individual parts
const PtrList<labelIOList>& cellAddr =
procMeshes.cellProcAddressing();
UPtrList<const labelList> cellMaps(cellAddr.size());
forAll(cellAddr, i)
{
cellMaps.set(i, &cellAddr[i]);
}
const PtrList<labelIOList>& pointAddr =
procMeshes.pointProcAddressing();
UPtrList<const labelList> pointMaps(pointAddr.size());
forAll(pointAddr, i)
{
pointMaps.set(i, &pointAddr[i]);
}
UPtrList<const hexRef8Data> procRefs(procData.size());
forAll(procData, i)
{
procRefs.set(i, &procData[i]);
}
hexRef8Data
(
IOobject
(
"dummy",
mesh.time().timeName(),
polyMesh::meshSubDir,
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
cellMaps,
pointMaps,
procRefs
).write();
}
}
}
......@@ -882,7 +956,7 @@ int main(int argc, char *argv[])
}
}
Info<< "End.\n" << endl;
Info<< "\nEnd\n" << endl;
return 0;
}
......