mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge commit 'origin/master' into splitCyclic
Conflicts: applications/utilities/parallelProcessing/decomposePar/decomposePar.C applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C applications/utilities/parallelProcessing/decomposePar/domainDecomposition.H applications/utilities/parallelProcessing/decomposePar/domainDecompositionMesh.C src/OpenFOAM/fields/pointPatchFields/constraint/processor/processorPointPatchField.C src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C src/OpenFOAM/meshes/pointMesh/pointPatches/derived/coupled/coupledFacePointPatch.H src/OpenFOAM/meshes/polyMesh/globalMeshData/globalPoints.C src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.C src/OpenFOAM/meshes/polyMesh/polyPatches/basic/coupled/coupledPolyPatch.H src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (args.optionFound("dict"))
|
||||
{
|
||||
fileName dictPath(args.option("dict"));
|
||||
const fileName dictPath = args["dict"];
|
||||
|
||||
meshDictIoPtr.set
|
||||
(
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
extrude2DMesh.C
|
||||
doExtrude2DMesh.C
|
||||
extrude2DMeshApp.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/extrude2DMesh
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,7 +38,6 @@ Usage
|
||||
|
||||
Note
|
||||
Not sure about the walking of the faces to create the front and back faces.
|
||||
Tested on one .ccm file.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -57,16 +56,17 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
# include "addOverwriteOption.H"
|
||||
argList::validArgs.append("thickness");
|
||||
argList::addBoolOption("overwrite");
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
# include "createPolyMesh.H"
|
||||
const word oldInstance = mesh.pointsInstance();
|
||||
|
||||
scalar thickness(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||
bool overwrite = args.optionFound("overwrite");
|
||||
const scalar thickness = args.argRead<scalar>(1);
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
// Check that mesh is 2D
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,11 +56,6 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
|
||||
{
|
||||
const boundBox& meshBb = mesh.bounds();
|
||||
scalar mergeDist = mergeTol * meshBb.mag();
|
||||
scalar writeTol = std::pow
|
||||
(
|
||||
scalar(10.0),
|
||||
-scalar(IOstream::defaultPrecision())
|
||||
);
|
||||
|
||||
Info<< nl
|
||||
<< "Overall mesh bounding box : " << meshBb << nl
|
||||
@ -68,17 +63,27 @@ scalar getMergeDistance(const polyMesh& mesh, const scalar mergeTol)
|
||||
<< "Absolute matching distance : " << mergeDist << nl
|
||||
<< endl;
|
||||
|
||||
if (mesh.time().writeFormat() == IOstream::ASCII && mergeTol < writeTol)
|
||||
// check writing tolerance
|
||||
if (mesh.time().writeFormat() == IOstream::ASCII)
|
||||
{
|
||||
FatalErrorIn("getMergeDistance(const polyMesh&, const scalar)")
|
||||
<< "Your current settings specify ASCII writing with "
|
||||
<< IOstream::defaultPrecision() << " digits precision." << endl
|
||||
<< "Your merging tolerance (" << mergeTol << ") is finer than this."
|
||||
<< endl
|
||||
<< "Please change your writeFormat to binary"
|
||||
<< " or increase the writePrecision" << endl
|
||||
<< "or adjust the merge tolerance (-mergeTol)."
|
||||
<< exit(FatalError);
|
||||
const scalar writeTol = std::pow
|
||||
(
|
||||
scalar(10.0),
|
||||
-scalar(IOstream::defaultPrecision())
|
||||
);
|
||||
|
||||
if (mergeTol < writeTol)
|
||||
{
|
||||
FatalErrorIn("getMergeDistance(const polyMesh&, const dictionary&)")
|
||||
<< "Your current settings specify ASCII writing with "
|
||||
<< IOstream::defaultPrecision() << " digits precision." << nl
|
||||
<< "Your merging tolerance (" << mergeTol
|
||||
<< ") is finer than this." << nl
|
||||
<< "Change to binary writeFormat, "
|
||||
<< "or increase the writePrecision" << endl
|
||||
<< "or adjust the merge tolerance (mergeTol)."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
return mergeDist;
|
||||
@ -107,7 +112,7 @@ void writeMesh
|
||||
mesh.time().path()/meshRefiner.timeName()
|
||||
);
|
||||
}
|
||||
Info<< "Written mesh in = "
|
||||
Info<< "Wrote mesh in = "
|
||||
<< mesh.time().cpuTimeIncrement() << " s." << endl;
|
||||
}
|
||||
|
||||
@ -115,7 +120,8 @@ void writeMesh
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::addBoolOption("overwrite");
|
||||
# include "addOverwriteOption.H"
|
||||
|
||||
# include "setRootCase.H"
|
||||
# include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
@ -126,7 +132,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
const bool overwrite = args.optionFound("overwrite");
|
||||
|
||||
|
||||
// Check patches and faceZones are synchronised
|
||||
mesh.boundaryMesh().checkParallelSync(true);
|
||||
meshRefinement::checkCoupledFaceZones(mesh);
|
||||
@ -173,7 +178,7 @@ int main(int argc, char *argv[])
|
||||
// layer addition parameters
|
||||
const dictionary& layerDict = meshDict.subDict("addLayersControls");
|
||||
|
||||
|
||||
// absolute merge distance
|
||||
const scalar mergeDist = getMergeDistance
|
||||
(
|
||||
mesh,
|
||||
@ -181,17 +186,16 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Debug
|
||||
// ~~~~~
|
||||
|
||||
const label debug(readLabel(meshDict.lookup("debug")));
|
||||
const label debug = meshDict.lookupOrDefault<label>("debug", 0);
|
||||
if (debug > 0)
|
||||
{
|
||||
meshRefinement::debug = debug;
|
||||
meshRefinement::debug = debug;
|
||||
autoRefineDriver::debug = debug;
|
||||
autoSnapDriver::debug = debug;
|
||||
autoLayerDriver::debug = debug;
|
||||
autoSnapDriver::debug = debug;
|
||||
autoLayerDriver::debug = debug;
|
||||
}
|
||||
|
||||
|
||||
@ -272,7 +276,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
meshRefiner.write
|
||||
(
|
||||
debug&meshRefinement::OBJINTERSECTIONS,
|
||||
debug & meshRefinement::OBJINTERSECTIONS,
|
||||
mesh.time().path()/meshRefiner.timeName()
|
||||
);
|
||||
|
||||
@ -357,9 +361,9 @@ int main(int argc, char *argv[])
|
||||
// Now do the real work -refinement -snapping -layers
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Switch wantRefine(meshDict.lookup("castellatedMesh"));
|
||||
Switch wantSnap(meshDict.lookup("snap"));
|
||||
Switch wantLayers(meshDict.lookup("addLayers"));
|
||||
const Switch wantRefine(meshDict.lookup("castellatedMesh"));
|
||||
const Switch wantSnap(meshDict.lookup("snap"));
|
||||
const Switch wantLayers(meshDict.lookup("addLayers"));
|
||||
|
||||
if (wantRefine)
|
||||
{
|
||||
@ -434,6 +438,19 @@ int main(int argc, char *argv[])
|
||||
// Layer addition parameters
|
||||
layerParameters layerParams(layerDict, mesh.boundaryMesh());
|
||||
|
||||
//!!! Temporary hack to get access to maxLocalCells
|
||||
bool preBalance;
|
||||
{
|
||||
refinementParameters refineParams(refineDict);
|
||||
|
||||
preBalance = returnReduce
|
||||
(
|
||||
(mesh.nCells() >= refineParams.maxLocalCells()),
|
||||
orOp<bool>()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (!overwrite)
|
||||
{
|
||||
const_cast<Time&>(mesh.time())++;
|
||||
@ -444,6 +461,7 @@ int main(int argc, char *argv[])
|
||||
layerDict,
|
||||
motionDict,
|
||||
layerParams,
|
||||
preBalance,
|
||||
decomposer,
|
||||
distributor
|
||||
);
|
||||
@ -465,7 +483,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ FoamFile
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object autoHexMeshDict;
|
||||
object snappyHexMeshDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -40,6 +40,10 @@ geometry
|
||||
{
|
||||
type triSurfaceMesh;
|
||||
|
||||
//tolerance 1E-5; // optional:non-default tolerance on intersections
|
||||
//maxTreeDepth 10; // optional:depth of octree. Decrease only in case
|
||||
// of memory limitations.
|
||||
|
||||
// Per region the patchname. If not provided will be <name>_<region>.
|
||||
regions
|
||||
{
|
||||
@ -67,9 +71,9 @@ castellatedMeshControls
|
||||
// Refinement parameters
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// While refining maximum number of cells per processor. This is basically
|
||||
// the number of cells that fit on a processor. If you choose this too small
|
||||
// it will do just more refinement iterations to obtain a similar mesh.
|
||||
// If local number of cells is >= maxLocalCells on any processor
|
||||
// switches from from refinement followed by balancing
|
||||
// (current method) to (weighted) balancing before refinement.
|
||||
maxLocalCells 1000000;
|
||||
|
||||
// Overall cell limit (approximately). Refinement will stop immediately
|
||||
@ -85,6 +89,13 @@ castellatedMeshControls
|
||||
// (unless the number of cells to refine is 0)
|
||||
minRefinementCells 0;
|
||||
|
||||
// Allow a certain level of imbalance during refining
|
||||
// (since balancing is quite expensive)
|
||||
// Expressed as fraction of perfect balance (= overall number of cells /
|
||||
// nProcs). 0=balance always.
|
||||
maxLoadUnbalance 0.10;
|
||||
|
||||
|
||||
// Number of buffer layers between different levels.
|
||||
// 1 means normal 2:1 refinement restriction, larger means slower
|
||||
// refinement.
|
||||
|
||||
Reference in New Issue
Block a user