mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
Conflicts: applications/utilities/mesh/manipulation/transformPoints/transformPoints.C
This commit is contained in:
@ -38,11 +38,9 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
argList::addBoolOption("writep", "write the final pressure field");
|
||||||
argList::validOptions.insert("writep", "");
|
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
|
|||||||
@ -88,7 +88,7 @@ volScalarField DpDt =
|
|||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ volScalarField DpDt =
|
|||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ volScalarField DpDt =
|
|||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,5 +6,5 @@ EXE_INC = \
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lspecie
|
-lspecie
|
||||||
|
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "maxwellSlipUFvPatchVectorField.H"
|
#include "maxwellSlipUFvPatchVectorField.H"
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "mixedFixedValueSlipFvPatchFields.H"
|
#include "mixedFixedValueSlipFvPatchFields.H"
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -84,7 +84,7 @@
|
|||||||
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
Info<< "Creating multi-variate interpolation scheme\n" << endl;
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
|
|
||||||
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
multivariateSurfaceInterpolationScheme<scalar>::fieldTable fields;
|
||||||
|
|
||||||
forAll (Y, i)
|
forAll(Y, i)
|
||||||
{
|
{
|
||||||
fields.add(Y[i]);
|
fields.add(Y[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,10 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
word kinematicCloudName("kinematicCloud");
|
const word kinematicCloudName
|
||||||
args.optionReadIfPresent("cloudName", kinematicCloudName);
|
(
|
||||||
|
args.optionLookupOrDefault<word>("cloudName", "kinematicCloud")
|
||||||
|
);
|
||||||
|
|
||||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||||
basicKinematicCloud kinematicCloud
|
basicKinematicCloud kinematicCloud
|
||||||
|
|||||||
@ -42,7 +42,7 @@ Description
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("cloudName", "cloud name");
|
argList::addOption("cloudName", "cloud name");
|
||||||
|
|
||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
|
|||||||
@ -89,7 +89,7 @@ Foam::tmp<Foam::volScalarField> Foam::GidaspowErgunWenYu::K
|
|||||||
volScalarField& KWenYu = tKWenYu();
|
volScalarField& KWenYu = tKWenYu();
|
||||||
|
|
||||||
// Ergun
|
// Ergun
|
||||||
forAll (beta, cellj)
|
forAll(beta, cellj)
|
||||||
{
|
{
|
||||||
if (beta[cellj] <= 0.8)
|
if (beta[cellj] <= 0.8)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -73,7 +73,7 @@ Foam::tmp<Foam::volScalarField> Foam::SyamlalOBrien::K
|
|||||||
volScalarField A = pow(beta, 4.14);
|
volScalarField A = pow(beta, 4.14);
|
||||||
volScalarField B = 0.8*pow(beta, 1.28);
|
volScalarField B = 0.8*pow(beta, 1.28);
|
||||||
|
|
||||||
forAll (beta, celli)
|
forAll(beta, celli)
|
||||||
{
|
{
|
||||||
if (beta[celli] > 0.85)
|
if (beta[celli] > 0.85)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -125,7 +125,7 @@ Foam::tmp<Foam::volScalarField> Foam::SchaefferFrictionalStress::muf
|
|||||||
|
|
||||||
volScalarField& muff = tmuf();
|
volScalarField& muff = tmuf();
|
||||||
|
|
||||||
forAll (D, celli)
|
forAll(D, celli)
|
||||||
{
|
{
|
||||||
if (alpha[celli] > alphaMax.value()-5e-2)
|
if (alpha[celli] > alphaMax.value()-5e-2)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
labelListList neighbour = mesh.cellCells();
|
labelListList neighbour = mesh.cellCells();
|
||||||
scalarField cellVolumes = mesh.cellVolumes();
|
scalarField cellVolumes = mesh.cellVolumes();
|
||||||
|
|
||||||
forAll (alphaEx, celli)
|
forAll(alphaEx, celli)
|
||||||
{
|
{
|
||||||
// Finding the labels of the neighbouring cells
|
// Finding the labels of the neighbouring cells
|
||||||
labelList neighbourCell = neighbour[celli];
|
labelList neighbourCell = neighbour[celli];
|
||||||
@ -15,12 +15,12 @@
|
|||||||
// Initializing neighbouring cells contribution
|
// Initializing neighbouring cells contribution
|
||||||
scalar neighboursEx = 0.0;
|
scalar neighboursEx = 0.0;
|
||||||
|
|
||||||
forAll (neighbourCell, cellj)
|
forAll(neighbourCell, cellj)
|
||||||
{
|
{
|
||||||
labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
|
labelList neighboursNeighbour = neighbour[neighbourCell[cellj]];
|
||||||
scalar neighboursNeighbourCellVolumes = 0.0;
|
scalar neighboursNeighbourCellVolumes = 0.0;
|
||||||
|
|
||||||
forAll (neighboursNeighbour, cellk)
|
forAll(neighboursNeighbour, cellk)
|
||||||
{
|
{
|
||||||
neighboursNeighbourCellVolumes +=
|
neighboursNeighbourCellVolumes +=
|
||||||
cellVolumes[neighboursNeighbour[cellk]];
|
cellVolumes[neighboursNeighbour[cellk]];
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
BSplineTest.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_USER_APPBIN)/BSplineTest
|
|
||||||
@ -1,69 +0,0 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
|
||||||
| ========= | |
|
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
|
||||||
| \\ / O peration | Version: 1.6 |
|
|
||||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
|
||||||
| \\/ M anipulation | |
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
(
|
|
||||||
// Upper body longitudinal splines.
|
|
||||||
(
|
|
||||||
(-0.22685 -0.01125166 0) // 7
|
|
||||||
(-0.21685 -0.01340204 0)
|
|
||||||
(-0.20685 -0.01529684 0)
|
|
||||||
(-0.19685 -0.01694748 0)
|
|
||||||
(-0.18685 -0.01836538 0)
|
|
||||||
(-0.17685 -0.01956197 0)
|
|
||||||
(-0.16685 -0.02054868 0)
|
|
||||||
(-0.15685 -0.02133693 0)
|
|
||||||
(-0.14685 -0.02193816 0)
|
|
||||||
(-0.13685 -0.02236377 0)
|
|
||||||
(-0.12685 -0.02262521 0)
|
|
||||||
(-0.11685 -0.02273389 0) // 2
|
|
||||||
)
|
|
||||||
|
|
||||||
(
|
|
||||||
(-0.22685 0 0.01125166) // 8
|
|
||||||
(-0.21685 0 0.01340204)
|
|
||||||
(-0.20685 0 0.01529684)
|
|
||||||
(-0.19685 0 0.01694748)
|
|
||||||
(-0.18685 0 0.01836538)
|
|
||||||
(-0.17685 0 0.01956197)
|
|
||||||
(-0.16685 0 0.02054868)
|
|
||||||
(-0.15685 0 0.02133693)
|
|
||||||
(-0.14685 0 0.02193816)
|
|
||||||
(-0.13685 0 0.02236377)
|
|
||||||
(-0.12685 0 0.02262521)
|
|
||||||
(-0.11685 0 0.02273389) // 3
|
|
||||||
)
|
|
||||||
|
|
||||||
(
|
|
||||||
(-0.22685 0.01125166 0) // 9
|
|
||||||
(-0.21685 0.01340204 0)
|
|
||||||
(-0.20685 0.01529684 0)
|
|
||||||
(-0.19685 0.01694748 0)
|
|
||||||
(-0.18685 0.01836538 0)
|
|
||||||
(-0.17685 0.01956197 0)
|
|
||||||
(-0.16685 0.02054868 0)
|
|
||||||
(-0.15685 0.02133693 0)
|
|
||||||
(-0.14685 0.02193816 0)
|
|
||||||
(-0.13685 0.02236377 0)
|
|
||||||
(-0.12685 0.02262521 0)
|
|
||||||
(-0.11685 0.02273389 0) // 4
|
|
||||||
)
|
|
||||||
|
|
||||||
(
|
|
||||||
(-0.22685 0 -0.01125166) // 6
|
|
||||||
(-0.21685 0 -0.01340204)
|
|
||||||
(-0.20685 0 -0.01529684)
|
|
||||||
(-0.19685 0 -0.01694748)
|
|
||||||
(-0.18685 0 -0.01836538)
|
|
||||||
(-0.17685 0 -0.01956197)
|
|
||||||
(-0.16685 0 -0.02054868)
|
|
||||||
(-0.15685 0 -0.02133693)
|
|
||||||
(-0.14685 0 -0.02193816)
|
|
||||||
(-0.13685 0 -0.02236377)
|
|
||||||
(-0.12685 0 -0.02262521)
|
|
||||||
(-0.11685 0 -0.02273389) // 1
|
|
||||||
)
|
|
||||||
);
|
|
||||||
@ -47,11 +47,11 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("reList", "reList");
|
argList::addOption("reList", "reList");
|
||||||
argList::validOptions.insert("wordList", "wordList");
|
argList::addOption("wordList", "wordList");
|
||||||
argList::validOptions.insert("stringList", "stringList");
|
argList::addOption("stringList", "stringList");
|
||||||
argList::validOptions.insert("float", "xx");
|
argList::addOption("float", "xx");
|
||||||
argList::validOptions.insert("flag", "");
|
argList::addBoolOption("flag");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
|
|||||||
@ -82,9 +82,13 @@ int main(int argc, char *argv[])
|
|||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.insert("file .. fileN");
|
argList::validArgs.insert("file .. fileN");
|
||||||
|
|
||||||
argList::validOptions.insert("mask", "");
|
argList::addBoolOption("mask", "report information about the bit masks");
|
||||||
argList::validOptions.insert("count", "");
|
argList::addBoolOption("count", "test the count() method");
|
||||||
argList::validOptions.insert("info", "");
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"info",
|
||||||
|
"print an ascii representation of the storage"
|
||||||
|
);
|
||||||
|
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
|
|||||||
@ -58,9 +58,15 @@ int main(int argc, char *argv[])
|
|||||||
list1.print(Info);
|
list1.print(Info);
|
||||||
|
|
||||||
Info<< "\ntest set() with default argument (max_value)\n";
|
Info<< "\ntest set() with default argument (max_value)\n";
|
||||||
|
list1.set(1);
|
||||||
list1.set(3);
|
list1.set(3);
|
||||||
list1.print(Info);
|
list1.print(Info);
|
||||||
|
|
||||||
|
Info<< "\ntest unset() with in-range and out-of-range\n";
|
||||||
|
list1.unset(3);
|
||||||
|
list1.unset(100000);
|
||||||
|
list1.print(Info);
|
||||||
|
|
||||||
Info<< "\ntest assign between references\n";
|
Info<< "\ntest assign between references\n";
|
||||||
list1[2] = 3;
|
list1[2] = 3;
|
||||||
list1[4] = list1[2];
|
list1[4] = list1[2];
|
||||||
|
|||||||
3
applications/test/PackedList3/Make/files
Normal file
3
applications/test/PackedList3/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
PackedListTest3.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/PackedListTest3
|
||||||
0
applications/test/PackedList3/Make/options
Normal file
0
applications/test/PackedList3/Make/options
Normal file
@ -22,43 +22,51 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
Application
|
||||||
#include "argList.H"
|
|
||||||
|
|
||||||
#include "vector.H"
|
Description
|
||||||
#include "IFstream.H"
|
|
||||||
#include "BSpline.H"
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "argList.H"
|
||||||
|
#include "boolList.H"
|
||||||
|
#include "HashSet.H"
|
||||||
|
#include "StaticHashTable.H"
|
||||||
|
#include "cpuTime.H"
|
||||||
|
#include <vector>
|
||||||
|
#include "PackedList.H"
|
||||||
|
#include "PackedBoolList.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// Main program:
|
// Main program:
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
const label n = 100000000;
|
||||||
argList::validArgs.insert("file .. fileN");
|
const label nReport = 1000000;
|
||||||
|
|
||||||
argList args(argc, argv, false, true);
|
cpuTime timer;
|
||||||
|
|
||||||
forAll(args.additionalArgs(), argI)
|
// test inserts
|
||||||
|
// PackedBoolList
|
||||||
|
PackedBoolList packed;
|
||||||
|
for (label i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
const string& srcFile = args.additionalArgs()[argI];
|
if ((i % nReport) == 0 && i)
|
||||||
Info<< nl << "reading " << srcFile << nl;
|
|
||||||
IFstream ifs(srcFile);
|
|
||||||
|
|
||||||
List<pointField> splinePointFields(ifs);
|
|
||||||
|
|
||||||
forAll(splinePointFields, splineI)
|
|
||||||
{
|
{
|
||||||
Info<<"convert " << splinePointFields[splineI] << " to bspline" << endl;
|
Info<< "i:" << i << " in " << timer.cpuTimeIncrement() << " s"
|
||||||
|
<<endl;
|
||||||
BSpline spl(splinePointFields[splineI], vector::zero, vector::zero);
|
|
||||||
|
|
||||||
Info<< "1/2 = " << spl.position(0.5) << endl;
|
|
||||||
}
|
}
|
||||||
|
packed[i] = 1;
|
||||||
}
|
}
|
||||||
|
Info<< "insert test: " << n << " elements in "
|
||||||
|
<< timer.cpuTimeIncrement() << " s\n\n";
|
||||||
|
|
||||||
|
Info << "\nEnd\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -66,17 +66,18 @@ int main(int argc, char *argv[])
|
|||||||
argList::noBanner();
|
argList::noBanner();
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.insert("fileName .. fileNameN");
|
argList::validArgs.insert("fileName .. fileNameN");
|
||||||
|
argList::addOption("istream", "fileName", "test Istream values");
|
||||||
|
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
if (args.additionalArgs().empty())
|
if (args.additionalArgs().empty() && args.options().empty())
|
||||||
{
|
{
|
||||||
args.printUsage();
|
args.printUsage();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("case"))
|
fileName pathName;
|
||||||
|
if (args.optionReadIfPresent("case", pathName))
|
||||||
{
|
{
|
||||||
fileName pathName = args.option("case");
|
|
||||||
Info<< nl
|
Info<< nl
|
||||||
<< "-case" << nl
|
<< "-case" << nl
|
||||||
<< "path = " << args.path() << nl
|
<< "path = " << args.path() << nl
|
||||||
@ -91,7 +92,23 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(args.additionalArgs(), argI)
|
forAll(args.additionalArgs(), argI)
|
||||||
{
|
{
|
||||||
fileName pathName = args.additionalArgs()[argI];
|
pathName = args.additionalArgs()[argI];
|
||||||
|
printCleaning(pathName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.optionFound("istream"))
|
||||||
|
{
|
||||||
|
args.optionLookup("istream")() >> pathName;
|
||||||
|
|
||||||
|
Info<< nl
|
||||||
|
<< "-case" << nl
|
||||||
|
<< "path = " << args.path() << nl
|
||||||
|
<< "root = " << args.rootPath() << nl
|
||||||
|
<< "case = " << args.caseName() << nl
|
||||||
|
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||||
|
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||||
|
<< endl;
|
||||||
|
|
||||||
printCleaning(pathName);
|
printCleaning(pathName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -98,8 +98,9 @@ bool checkDictionaryContent(const dictionary& dict1, const dictionary& dict2)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("rewrite", "");
|
argList::addBoolOption("rewrite");
|
||||||
argList::validOptions.insert("show", "");
|
argList::addBoolOption("show");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
Time runTime(args.rootPath(), args.caseName());
|
Time runTime(args.rootPath(), args.caseName());
|
||||||
|
|||||||
@ -39,8 +39,9 @@ int main(int argc, char *argv[])
|
|||||||
argList::noBanner();
|
argList::noBanner();
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.insert("file .. fileN");
|
argList::validArgs.insert("file .. fileN");
|
||||||
argList::validOptions.erase("case");
|
|
||||||
argList::validOptions.insert("ext", "bak");
|
argList::removeOption("case");
|
||||||
|
argList::addOption("ext", "bak");
|
||||||
|
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Count walls
|
// Count walls
|
||||||
label nWalls = 0;
|
label nWalls = 0;
|
||||||
forAll (mesh.boundary(), patchI)
|
forAll(mesh.boundary(), patchI)
|
||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
@ -87,13 +87,13 @@ int main(int argc, char *argv[])
|
|||||||
labelList changedFaces(nWalls);
|
labelList changedFaces(nWalls);
|
||||||
|
|
||||||
label nChangedFaces = 0;
|
label nChangedFaces = 0;
|
||||||
forAll (mesh.boundary(), patchI)
|
forAll(mesh.boundary(), patchI)
|
||||||
{
|
{
|
||||||
const fvPatch& patch = mesh.boundary()[patchI];
|
const fvPatch& patch = mesh.boundary()[patchI];
|
||||||
|
|
||||||
if (isA<wallFvPatch>(patch))
|
if (isA<wallFvPatch>(patch))
|
||||||
{
|
{
|
||||||
forAll (patch.Cf(), patchFaceI)
|
forAll(patch.Cf(), patchFaceI)
|
||||||
{
|
{
|
||||||
const polyPatch& polyPatch = mesh.boundaryMesh()[patchI];
|
const polyPatch& polyPatch = mesh.boundaryMesh()[patchI];
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy boundary values
|
// Copy boundary values
|
||||||
forAll (wallDistUncorrected.boundaryField(), patchI)
|
forAll(wallDistUncorrected.boundaryField(), patchI)
|
||||||
{
|
{
|
||||||
fvPatchScalarField& patchField =
|
fvPatchScalarField& patchField =
|
||||||
wallDistUncorrected.boundaryField()[patchI];
|
wallDistUncorrected.boundaryField()[patchI];
|
||||||
|
|||||||
@ -38,7 +38,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::validArgs.clear();
|
argList::validArgs.clear();
|
||||||
argList::validArgs.append("CHEMKINIIIFile");
|
argList::validArgs.append("CHEMKINIIIFile");
|
||||||
argList::validOptions.insert("thermo", "fileName");
|
argList::addOption("thermo", "fileName");
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
fileName thermoFileName = fileName::null;
|
fileName thermoFileName = fileName::null;
|
||||||
@ -72,7 +72,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
PtrList<gasReaction> testReactions(nReactions);
|
PtrList<gasReaction> testReactions(nReactions);
|
||||||
|
|
||||||
forAll (testReactions, i)
|
forAll(testReactions, i)
|
||||||
{
|
{
|
||||||
testReactions.set
|
testReactions.set
|
||||||
(
|
(
|
||||||
|
|||||||
@ -53,7 +53,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
label nNeighbours = 0;
|
label nNeighbours = 0;
|
||||||
|
|
||||||
forAll (mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||||
{
|
{
|
||||||
@ -65,7 +65,7 @@ labelList procNeighbours(const polyMesh& mesh)
|
|||||||
|
|
||||||
nNeighbours = 0;
|
nNeighbours = 0;
|
||||||
|
|
||||||
forAll (mesh.boundaryMesh(), patchI)
|
forAll(mesh.boundaryMesh(), patchI)
|
||||||
{
|
{
|
||||||
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
|
||||||
{
|
{
|
||||||
|
|||||||
3
applications/test/sizeof/Make/files
Normal file
3
applications/test/sizeof/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
sizeofTest.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/sizeofTest
|
||||||
2
applications/test/sizeof/Make/options
Normal file
2
applications/test/sizeof/Make/options
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
|
||||||
|
/* EXE_LIBS = -lfiniteVolume */
|
||||||
@ -22,41 +22,83 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Description
|
||||||
|
Test the sizeof various classes.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "bool.H"
|
||||||
|
#include "Switch.H"
|
||||||
|
#include "string.H"
|
||||||
|
#include "dictionary.H"
|
||||||
|
#include "nil.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
#include "IStringStream.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
namespace Foam
|
||||||
|
|
||||||
template<class T>
|
|
||||||
T Foam::argList::optionRead(const word& opt) const
|
|
||||||
{
|
{
|
||||||
T val;
|
class hasBoolClass
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool b_;
|
||||||
|
|
||||||
|
hasBoolClass(const bool val=false)
|
||||||
|
:
|
||||||
|
b_(false)
|
||||||
|
{}
|
||||||
|
};
|
||||||
|
|
||||||
optionLookup(opt)() >> val;
|
|
||||||
return val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
using namespace Foam;
|
||||||
bool Foam::argList::optionReadIfPresent(const word& opt, T& val) const
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
if (optionFound(opt))
|
cout<<"sizeof\n------\n";
|
||||||
{
|
{
|
||||||
val = optionRead<T>(opt);
|
nil x;
|
||||||
return true;
|
cout<<"nil:" << sizeof(x) << nl;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
{
|
||||||
return false;
|
bool x(0);
|
||||||
|
cout<<"bool:" << sizeof(x) << nl;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
hasBoolClass x(true);
|
||||||
|
cout<<"hasBoolClass:" << sizeof(x) << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Switch x("n");
|
||||||
|
cout<<"Switch:" << sizeof(x) << nl;
|
||||||
|
cout<<"Switch::switchType=" << sizeof(Switch::switchType) << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
scalar x(0);
|
||||||
|
cout<<"scalar:" << sizeof(x) << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
label x(0);
|
||||||
|
cout<<"label:" << sizeof(x) << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
cout<<"int:" << sizeof(int) << nl;
|
||||||
|
cout<<"long:" << sizeof(long) << nl;
|
||||||
|
cout<<"float:" << sizeof(float) << nl;
|
||||||
|
cout<<"double:" << sizeof(double) << nl;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T>
|
Info << "---\nEnd\n" << endl;
|
||||||
Foam::List<T> Foam::argList::optionReadList(const word& opt) const
|
|
||||||
{
|
return 0;
|
||||||
return readList<T>(optionLookup(opt)());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
3
applications/test/spline/Make/files
Normal file
3
applications/test/spline/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
splineTest.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/splineTest
|
||||||
137
applications/test/spline/splineTest.C
Normal file
137
applications/test/spline/splineTest.C
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM.
|
||||||
|
|
||||||
|
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||||
|
under the terms of the GNU General Public License as published by the
|
||||||
|
Free Software Foundation; either version 2 of the License, or (at your
|
||||||
|
option) any later version.
|
||||||
|
|
||||||
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
#include "argList.H"
|
||||||
|
|
||||||
|
#include "vector.H"
|
||||||
|
#include "IFstream.H"
|
||||||
|
|
||||||
|
#include "BSpline.H"
|
||||||
|
#include "CatmullRomSpline.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
inline Ostream& printPoint(Ostream& os, const point& p)
|
||||||
|
{
|
||||||
|
os << p.x() << ' ' << p.y() << ' ' << p.z() << nl;
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::noParallel();
|
||||||
|
argList::validArgs.insert("file .. fileN");
|
||||||
|
argList::addBoolOption("B", "B-Spline implementation");
|
||||||
|
argList::addBoolOption("CMR", "catmull-rom spline (default)");
|
||||||
|
argList::addOption
|
||||||
|
(
|
||||||
|
"n",
|
||||||
|
"INT",
|
||||||
|
"number of segments for evaluation - default 20"
|
||||||
|
);
|
||||||
|
|
||||||
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
|
if (args.additionalArgs().empty())
|
||||||
|
{
|
||||||
|
args.printUsage();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool useBSpline = args.optionFound("B");
|
||||||
|
bool useCatmullRom = args.optionFound("CMR");
|
||||||
|
label nSeg = args.optionLookupOrDefault<label>("n", 20);
|
||||||
|
|
||||||
|
if (!useCatmullRom && !useBSpline)
|
||||||
|
{
|
||||||
|
Info<<"defaulting to Catmull-Rom spline" << endl;
|
||||||
|
useCatmullRom = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(args.additionalArgs(), argI)
|
||||||
|
{
|
||||||
|
const string& srcFile = args.additionalArgs()[argI];
|
||||||
|
Info<< nl << "reading " << srcFile << nl;
|
||||||
|
IFstream ifs(srcFile);
|
||||||
|
|
||||||
|
List<pointField> pointFields(ifs);
|
||||||
|
|
||||||
|
|
||||||
|
forAll(pointFields, splineI)
|
||||||
|
{
|
||||||
|
Info<<"\n# points:" << endl;
|
||||||
|
forAll(pointFields[splineI], ptI)
|
||||||
|
{
|
||||||
|
printPoint(Info, pointFields[splineI][ptI]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useBSpline)
|
||||||
|
{
|
||||||
|
BSpline spl(pointFields[splineI]);
|
||||||
|
|
||||||
|
Info<< nl << "# B-Spline" << endl;
|
||||||
|
|
||||||
|
for (label segI = 0; segI <= nSeg; ++segI)
|
||||||
|
{
|
||||||
|
scalar lambda = scalar(segI)/scalar(nSeg);
|
||||||
|
printPoint(Info, spl.position(lambda));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (useCatmullRom)
|
||||||
|
{
|
||||||
|
CatmullRomSpline spl(pointFields[splineI]);
|
||||||
|
|
||||||
|
Info<< nl <<"# Catmull-Rom" << endl;
|
||||||
|
|
||||||
|
for (label segI = 0; segI <= nSeg; ++segI)
|
||||||
|
{
|
||||||
|
scalar lambda = scalar(segI)/scalar(nSeg);
|
||||||
|
printPoint(Info, spl.position(lambda));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
polyLine pl(pointFields[splineI]);
|
||||||
|
|
||||||
|
Info<< nl <<"# polyList" << endl;
|
||||||
|
|
||||||
|
for (label segI = 0; segI <= nSeg; ++segI)
|
||||||
|
{
|
||||||
|
scalar lambda = scalar(segI)/scalar(nSeg);
|
||||||
|
printPoint(Info, pl.position(lambda));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
46
applications/test/spline/test-splines
Normal file
46
applications/test/spline/test-splines
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.6 |
|
||||||
|
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
(
|
||||||
|
// Upper body longitudinal splines
|
||||||
|
(
|
||||||
|
(0.22685 0.01125166 0) // 7
|
||||||
|
(0.21685 0.01340204 0)
|
||||||
|
(0.20685 0.01529684 0)
|
||||||
|
(0.19685 0.01694748 0)
|
||||||
|
(0.18685 0.01836538 0)
|
||||||
|
(0.17685 0.01956197 0)
|
||||||
|
(0.16685 0.02054868 0)
|
||||||
|
(0.15685 0.02133693 0)
|
||||||
|
(0.14685 0.02193816 0)
|
||||||
|
(0.13685 0.02236377 0)
|
||||||
|
(0.12685 0.02262521 0)
|
||||||
|
(0.11685 0.02273389 0) // 2
|
||||||
|
)
|
||||||
|
|
||||||
|
// sine function
|
||||||
|
(
|
||||||
|
(0 0 0)
|
||||||
|
(45 0.70707 0)
|
||||||
|
(90 1 0)
|
||||||
|
(135 0.70707 0)
|
||||||
|
(180 0 0)
|
||||||
|
(225 -0.70707 0)
|
||||||
|
(270 -1 0)
|
||||||
|
(315 -0.70707 0)
|
||||||
|
(360 0 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
// cosine function, but with extremely few points
|
||||||
|
(
|
||||||
|
(0 1 0)
|
||||||
|
(180 -1 0)
|
||||||
|
(360 1 0)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
@ -44,16 +44,14 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.insert("string .. stringN");
|
argList::validArgs.insert("string .. stringN");
|
||||||
argList::validOptions.insert("file", "name");
|
argList::addOption("file", "name");
|
||||||
argList::validOptions.insert("repeat", "count");
|
argList::addOption("repeat", "count");
|
||||||
|
|
||||||
argList args(argc, argv, false, true);
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
label repeat = 1;
|
const label repeat = args.optionLookupOrDefault<label>("repeat", 1);
|
||||||
args.optionReadIfPresent<label>("repeat", repeat);
|
|
||||||
|
|
||||||
cpuTime timer;
|
cpuTime timer;
|
||||||
|
|
||||||
for (label count = 0; count < repeat; ++count)
|
for (label count = 0; count < repeat; ++count)
|
||||||
{
|
{
|
||||||
forAll(args.additionalArgs(), argI)
|
forAll(args.additionalArgs(), argI)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/errorEstimation/lnInclude
|
-I$(LIB_SRC)/errorEstimation/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
|||||||
@ -454,7 +454,7 @@ label simplifyFaces
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
argList::validArgs.append("edge length [m]");
|
argList::validArgs.append("edge length [m]");
|
||||||
argList::validArgs.append("merge angle (degrees)");
|
argList::validArgs.append("merge angle (degrees)");
|
||||||
|
|
||||||
|
|||||||
@ -59,10 +59,6 @@ using namespace Foam;
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Sin of angle between two consecutive edges on a face. If sin(angle) larger
|
|
||||||
// than this the face will be considered concave.
|
|
||||||
const scalar defaultConcaveAngle = 30;
|
|
||||||
|
|
||||||
|
|
||||||
// Same check as snapMesh
|
// Same check as snapMesh
|
||||||
void checkSnapMesh
|
void checkSnapMesh
|
||||||
@ -433,9 +429,9 @@ label mergeEdges(const scalar minCos, polyMesh& mesh)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validArgs.append("feature angle [0..180]");
|
argList::validArgs.append("feature angle [0..180]");
|
||||||
argList::validOptions.insert("concaveAngle", "[0..180]");
|
argList::addOption("concaveAngle", "[0..180]");
|
||||||
argList::validOptions.insert("snapMesh", "");
|
argList::addBoolOption("snapMesh");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -447,8 +443,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar minCos = Foam::cos(degToRad(featureAngle));
|
scalar minCos = Foam::cos(degToRad(featureAngle));
|
||||||
|
|
||||||
scalar concaveAngle = defaultConcaveAngle;
|
// Sin of angle between two consecutive edges on a face.
|
||||||
args.optionReadIfPresent("concaveAngle", concaveAngle);
|
// If sin(angle) larger than this the face will be considered concave.
|
||||||
|
scalar concaveAngle = args.optionLookupOrDefault("concaveAngle", 30.0);
|
||||||
|
|
||||||
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
scalar concaveSin = Foam::sin(degToRad(concaveAngle));
|
||||||
|
|
||||||
@ -483,8 +480,8 @@ int main(int argc, char *argv[])
|
|||||||
// Merge points on straight edges and remove unused points
|
// Merge points on straight edges and remove unused points
|
||||||
if (snapMeshDict)
|
if (snapMeshDict)
|
||||||
{
|
{
|
||||||
Info<< "Merging all 'loose' points on surface edges"
|
Info<< "Merging all 'loose' points on surface edges, "
|
||||||
<< ", regardless of the angle they make." << endl;
|
<< "regardless of the angle they make." << endl;
|
||||||
|
|
||||||
// Surface bnound to be used to extrude. Merge all loose points.
|
// Surface bnound to be used to extrude. Merge all loose points.
|
||||||
nChanged += mergeEdges(-1, mesh);
|
nChanged += mergeEdges(-1, mesh);
|
||||||
@ -510,7 +507,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Mesh unchanged." << endl;
|
Info<< "Mesh unchanged." << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "\nEnd\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "cellSplitter.H"
|
#include "cellSplitter.H"
|
||||||
@ -39,12 +37,8 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
defineTypeNameAndDebug(Foam::cellSplitter, 0);
|
||||||
{
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(cellSplitter, 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -328,7 +328,7 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -52,7 +52,7 @@ using namespace Foam;
|
|||||||
// Main program:
|
// Main program:
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
argList::validArgs.append("cellSet");
|
argList::validArgs.append("cellSet");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -47,11 +47,12 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Foam::argList::noParallel();
|
argList::noParallel();
|
||||||
Foam::argList::validArgs.append("patchName");
|
argList::validArgs.append("patchName");
|
||||||
Foam::argList::validArgs.append("edgeWeight");
|
argList::validArgs.append("edgeWeight");
|
||||||
Foam::argList::validOptions.insert("useSet", "cellSet");
|
|
||||||
Foam::argList::validOptions.insert("overwrite", "");
|
argList::addOption("useSet", "cellSet");
|
||||||
|
argList::addBoolOption("overwrite");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -97,7 +97,7 @@ bool limitRefinementLevel
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validOptions.insert("readLevel", "");
|
argList::addBoolOption("readLevel");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -216,7 +216,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
List<polyPatch*> p(patches.size());
|
List<polyPatch*> p(patches.size());
|
||||||
|
|
||||||
forAll (p, patchI)
|
forAll(p, patchI)
|
||||||
{
|
{
|
||||||
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
|
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,8 +48,8 @@ using namespace Foam;
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Foam::argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
Foam::argList::validArgs.append("faceSet");
|
argList::validArgs.append("faceSet");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -525,10 +525,10 @@ void collectCuts
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("set", "cellSet name");
|
argList::addOption("set", "cellSet name");
|
||||||
argList::validOptions.insert("geometry", "");
|
argList::addBoolOption("geometry");
|
||||||
argList::validOptions.insert("tol", "edge snap tolerance");
|
argList::addOption("tol", "edge snap tolerance");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
argList::validArgs.append("edge angle [0..360]");
|
argList::validArgs.append("edge angle [0..360]");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
@ -546,8 +546,7 @@ int main(int argc, char *argv[])
|
|||||||
bool geometry = args.optionFound("geometry");
|
bool geometry = args.optionFound("geometry");
|
||||||
bool overwrite = args.optionFound("overwrite");
|
bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
scalar edgeTol = 0.2;
|
scalar edgeTol = args.optionLookupOrDefault("tol", 0.2);
|
||||||
args.optionReadIfPresent("tol", edgeTol);
|
|
||||||
|
|
||||||
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
|
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
|
||||||
<< "featureAngle : " << featureAngle << nl
|
<< "featureAngle : " << featureAngle << nl
|
||||||
|
|||||||
@ -198,8 +198,11 @@ void ReadVertices
|
|||||||
int dims = 1;
|
int dims = 1;
|
||||||
float scale;
|
float scale;
|
||||||
CCMIOID mapID;
|
CCMIOID mapID;
|
||||||
CCMIOReadVerticesf(&err, vertices, &dims, &scale, &mapID, verts.begin(),
|
CCMIOReadVerticesf
|
||||||
offset, offsetPlusSize);
|
(
|
||||||
|
&err, vertices, &dims, &scale, &mapID, verts.begin(),
|
||||||
|
offset, offsetPlusSize
|
||||||
|
);
|
||||||
CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize);
|
CCMIOReadMap(&err, mapID, mapData.begin(), offset, offsetPlusSize);
|
||||||
|
|
||||||
//CCMIOSize size;
|
//CCMIOSize size;
|
||||||
@ -245,35 +248,34 @@ void ReadProblem
|
|||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char *name;
|
char *name;
|
||||||
int size;
|
int size;
|
||||||
int cellType;
|
int cellType;
|
||||||
|
|
||||||
// ... if it has a material type. (Note that we do not pass in
|
// ... if it has a material type. (Note that we do not pass in
|
||||||
// an array to get the name because we do not know how long the
|
// an array to get the name because we do not know how long the
|
||||||
// string is yet. Many parameters to CCMIO functions that
|
// string is yet. Many parameters to CCMIO functions that
|
||||||
// return
|
// return
|
||||||
// data can be NULL if that data is not needed.)
|
// data can be NULL if that data is not needed.)
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL)
|
CCMIOReadOptstr(NULL, next, "MaterialType", &size, NULL)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
name = new char[size + 1];
|
name = new char[size + 1];
|
||||||
CCMIOReadOptstr(&err, next, "MaterialType", &size, name);
|
CCMIOReadOptstr(&err, next, "MaterialType", &size, name);
|
||||||
CCMIOGetEntityIndex(&err, next, &cellType);
|
CCMIOGetEntityIndex(&err, next, &cellType);
|
||||||
|
|
||||||
foamCellTypeNames.insert(cellType, name);
|
foamCellTypeNames.insert(cellType, name);
|
||||||
Pout<< "Celltype:" << cellType << " name:" << name << endl;
|
Pout<< "Celltype:" << cellType << " name:" << name << endl;
|
||||||
|
|
||||||
delete [] name;
|
delete [] name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... walk through each region description and print it...
|
// ... walk through each region description and print it...
|
||||||
|
|
||||||
|
|
||||||
CCMIOID boundary;
|
CCMIOID boundary;
|
||||||
label regionI = 0;
|
label regionI = 0;
|
||||||
int k = 0;
|
int k = 0;
|
||||||
@ -320,13 +322,13 @@ void ReadProblem
|
|||||||
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
|
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, NULL)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char* s = new char[size + 1];
|
char* s = new char[size + 1];
|
||||||
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
|
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
|
||||||
s[size] = '\0';
|
s[size] = '\0';
|
||||||
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
|
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
|
||||||
delete [] s;
|
delete [] s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//foamPatchMap.append(prostarI);
|
//foamPatchMap.append(prostarI);
|
||||||
@ -342,25 +344,25 @@ void ReadProblem
|
|||||||
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
|
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, NULL)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char* name = new char[size + 1];
|
char* name = new char[size + 1];
|
||||||
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
|
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
|
||||||
name[size] = '\0';
|
name[size] = '\0';
|
||||||
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
|
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
|
||||||
delete [] name;
|
delete [] name;
|
||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL)
|
CCMIOReadOptstr(NULL, boundary, "Label", &size, NULL)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
char* name = new char[size + 1];
|
char* name = new char[size + 1];
|
||||||
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
|
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
|
||||||
name[size] = '\0';
|
name[size] = '\0';
|
||||||
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
|
foamPatchNames[foamPatchI] = string::validate<word>(string(name));
|
||||||
delete [] name;
|
delete [] name;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foamPatchNames[foamPatchI] =
|
foamPatchNames[foamPatchI] =
|
||||||
@ -440,8 +442,8 @@ void ReadCells
|
|||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
CCMIOSize size;
|
CCMIOSize size;
|
||||||
CCMIOEntitySize(&err, id, &size, NULL);
|
CCMIOEntitySize(&err, id, &size, NULL);
|
||||||
|
|
||||||
Pout<< "Read kCCMIOBoundaryFaces entry with " << size
|
Pout<< "Read kCCMIOBoundaryFaces entry with " << size
|
||||||
<< " faces." << endl;
|
<< " faces." << endl;
|
||||||
@ -461,13 +463,13 @@ void ReadCells
|
|||||||
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
|
CCMIOGetEntity(&err, topology, kCCMIOInternalFaces, 0, &id);
|
||||||
CCMIOSize size;
|
CCMIOSize size;
|
||||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL,
|
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, NULL, &size, NULL,
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
std::vector<int> faces(size);
|
std::vector<int> faces(size);
|
||||||
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
|
CCMIOReadFaces(&err, id, kCCMIOInternalFaces, &mapID, NULL, &faces[0],
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
std::vector<int> faceCells(2*nInternalFaces);
|
std::vector<int> faceCells(2*nInternalFaces);
|
||||||
CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
|
CCMIOReadFaceCells(&err, id, kCCMIOInternalFaces, &faceCells[0],
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
|
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
|
||||||
CheckError(err, "Error reading internal faces");
|
CheckError(err, "Error reading internal faces");
|
||||||
|
|
||||||
@ -505,19 +507,19 @@ void ReadCells
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
CCMIOSize nFaces;
|
CCMIOSize nFaces;
|
||||||
CCMIOEntitySize(&err, id, &nFaces, NULL);
|
CCMIOEntitySize(&err, id, &nFaces, NULL);
|
||||||
|
|
||||||
mapData.resize(nFaces);
|
mapData.resize(nFaces);
|
||||||
faceCells.resize(nFaces);
|
faceCells.resize(nFaces);
|
||||||
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
|
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, NULL, &size, NULL,
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
faces.resize(size);
|
faces.resize(size);
|
||||||
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
|
CCMIOReadFaces(&err, id, kCCMIOBoundaryFaces, &mapID, NULL, &faces[0],
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
|
CCMIOReadFaceCells(&err, id, kCCMIOBoundaryFaces, &faceCells[0],
|
||||||
kCCMIOStart, kCCMIOEnd);
|
kCCMIOStart, kCCMIOEnd);
|
||||||
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
|
CCMIOReadMap(&err, mapID, &mapData[0], kCCMIOStart, kCCMIOEnd);
|
||||||
CheckError(err, "Error reading boundary faces");
|
CheckError(err, "Error reading boundary faces");
|
||||||
|
|
||||||
// Read prostar id
|
// Read prostar id
|
||||||
int prostarI;
|
int prostarI;
|
||||||
@ -672,9 +674,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (err != kCCMIONoErr)
|
if (err != kCCMIONoErr)
|
||||||
{
|
{
|
||||||
// Maybe no solution; try again
|
// Maybe no solution; try again
|
||||||
err = kCCMIONoErr;
|
err = kCCMIONoErr;
|
||||||
CCMIOReadProcessor
|
CCMIOReadProcessor
|
||||||
(
|
(
|
||||||
&err,
|
&err,
|
||||||
processor,
|
processor,
|
||||||
@ -683,12 +685,12 @@ int main(int argc, char *argv[])
|
|||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL
|
||||||
);
|
);
|
||||||
if (err != kCCMIONoErr)
|
if (err != kCCMIONoErr)
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Could not read the file."
|
<< "Could not read the file."
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadVertices(err, vertices, foamPointMap, foamPoints);
|
ReadVertices(err, vertices, foamPointMap, foamPoints);
|
||||||
|
|||||||
@ -238,7 +238,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("ANSYS input file");
|
argList::validArgs.append("ANSYS input file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
|
|||||||
@ -22,13 +22,9 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
|
||||||
#include "block.H"
|
#include "block.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("CFX geom file");
|
argList::validArgs.append("CFX geom file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ int main(int argc, char *argv[])
|
|||||||
word blockName;
|
word blockName;
|
||||||
label nx, ny, nz;
|
label nx, ny, nz;
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
cfxFile >> blockName;
|
cfxFile >> blockName;
|
||||||
cfxFile >> nx >> ny >> nz;
|
cfxFile >> nx >> ny >> nz;
|
||||||
@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label no, blkNo, patchLabel;
|
label no, blkNo, patchLabel;
|
||||||
|
|
||||||
forAll (cfxPatchTypes, patchI)
|
forAll(cfxPatchTypes, patchI)
|
||||||
{
|
{
|
||||||
// Grab patch type and name
|
// Grab patch type and name
|
||||||
cfxFile >> cfxPatchTypes[patchI] >> cfxPatchNames[patchI] >> no;
|
cfxFile >> cfxPatchTypes[patchI] >> cfxPatchNames[patchI] >> no;
|
||||||
@ -110,7 +110,7 @@ int main(int argc, char *argv[])
|
|||||||
patchRanges[patchI].setSize(6);
|
patchRanges[patchI].setSize(6);
|
||||||
labelList& curRange = patchRanges[patchI];
|
labelList& curRange = patchRanges[patchI];
|
||||||
|
|
||||||
forAll (curRange, rI)
|
forAll(curRange, rI)
|
||||||
{
|
{
|
||||||
cfxFile >> curRange[rI];
|
cfxFile >> curRange[rI];
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< "Reading block points" << endl;
|
Info<< "Reading block points" << endl;
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
Info<< "block " << blockI << " is a ";
|
Info<< "block " << blockI << " is a ";
|
||||||
blocks[blockI].readPoints(cfxFile);
|
blocks[blockI].readPoints(cfxFile);
|
||||||
@ -176,7 +176,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faceListList rawPatches(npatch);
|
faceListList rawPatches(npatch);
|
||||||
|
|
||||||
forAll (rawPatches, patchI)
|
forAll(rawPatches, patchI)
|
||||||
{
|
{
|
||||||
const word& patchType = cfxPatchTypes[patchI];
|
const word& patchType = cfxPatchTypes[patchI];
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
|||||||
// For efficiency, create merge pairs in the first pass
|
// For efficiency, create merge pairs in the first pass
|
||||||
labelListListList glueMergePairs(glueMasterPatches.size());
|
labelListListList glueMergePairs(glueMasterPatches.size());
|
||||||
|
|
||||||
forAll (glueMasterPatches, glueI)
|
forAll(glueMasterPatches, glueI)
|
||||||
{
|
{
|
||||||
const label masterPatch = glueMasterPatches[glueI];
|
const label masterPatch = glueMasterPatches[glueI];
|
||||||
const label slavePatch = glueSlavePatches[glueI];
|
const label slavePatch = glueSlavePatches[glueI];
|
||||||
@ -247,14 +247,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
scalar sqrMergeTol = GREAT;
|
scalar sqrMergeTol = GREAT;
|
||||||
|
|
||||||
forAll (blockPFaces, blockPFaceLabel)
|
forAll(blockPFaces, blockPFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockPFacePoints =
|
const labelList& blockPFacePoints =
|
||||||
blockPFaces[blockPFaceLabel];
|
blockPFaces[blockPFaceLabel];
|
||||||
|
|
||||||
forAll (blockPFacePoints, blockPFacePointI)
|
forAll(blockPFacePoints, blockPFacePointI)
|
||||||
{
|
{
|
||||||
forAll (blockPFacePoints, blockPFacePointI2)
|
forAll(blockPFacePoints, blockPFacePointI2)
|
||||||
{
|
{
|
||||||
if (blockPFacePointI != blockPFacePointI2)
|
if (blockPFacePointI != blockPFacePointI2)
|
||||||
{
|
{
|
||||||
@ -281,7 +281,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// N-squared point search over all points of all faces of
|
// N-squared point search over all points of all faces of
|
||||||
// master block over all point of all faces of slave block
|
// master block over all point of all faces of slave block
|
||||||
forAll (blockPFaces, blockPFaceLabel)
|
forAll(blockPFaces, blockPFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockPFacePoints =
|
const labelList& blockPFacePoints =
|
||||||
blockPFaces[blockPFaceLabel];
|
blockPFaces[blockPFaceLabel];
|
||||||
@ -289,16 +289,16 @@ int main(int argc, char *argv[])
|
|||||||
labelList& cp = curPairs[blockPFaceLabel];
|
labelList& cp = curPairs[blockPFaceLabel];
|
||||||
cp.setSize(blockPFacePoints.size());
|
cp.setSize(blockPFacePoints.size());
|
||||||
|
|
||||||
forAll (blockPFacePoints, blockPFacePointI)
|
forAll(blockPFacePoints, blockPFacePointI)
|
||||||
{
|
{
|
||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
forAll (blockNFaces, blockNFaceLabel)
|
forAll(blockNFaces, blockNFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockNFacePoints =
|
const labelList& blockNFacePoints =
|
||||||
blockNFaces[blockNFaceLabel];
|
blockNFaces[blockNFaceLabel];
|
||||||
|
|
||||||
forAll (blockNFacePoints, blockNFacePointI)
|
forAll(blockNFacePoints, blockNFacePointI)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -360,7 +360,7 @@ int main(int argc, char *argv[])
|
|||||||
changedPointMerge = false;
|
changedPointMerge = false;
|
||||||
nPasses++;
|
nPasses++;
|
||||||
|
|
||||||
forAll (glueMasterPatches, glueI)
|
forAll(glueMasterPatches, glueI)
|
||||||
{
|
{
|
||||||
const label masterPatch = glueMasterPatches[glueI];
|
const label masterPatch = glueMasterPatches[glueI];
|
||||||
const label slavePatch = glueSlavePatches[glueI];
|
const label slavePatch = glueSlavePatches[glueI];
|
||||||
@ -372,14 +372,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const labelListList& curPairs = glueMergePairs[glueI];
|
const labelListList& curPairs = glueMergePairs[glueI];
|
||||||
|
|
||||||
forAll (blockPFaces, blockPFaceLabel)
|
forAll(blockPFaces, blockPFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockPFacePoints =
|
const labelList& blockPFacePoints =
|
||||||
blockPFaces[blockPFaceLabel];
|
blockPFaces[blockPFaceLabel];
|
||||||
|
|
||||||
const labelList& cp = curPairs[blockPFaceLabel];
|
const labelList& cp = curPairs[blockPFaceLabel];
|
||||||
|
|
||||||
forAll (cp, blockPFacePointI)
|
forAll(cp, blockPFacePointI)
|
||||||
{
|
{
|
||||||
label PpointLabel =
|
label PpointLabel =
|
||||||
blockPFacePoints[blockPFacePointI]
|
blockPFacePoints[blockPFacePointI]
|
||||||
@ -421,7 +421,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
forAll (glueMasterPatches, glueI)
|
forAll(glueMasterPatches, glueI)
|
||||||
{
|
{
|
||||||
const label masterPatch = glueMasterPatches[glueI];
|
const label masterPatch = glueMasterPatches[glueI];
|
||||||
const label slavePatch = glueSlavePatches[glueI];
|
const label slavePatch = glueSlavePatches[glueI];
|
||||||
@ -433,12 +433,12 @@ int main(int argc, char *argv[])
|
|||||||
const faceList& blockNFaces = rawPatches[slavePatch];
|
const faceList& blockNFaces = rawPatches[slavePatch];
|
||||||
|
|
||||||
|
|
||||||
forAll (blockPFaces, blockPFaceLabel)
|
forAll(blockPFaces, blockPFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockPFacePoints
|
const labelList& blockPFacePoints
|
||||||
= blockPFaces[blockPFaceLabel];
|
= blockPFaces[blockPFaceLabel];
|
||||||
|
|
||||||
forAll (blockPFacePoints, blockPFacePointI)
|
forAll(blockPFacePoints, blockPFacePointI)
|
||||||
{
|
{
|
||||||
label PpointLabel =
|
label PpointLabel =
|
||||||
blockPFacePoints[blockPFacePointI]
|
blockPFacePoints[blockPFacePointI]
|
||||||
@ -455,12 +455,12 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll (blockNFaces, blockNFaceLabel)
|
forAll(blockNFaces, blockNFaceLabel)
|
||||||
{
|
{
|
||||||
const labelList& blockNFacePoints
|
const labelList& blockNFacePoints
|
||||||
= blockNFaces[blockNFaceLabel];
|
= blockNFaces[blockNFaceLabel];
|
||||||
|
|
||||||
forAll (blockNFacePoints, blockNFacePointI)
|
forAll(blockNFacePoints, blockNFacePointI)
|
||||||
{
|
{
|
||||||
label NpointLabel =
|
label NpointLabel =
|
||||||
blockNFacePoints[blockNFacePointI]
|
blockNFacePoints[blockNFacePointI]
|
||||||
@ -483,7 +483,7 @@ int main(int argc, char *argv[])
|
|||||||
// given old point label
|
// given old point label
|
||||||
label nNewPoints = 0;
|
label nNewPoints = 0;
|
||||||
|
|
||||||
forAll (pointMergeList, pointLabel)
|
forAll(pointMergeList, pointLabel)
|
||||||
{
|
{
|
||||||
if (pointMergeList[pointLabel] > pointLabel)
|
if (pointMergeList[pointLabel] > pointLabel)
|
||||||
{
|
{
|
||||||
@ -513,11 +513,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
pointField points(nMeshPoints);
|
pointField points(nMeshPoints);
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
const pointField& blockPoints = blocks[blockI].points();
|
const pointField& blockPoints = blocks[blockI].points();
|
||||||
|
|
||||||
forAll (blockPoints, blockPointLabel)
|
forAll(blockPoints, blockPointLabel)
|
||||||
{
|
{
|
||||||
points
|
points
|
||||||
[
|
[
|
||||||
@ -544,15 +544,15 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nCreatedCells = 0;
|
label nCreatedCells = 0;
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||||
|
|
||||||
forAll (curBlockCells, blockCellI)
|
forAll(curBlockCells, blockCellI)
|
||||||
{
|
{
|
||||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||||
|
|
||||||
forAll (cellPoints, pointI)
|
forAll(cellPoints, pointI)
|
||||||
{
|
{
|
||||||
cellPoints[pointI] =
|
cellPoints[pointI] =
|
||||||
pointMergeList
|
pointMergeList
|
||||||
@ -579,7 +579,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nCreatedPatches = 0;
|
label nCreatedPatches = 0;
|
||||||
|
|
||||||
forAll (rawPatches, patchI)
|
forAll(rawPatches, patchI)
|
||||||
{
|
{
|
||||||
if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY")
|
if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY")
|
||||||
{
|
{
|
||||||
@ -610,14 +610,14 @@ int main(int argc, char *argv[])
|
|||||||
label oldSize = renumberedPatch.size();
|
label oldSize = renumberedPatch.size();
|
||||||
renumberedPatch.setSize(oldSize + curRawPatch.size());
|
renumberedPatch.setSize(oldSize + curRawPatch.size());
|
||||||
|
|
||||||
forAll (curRawPatch, faceI)
|
forAll(curRawPatch, faceI)
|
||||||
{
|
{
|
||||||
const face& oldFace = curRawPatch[faceI];
|
const face& oldFace = curRawPatch[faceI];
|
||||||
|
|
||||||
face& newFace = renumberedPatch[oldSize + faceI];
|
face& newFace = renumberedPatch[oldSize + faceI];
|
||||||
newFace.setSize(oldFace.size());
|
newFace.setSize(oldFace.size());
|
||||||
|
|
||||||
forAll (oldFace, pointI)
|
forAll(oldFace, pointI)
|
||||||
{
|
{
|
||||||
newFace[pointI] =
|
newFace[pointI] =
|
||||||
pointMergeList
|
pointMergeList
|
||||||
@ -634,14 +634,14 @@ int main(int argc, char *argv[])
|
|||||||
faceList& renumberedPatch = boundary[nCreatedPatches];
|
faceList& renumberedPatch = boundary[nCreatedPatches];
|
||||||
renumberedPatch.setSize(curRawPatch.size());
|
renumberedPatch.setSize(curRawPatch.size());
|
||||||
|
|
||||||
forAll (curRawPatch, faceI)
|
forAll(curRawPatch, faceI)
|
||||||
{
|
{
|
||||||
const face& oldFace = curRawPatch[faceI];
|
const face& oldFace = curRawPatch[faceI];
|
||||||
|
|
||||||
face& newFace = renumberedPatch[faceI];
|
face& newFace = renumberedPatch[faceI];
|
||||||
newFace.setSize(oldFace.size());
|
newFace.setSize(oldFace.size());
|
||||||
|
|
||||||
forAll (oldFace, pointI)
|
forAll(oldFace, pointI)
|
||||||
{
|
{
|
||||||
newFace[pointI] =
|
newFace[pointI] =
|
||||||
pointMergeList
|
pointMergeList
|
||||||
|
|||||||
@ -22,8 +22,6 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "hexBlock.H"
|
#include "hexBlock.H"
|
||||||
@ -58,7 +56,7 @@ hexBlock::hexBlock(const label nx, const label ny, const label nz)
|
|||||||
|
|
||||||
void hexBlock::readPoints(Istream& is)
|
void hexBlock::readPoints(Istream& is)
|
||||||
{
|
{
|
||||||
forAll (points_, i)
|
forAll(points_, i)
|
||||||
{
|
{
|
||||||
is >> points_[i].x() >> points_[i].y() >> points_[i].z();
|
is >> points_[i].x() >> points_[i].y() >> points_[i].z();
|
||||||
}
|
}
|
||||||
@ -376,7 +374,7 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
|||||||
else if (blockHandedness_ == left)
|
else if (blockHandedness_ == left)
|
||||||
{
|
{
|
||||||
// turn all faces inside out
|
// turn all faces inside out
|
||||||
forAll (result, faceI)
|
forAll(result, faceI)
|
||||||
{
|
{
|
||||||
result[faceI] = result[faceI].reverseFace();
|
result[faceI] = result[faceI].reverseFace();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -473,7 +473,7 @@ endOfSection {space}")"{space}
|
|||||||
// set size of label list
|
// set size of label list
|
||||||
curFaceLabels.setSize(strtol(YYText(), &endPtr, 16));
|
curFaceLabels.setSize(strtol(YYText(), &endPtr, 16));
|
||||||
|
|
||||||
forAll (curFaceLabels, i)
|
forAll(curFaceLabels, i)
|
||||||
{
|
{
|
||||||
curFaceLabels[i] = strtol(endPtr, &endPtr, 16) - 1;
|
curFaceLabels[i] = strtol(endPtr, &endPtr, 16) - 1;
|
||||||
}
|
}
|
||||||
@ -762,10 +762,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("Fluent mesh file");
|
argList::validArgs.append("Fluent mesh file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
argList::validOptions.insert("ignoreCellGroups", "cell group names");
|
argList::addOption("ignoreCellGroups", "cell group names");
|
||||||
argList::validOptions.insert("ignoreFaceGroups", "face group names");
|
argList::addOption("ignoreFaceGroups", "face group names");
|
||||||
argList::validOptions.insert("cubit", "");
|
argList::addBoolOption("cubit");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -776,17 +776,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
args.optionReadIfPresent("scale", scaleFactor);
|
args.optionReadIfPresent("scale", scaleFactor);
|
||||||
|
|
||||||
HashSet<word> ignoreCellGroups;
|
wordHashSet ignoreCellGroups;
|
||||||
if (args.optionFound("ignoreCellGroups"))
|
wordHashSet ignoreFaceGroups;
|
||||||
{
|
|
||||||
args.optionLookup("ignoreCellGroups")() >> ignoreCellGroups;
|
|
||||||
}
|
|
||||||
|
|
||||||
HashSet<word> ignoreFaceGroups;
|
args.optionReadIfPresent("ignoreCellGroups", ignoreCellGroups);
|
||||||
if (args.optionFound("ignoreFaceGroups"))
|
args.optionReadIfPresent("ignoreFaceGroups", ignoreFaceGroups);
|
||||||
{
|
|
||||||
args.optionLookup("ignoreFaceGroups")() >> ignoreFaceGroups;
|
|
||||||
}
|
|
||||||
|
|
||||||
cubitFile = args.options().found("cubit");
|
cubitFile = args.options().found("cubit");
|
||||||
|
|
||||||
@ -843,7 +837,7 @@ int main(int argc, char *argv[])
|
|||||||
// faces and move to neighbour
|
// faces and move to neighbour
|
||||||
|
|
||||||
boolList fm(faces.size(), false);
|
boolList fm(faces.size(), false);
|
||||||
forAll (faces, facei)
|
forAll(faces, facei)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -155,7 +155,7 @@ cellShape create3DCellShape
|
|||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll (localFaces, meshFaceI)
|
forAll(localFaces, meshFaceI)
|
||||||
{
|
{
|
||||||
if (localFaces[meshFaceI].size() == firstModelFace.size())
|
if (localFaces[meshFaceI].size() == firstModelFace.size())
|
||||||
{
|
{
|
||||||
@ -166,7 +166,7 @@ cellShape create3DCellShape
|
|||||||
|
|
||||||
meshFaceUsed[meshFaceI] = true;
|
meshFaceUsed[meshFaceI] = true;
|
||||||
|
|
||||||
forAll (curMeshFace, pointI)
|
forAll(curMeshFace, pointI)
|
||||||
{
|
{
|
||||||
pointLabels[firstModelFace[pointI]] = curMeshFace[pointI];
|
pointLabels[firstModelFace[pointI]] = curMeshFace[pointI];
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ cellShape create3DCellShape
|
|||||||
found = false;
|
found = false;
|
||||||
|
|
||||||
// Loop through mesh faces until a match is found
|
// Loop through mesh faces until a match is found
|
||||||
forAll (localFaces, meshFaceI)
|
forAll(localFaces, meshFaceI)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -220,7 +220,7 @@ cellShape create3DCellShape
|
|||||||
// try matching the face
|
// try matching the face
|
||||||
label nMatchedLabels = 0;
|
label nMatchedLabels = 0;
|
||||||
|
|
||||||
forAll (meshFaceLabels, pointI)
|
forAll(meshFaceLabels, pointI)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -241,7 +241,7 @@ cellShape create3DCellShape
|
|||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
// match found. Insert mesh face
|
// match found. Insert mesh face
|
||||||
forAll (meshFaceLabels, pointI)
|
forAll(meshFaceLabels, pointI)
|
||||||
{
|
{
|
||||||
pointLabels[curModelFace[pointI]] =
|
pointLabels[curModelFace[pointI]] =
|
||||||
meshFaceLabels[pointI];
|
meshFaceLabels[pointI];
|
||||||
|
|||||||
@ -73,7 +73,7 @@ cellShape extrudedQuadCellShape
|
|||||||
// make a list of outward-pointing faces
|
// make a list of outward-pointing faces
|
||||||
labelListList localFaces(4);
|
labelListList localFaces(4);
|
||||||
|
|
||||||
forAll (faceLabels, faceI)
|
forAll(faceLabels, faceI)
|
||||||
{
|
{
|
||||||
const label curFaceLabel = faceLabels[faceI];
|
const label curFaceLabel = faceLabels[faceI];
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ cellShape extrudedTriangleCellShape
|
|||||||
// make a list of outward-pointing faces
|
// make a list of outward-pointing faces
|
||||||
labelListList localFaces(3);
|
labelListList localFaces(3);
|
||||||
|
|
||||||
forAll (faceLabels, faceI)
|
forAll(faceLabels, faceI)
|
||||||
{
|
{
|
||||||
const label curFaceLabel = faceLabels[faceI];
|
const label curFaceLabel = faceLabels[faceI];
|
||||||
|
|
||||||
|
|||||||
@ -490,7 +490,7 @@ endOfSection {space}")"{space}
|
|||||||
// set size of label list
|
// set size of label list
|
||||||
curFaceLabels.setSize(readLabel(mixedFaceStream));
|
curFaceLabels.setSize(readLabel(mixedFaceStream));
|
||||||
|
|
||||||
forAll (curFaceLabels, i)
|
forAll(curFaceLabels, i)
|
||||||
{
|
{
|
||||||
curFaceLabels[i] = readHexLabel(mixedFaceStream) - 1;
|
curFaceLabels[i] = readHexLabel(mixedFaceStream) - 1;
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ endOfSection {space}")"{space}
|
|||||||
// for edge is 2, for triangle is 3 and for quad is 4
|
// for edge is 2, for triangle is 3 and for quad is 4
|
||||||
curFaceLabels.setSize(faceGroupElementType);
|
curFaceLabels.setSize(faceGroupElementType);
|
||||||
|
|
||||||
forAll (curFaceLabels, i)
|
forAll(curFaceLabels, i)
|
||||||
{
|
{
|
||||||
curFaceLabels[i] = readHexLabel(mixedFaceStream) - 1;
|
curFaceLabels[i] = readHexLabel(mixedFaceStream) - 1;
|
||||||
}
|
}
|
||||||
@ -867,9 +867,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("Fluent mesh file");
|
argList::validArgs.append("Fluent mesh file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
argList::validOptions.insert("writeSets", "");
|
argList::addBoolOption("writeSets");
|
||||||
argList::validOptions.insert("writeZones", "");
|
argList::addBoolOption("writeZones");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -915,14 +915,14 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList nFacesInCell(nCells, 0);
|
labelList nFacesInCell(nCells, 0);
|
||||||
|
|
||||||
forAll (cellFaces, celli)
|
forAll(cellFaces, celli)
|
||||||
{
|
{
|
||||||
cellFaces[celli].setSize(fluentModelNFaces[fluentCellModelID[celli] ]);
|
cellFaces[celli].setSize(fluentModelNFaces[fluentCellModelID[celli] ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fill in owner and neighbour
|
// fill in owner and neighbour
|
||||||
|
|
||||||
forAll (owner, faceI)
|
forAll(owner, faceI)
|
||||||
{
|
{
|
||||||
if (owner[faceI] > -1)
|
if (owner[faceI] > -1)
|
||||||
{
|
{
|
||||||
@ -933,7 +933,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll (neighbour, faceI)
|
forAll(neighbour, faceI)
|
||||||
{
|
{
|
||||||
if (neighbour[faceI] > -1)
|
if (neighbour[faceI] > -1)
|
||||||
{
|
{
|
||||||
@ -976,7 +976,7 @@ int main(int argc, char *argv[])
|
|||||||
// points given by Fluent need to represent the FRONT plane of the
|
// points given by Fluent need to represent the FRONT plane of the
|
||||||
// geometry. Therefore, the extrusion will be in -z direction
|
// geometry. Therefore, the extrusion will be in -z direction
|
||||||
//
|
//
|
||||||
forAll (oldPoints, pointI)
|
forAll(oldPoints, pointI)
|
||||||
{
|
{
|
||||||
points[nNewPoints] = oldPoints[pointI];
|
points[nNewPoints] = oldPoints[pointI];
|
||||||
|
|
||||||
@ -985,7 +985,7 @@ int main(int argc, char *argv[])
|
|||||||
nNewPoints++;
|
nNewPoints++;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll (oldPoints, pointI)
|
forAll(oldPoints, pointI)
|
||||||
{
|
{
|
||||||
points[nNewPoints] = oldPoints[pointI];
|
points[nNewPoints] = oldPoints[pointI];
|
||||||
|
|
||||||
@ -1000,7 +1000,7 @@ int main(int argc, char *argv[])
|
|||||||
// Set the number of empty faces
|
// Set the number of empty faces
|
||||||
frontAndBackFaces.setSize(2*nCells);
|
frontAndBackFaces.setSize(2*nCells);
|
||||||
|
|
||||||
forAll (fluentCellModelID, celli)
|
forAll(fluentCellModelID, celli)
|
||||||
{
|
{
|
||||||
switch (fluentCellModelID[celli])
|
switch (fluentCellModelID[celli])
|
||||||
{
|
{
|
||||||
@ -1053,7 +1053,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create new faces
|
// Create new faces
|
||||||
forAll (faces, faceI)
|
forAll(faces, faceI)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (faces[faceI].size() != 2)
|
if (faces[faceI].size() != 2)
|
||||||
@ -1078,7 +1078,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// 3-D shape recognition
|
// 3-D shape recognition
|
||||||
Info<< "Creating shapes for 3-D cells"<< endl;
|
Info<< "Creating shapes for 3-D cells"<< endl;
|
||||||
forAll (fluentCellModelID, celli)
|
forAll(fluentCellModelID, celli)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
@ -1116,7 +1116,7 @@ int main(int argc, char *argv[])
|
|||||||
// area vector points into the domain. Turn them round before making patches
|
// area vector points into the domain. Turn them round before making patches
|
||||||
// for Foam compatibility
|
// for Foam compatibility
|
||||||
|
|
||||||
forAll (faces, faceI)
|
forAll(faces, faceI)
|
||||||
{
|
{
|
||||||
if (owner[faceI] == -1)
|
if (owner[faceI] == -1)
|
||||||
{
|
{
|
||||||
@ -1232,7 +1232,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
|
faceList patchFaces(faceGroupEndIndexIter() - faceLabel);
|
||||||
|
|
||||||
forAll (patchFaces, faceI)
|
forAll(patchFaces, faceI)
|
||||||
{
|
{
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
|
|||||||
@ -113,7 +113,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
const pointField& p = points();
|
const pointField& p = points();
|
||||||
|
|
||||||
forAll (p, pointI)
|
forAll(p, pointI)
|
||||||
{
|
{
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< " "
|
<< " "
|
||||||
@ -135,7 +135,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
<< "(13 (2 1 "
|
<< "(13 (2 1 "
|
||||||
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
|
<< own.size() << " 2 0)" << std::endl << "(" << std::endl;
|
||||||
|
|
||||||
forAll (own, faceI)
|
forAll(own, faceI)
|
||||||
{
|
{
|
||||||
const labelList& l = fcs[faceI];
|
const labelList& l = fcs[faceI];
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
fluentMeshFile << l.size() << " ";
|
fluentMeshFile << l.size() << " ";
|
||||||
|
|
||||||
forAll (l, lI)
|
forAll(l, lI)
|
||||||
{
|
{
|
||||||
fluentMeshFile << l[lI] + 1 << " ";
|
fluentMeshFile << l[lI] + 1 << " ";
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
label nWrittenFaces = own.size();
|
label nWrittenFaces = own.size();
|
||||||
|
|
||||||
// Writing boundary faces
|
// Writing boundary faces
|
||||||
forAll (boundary(), patchI)
|
forAll(boundary(), patchI)
|
||||||
{
|
{
|
||||||
const unallocFaceList& patchFaces = boundaryMesh()[patchI];
|
const unallocFaceList& patchFaces = boundaryMesh()[patchI];
|
||||||
|
|
||||||
@ -190,7 +190,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<<" 0)" << std::endl << "(" << std::endl;
|
<<" 0)" << std::endl << "(" << std::endl;
|
||||||
|
|
||||||
forAll (patchFaces, faceI)
|
forAll(patchFaces, faceI)
|
||||||
{
|
{
|
||||||
const labelList& l = patchFaces[faceI];
|
const labelList& l = patchFaces[faceI];
|
||||||
|
|
||||||
@ -225,7 +225,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
|
|
||||||
bool hasWarned = false;
|
bool hasWarned = false;
|
||||||
|
|
||||||
forAll (cells, cellI)
|
forAll(cells, cellI)
|
||||||
{
|
{
|
||||||
if (cells[cellI].model() == tet)
|
if (cells[cellI].model() == tet)
|
||||||
{
|
{
|
||||||
@ -270,7 +270,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
|
|||||||
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
|
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
|
||||||
|
|
||||||
// Writing boundary patch types
|
// Writing boundary patch types
|
||||||
forAll (boundary(), patchI)
|
forAll(boundary(), patchI)
|
||||||
{
|
{
|
||||||
fluentMeshFile
|
fluentMeshFile
|
||||||
<< "(39 (" << patchI + 10 << " ";
|
<< "(39 (" << patchI + 10 << " ";
|
||||||
|
|||||||
@ -76,10 +76,27 @@ int main(int argc, char *argv[])
|
|||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
timeSelector::addOptions();
|
timeSelector::addOptions();
|
||||||
|
|
||||||
argList::validOptions.insert("scale", "scale");
|
argList::addOption
|
||||||
argList::validOptions.insert("noBnd", "");
|
(
|
||||||
argList::validOptions.insert("tri", "");
|
"scale",
|
||||||
argList::validOptions.insert("surface", "");
|
"factor",
|
||||||
|
"specify geometry scaling factor - default is 1000 ([m] to [mm])"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"noBnd",
|
||||||
|
"suppress writing the .bnd file"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"tri",
|
||||||
|
"Extract a triangulated surface. Implies -surface"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"surface",
|
||||||
|
"extract the surface of the volume mesh only"
|
||||||
|
);
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -583,7 +583,7 @@ mtype {space}"MTYPE:"{space}
|
|||||||
{
|
{
|
||||||
scalarList patchFaceValues(nValuesForPatchFaces);
|
scalarList patchFaceValues(nValuesForPatchFaces);
|
||||||
|
|
||||||
forAll (patchFaceValues, fI)
|
forAll(patchFaceValues, fI)
|
||||||
{
|
{
|
||||||
patchFaceValues[fI] = readScalar(patchFacesStream);
|
patchFaceValues[fI] = readScalar(patchFacesStream);
|
||||||
}
|
}
|
||||||
@ -639,7 +639,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("GAMBIT file");
|
argList::validArgs.append("GAMBIT file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -673,7 +673,7 @@ int main(int argc, char *argv[])
|
|||||||
// make a point mapping array
|
// make a point mapping array
|
||||||
label maxPointIndex = 0;
|
label maxPointIndex = 0;
|
||||||
|
|
||||||
forAll (pointMap, pointI)
|
forAll(pointMap, pointI)
|
||||||
{
|
{
|
||||||
if (pointMap[pointI] > maxPointIndex)
|
if (pointMap[pointI] > maxPointIndex)
|
||||||
{
|
{
|
||||||
@ -684,7 +684,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList pointLookup(maxPointIndex + 1, -1);
|
labelList pointLookup(maxPointIndex + 1, -1);
|
||||||
|
|
||||||
forAll (pointMap, pointI)
|
forAll(pointMap, pointI)
|
||||||
{
|
{
|
||||||
pointLookup[pointMap[pointI] ] = pointI;
|
pointLookup[pointMap[pointI] ] = pointI;
|
||||||
}
|
}
|
||||||
@ -692,7 +692,7 @@ int main(int argc, char *argv[])
|
|||||||
// make a cell mapping array
|
// make a cell mapping array
|
||||||
label maxCellIndex = 0;
|
label maxCellIndex = 0;
|
||||||
|
|
||||||
forAll (cellMap, cellI)
|
forAll(cellMap, cellI)
|
||||||
{
|
{
|
||||||
if (cellMap[cellI] > maxCellIndex)
|
if (cellMap[cellI] > maxCellIndex)
|
||||||
{
|
{
|
||||||
@ -702,7 +702,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
labelList cellLookup(maxCellIndex + 1);
|
labelList cellLookup(maxCellIndex + 1);
|
||||||
|
|
||||||
forAll (cellMap, cellI)
|
forAll(cellMap, cellI)
|
||||||
{
|
{
|
||||||
cellLookup[cellMap[cellI] ] = cellI;
|
cellLookup[cellMap[cellI] ] = cellI;
|
||||||
}
|
}
|
||||||
@ -719,7 +719,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
cellShapeList cells(cellLabels.size());
|
cellShapeList cells(cellLabels.size());
|
||||||
|
|
||||||
forAll (cellTypes, cellI)
|
forAll(cellTypes, cellI)
|
||||||
{
|
{
|
||||||
const labelList& curCellLabels = cellLabels[cellI];
|
const labelList& curCellLabels = cellLabels[cellI];
|
||||||
|
|
||||||
@ -798,7 +798,7 @@ int main(int argc, char *argv[])
|
|||||||
faceList& patchFaces = boundary[patchI];
|
faceList& patchFaces = boundary[patchI];
|
||||||
patchFaces.setSize(curCells.size());
|
patchFaces.setSize(curCells.size());
|
||||||
|
|
||||||
forAll (curCells, faceI)
|
forAll(curCells, faceI)
|
||||||
{
|
{
|
||||||
patchFaces[faceI] =
|
patchFaces[faceI] =
|
||||||
cells[cellLookup[curCells[faceI] ] ].faces()
|
cells[cellLookup[curCells[faceI] ] ].faces()
|
||||||
|
|||||||
@ -717,7 +717,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append(".msh file");
|
argList::validArgs.append(".msh file");
|
||||||
argList::validOptions.insert("keepOrientation", "");
|
argList::addBoolOption("keepOrientation");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -579,7 +579,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append(".unv file");
|
argList::validArgs.append(".unv file");
|
||||||
argList::validOptions.insert("dump", "");
|
argList::addBoolOption("dump");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
quadFace[3] = pointMap[quadFace[3]];
|
quadFace[3] = pointMap[quadFace[3]];
|
||||||
|
|
||||||
label ti = 0;
|
label ti = 0;
|
||||||
forAll (quadFace, i)
|
forAll(quadFace, i)
|
||||||
{
|
{
|
||||||
if (quadFace[i] != quadFace[(i+1)%4])
|
if (quadFace[i] != quadFace[(i+1)%4])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -60,9 +60,9 @@ enum kivaVersions
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("file", "fileName");
|
argList::addOption("file", "fileName");
|
||||||
argList::validOptions.insert("version", "[kiva3|kiva3v]");
|
argList::addOption("version", "[kiva3|kiva3v]");
|
||||||
argList::validOptions.insert("zHeadMin", "scalar");
|
argList::addOption("zHeadMin", "scalar");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -109,7 +109,7 @@ label activeCells = 0;
|
|||||||
// Create and set the collocated point collapse map
|
// Create and set the collocated point collapse map
|
||||||
labelList pointMap(nPoints);
|
labelList pointMap(nPoints);
|
||||||
|
|
||||||
forAll (pointMap, i)
|
forAll(pointMap, i)
|
||||||
{
|
{
|
||||||
pointMap[i] = i;
|
pointMap[i] = i;
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ for (label i=0; i<nPoints; i++)
|
|||||||
|
|
||||||
edgeList edges = cellShapes[activeCells].edges();
|
edgeList edges = cellShapes[activeCells].edges();
|
||||||
|
|
||||||
forAll (edges, ei)
|
forAll(edges, ei)
|
||||||
{
|
{
|
||||||
if (edges[ei].mag(points) < SMALL)
|
if (edges[ei].mag(points) < SMALL)
|
||||||
{
|
{
|
||||||
@ -167,11 +167,11 @@ cellZoning.setSize(activeCells);
|
|||||||
|
|
||||||
// Map collocated points to refer to the same point and collapse cell shape
|
// Map collocated points to refer to the same point and collapse cell shape
|
||||||
// to the corresponding hex-degenerate.
|
// to the corresponding hex-degenerate.
|
||||||
forAll (cellShapes, celli)
|
forAll(cellShapes, celli)
|
||||||
{
|
{
|
||||||
cellShape& cs = cellShapes[celli];
|
cellShape& cs = cellShapes[celli];
|
||||||
|
|
||||||
forAll (cs, i)
|
forAll(cs, i)
|
||||||
{
|
{
|
||||||
cs[i] = pointMap[cs[i]];
|
cs[i] = pointMap[cs[i]];
|
||||||
}
|
}
|
||||||
@ -336,7 +336,7 @@ if
|
|||||||
{
|
{
|
||||||
const face& pf = iter();
|
const face& pf = iter();
|
||||||
|
|
||||||
forAll (pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
minz = min(minz, points[pf[pfi]].z());
|
minz = min(minz, points[pf[pfi]].z());
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ if
|
|||||||
const face& pf = iter();
|
const face& pf = iter();
|
||||||
|
|
||||||
scalar minfz = GREAT;
|
scalar minfz = GREAT;
|
||||||
forAll (pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
minfz = min(minfz, points[pf[pfi]].z());
|
minfz = min(minfz, points[pf[pfi]].z());
|
||||||
}
|
}
|
||||||
@ -390,7 +390,7 @@ if
|
|||||||
const face& pf = iter();
|
const face& pf = iter();
|
||||||
|
|
||||||
scalar minfz = GREAT;
|
scalar minfz = GREAT;
|
||||||
forAll (pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
minfz = min(minfz, points[pf[pfi]].z());
|
minfz = min(minfz, points[pf[pfi]].z());
|
||||||
}
|
}
|
||||||
@ -417,7 +417,7 @@ if
|
|||||||
label nPatches = 0;
|
label nPatches = 0;
|
||||||
for (int bci=0; bci<nBCs; bci++)
|
for (int bci=0; bci<nBCs; bci++)
|
||||||
{
|
{
|
||||||
forAll (pFaces[bci], rgi)
|
forAll(pFaces[bci], rgi)
|
||||||
{
|
{
|
||||||
if (pFaces[bci][rgi].size())
|
if (pFaces[bci][rgi].size())
|
||||||
{
|
{
|
||||||
@ -485,7 +485,7 @@ label nAddedPatches = 0;
|
|||||||
|
|
||||||
for (int bci=0; bci<nBCs; bci++)
|
for (int bci=0; bci<nBCs; bci++)
|
||||||
{
|
{
|
||||||
forAll (pFaces[bci], rgi)
|
forAll(pFaces[bci], rgi)
|
||||||
{
|
{
|
||||||
if (pFaces[bci][rgi].size())
|
if (pFaces[bci][rgi].size())
|
||||||
{
|
{
|
||||||
@ -510,9 +510,9 @@ for (int bci=0; bci<nBCs; bci++)
|
|||||||
labelList pointLabels(nPoints, -1);
|
labelList pointLabels(nPoints, -1);
|
||||||
|
|
||||||
// Scan cells for used points
|
// Scan cells for used points
|
||||||
forAll (cellShapes, celli)
|
forAll(cellShapes, celli)
|
||||||
{
|
{
|
||||||
forAll (cellShapes[celli], i)
|
forAll(cellShapes[celli], i)
|
||||||
{
|
{
|
||||||
pointLabels[cellShapes[celli][i]] = 1;
|
pointLabels[cellShapes[celli][i]] = 1;
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ forAll (cellShapes, celli)
|
|||||||
|
|
||||||
// Create addressing for used points and pack points array
|
// Create addressing for used points and pack points array
|
||||||
label newPointi = 0;
|
label newPointi = 0;
|
||||||
forAll (pointLabels, pointi)
|
forAll(pointLabels, pointi)
|
||||||
{
|
{
|
||||||
if (pointLabels[pointi] != -1)
|
if (pointLabels[pointi] != -1)
|
||||||
{
|
{
|
||||||
@ -531,24 +531,24 @@ forAll (pointLabels, pointi)
|
|||||||
points.setSize(newPointi);
|
points.setSize(newPointi);
|
||||||
|
|
||||||
// Reset cell point labels
|
// Reset cell point labels
|
||||||
forAll (cellShapes, celli)
|
forAll(cellShapes, celli)
|
||||||
{
|
{
|
||||||
cellShape& cs = cellShapes[celli];
|
cellShape& cs = cellShapes[celli];
|
||||||
|
|
||||||
forAll (cs, i)
|
forAll(cs, i)
|
||||||
{
|
{
|
||||||
cs[i] = pointLabels[cs[i]];
|
cs[i] = pointLabels[cs[i]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset boundary-face point labels
|
// Reset boundary-face point labels
|
||||||
forAll (boundary, patchi)
|
forAll(boundary, patchi)
|
||||||
{
|
{
|
||||||
forAll (boundary[patchi], facei)
|
forAll(boundary[patchi], facei)
|
||||||
{
|
{
|
||||||
face& f = boundary[patchi][facei];
|
face& f = boundary[patchi][facei];
|
||||||
|
|
||||||
forAll (f, i)
|
forAll(f, i)
|
||||||
{
|
{
|
||||||
f[i] = pointLabels[f[i]];
|
f[i] = pointLabels[f[i]];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append(".msh file");
|
argList::validArgs.append(".msh file");
|
||||||
argList::validOptions.insert("hex", "");
|
argList::addBoolOption("hex");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -471,7 +471,7 @@ faceList hexBlock::patchFaces(const label direc, const labelList& range) const
|
|||||||
else if (blockHandedness_ == left)
|
else if (blockHandedness_ == left)
|
||||||
{
|
{
|
||||||
// turn all faces inside out
|
// turn all faces inside out
|
||||||
forAll (result, faceI)
|
forAll(result, faceI)
|
||||||
{
|
{
|
||||||
result[faceI] = result[faceI].reverseFace();
|
result[faceI] = result[faceI].reverseFace();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,10 +58,10 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("PLOT3D geom file");
|
argList::validArgs.append("PLOT3D geom file");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
argList::validOptions.insert("noBlank", "");
|
argList::addBoolOption("noBlank");
|
||||||
argList::validOptions.insert("singleBlock", "");
|
argList::addBoolOption("singleBlock");
|
||||||
argList::validOptions.insert("2D", "thickness");
|
argList::addOption("2D", "thickness");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
label nx, ny, nz;
|
label nx, ny, nz;
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
if (twoDThickness > 0)
|
if (twoDThickness > 0)
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
label sumPoints(0);
|
label sumPoints(0);
|
||||||
label nMeshCells(0);
|
label nMeshCells(0);
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
Info<< "block " << blockI << ":" << nl;
|
Info<< "block " << blockI << ":" << nl;
|
||||||
blocks[blockI].readPoints(readBlank, twoDThickness, plot3dFile);
|
blocks[blockI].readPoints(readBlank, twoDThickness, plot3dFile);
|
||||||
@ -144,11 +144,11 @@ int main(int argc, char *argv[])
|
|||||||
pointField points(sumPoints);
|
pointField points(sumPoints);
|
||||||
labelList blockOffsets(blocks.size());
|
labelList blockOffsets(blocks.size());
|
||||||
sumPoints = 0;
|
sumPoints = 0;
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
const pointField& blockPoints = blocks[blockI].points();
|
const pointField& blockPoints = blocks[blockI].points();
|
||||||
blockOffsets[blockI] = sumPoints;
|
blockOffsets[blockI] = sumPoints;
|
||||||
forAll (blockPoints, i)
|
forAll(blockPoints, i)
|
||||||
{
|
{
|
||||||
points[sumPoints++] = blockPoints[i];
|
points[sumPoints++] = blockPoints[i];
|
||||||
}
|
}
|
||||||
@ -186,15 +186,15 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nCreatedCells = 0;
|
label nCreatedCells = 0;
|
||||||
|
|
||||||
forAll (blocks, blockI)
|
forAll(blocks, blockI)
|
||||||
{
|
{
|
||||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||||
|
|
||||||
forAll (curBlockCells, blockCellI)
|
forAll(curBlockCells, blockCellI)
|
||||||
{
|
{
|
||||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||||
|
|
||||||
forAll (cellPoints, pointI)
|
forAll(cellPoints, pointI)
|
||||||
{
|
{
|
||||||
cellPoints[pointI] =
|
cellPoints[pointI] =
|
||||||
oldToNew
|
oldToNew
|
||||||
|
|||||||
@ -357,10 +357,10 @@ int main(int argc, char *argv[])
|
|||||||
timeSelector::addOptions(true, false);
|
timeSelector::addOptions(true, false);
|
||||||
|
|
||||||
argList::validArgs.append("feature angle[0-180]");
|
argList::validArgs.append("feature angle[0-180]");
|
||||||
argList::validOptions.insert("splitAllFaces", "");
|
argList::addBoolOption("splitAllFaces");
|
||||||
argList::validOptions.insert("concaveMultiCells", "");
|
argList::addBoolOption("concaveMultiCells");
|
||||||
argList::validOptions.insert("doNotPreserveFaceZones", "");
|
argList::addBoolOption("doNotPreserveFaceZones");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -74,7 +74,7 @@ void sammMesh::calcPointCells() const
|
|||||||
{
|
{
|
||||||
const faceList& faces = cellFaces_[cellI];
|
const faceList& faces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
// For each vertex
|
// For each vertex
|
||||||
const labelList& labels = faces[i];
|
const labelList& labels = faces[i];
|
||||||
|
|||||||
@ -45,11 +45,11 @@ bool sammMesh::sammEqualFace
|
|||||||
// considered equal if three of the vertices are the same.
|
// considered equal if three of the vertices are the same.
|
||||||
label nEqual = 0;
|
label nEqual = 0;
|
||||||
|
|
||||||
forAll (cellFace, cellFaceLabelI)
|
forAll(cellFace, cellFaceLabelI)
|
||||||
{
|
{
|
||||||
const label curCellFaceLabel = cellFace[cellFaceLabelI];
|
const label curCellFaceLabel = cellFace[cellFaceLabelI];
|
||||||
|
|
||||||
forAll (boundaryFace, bouFaceLabelI)
|
forAll(boundaryFace, bouFaceLabelI)
|
||||||
{
|
{
|
||||||
if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
|
if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,13 +42,13 @@ void sammMesh::createPolyBoundary()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll (boundary_, patchI)
|
forAll(boundary_, patchI)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchI];
|
||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
||||||
|
|
||||||
forAll (curShapePatch, faceI)
|
forAll(curShapePatch, faceI)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ List<polyPatch* > sammMesh::polyBoundaryPatches(const polyMesh& pMesh)
|
|||||||
{
|
{
|
||||||
List<polyPatch* > p(boundary_.size());
|
List<polyPatch* > p(boundary_.size());
|
||||||
|
|
||||||
forAll (boundary_, patchI)
|
forAll(boundary_, patchI)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchI];
|
||||||
|
|
||||||
|
|||||||
@ -41,13 +41,13 @@ void sammMesh::createPolyCells()
|
|||||||
|
|
||||||
label maxFaces = 0;
|
label maxFaces = 0;
|
||||||
|
|
||||||
forAll (cellPolys_, cellI)
|
forAll(cellPolys_, cellI)
|
||||||
{
|
{
|
||||||
cell& curCell = cellPolys_[cellI];
|
cell& curCell = cellPolys_[cellI];
|
||||||
|
|
||||||
curCell.setSize(cellFaces_[cellI].size());
|
curCell.setSize(cellFaces_[cellI].size());
|
||||||
|
|
||||||
forAll (curCell, fI)
|
forAll(curCell, fI)
|
||||||
{
|
{
|
||||||
curCell[fI] = -1;
|
curCell[fI] = -1;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ void sammMesh::createPolyCells()
|
|||||||
label nextNei = -1;
|
label nextNei = -1;
|
||||||
label minNei = cellPolys_.size();
|
label minNei = cellPolys_.size();
|
||||||
|
|
||||||
forAll (neiCells, ncI)
|
forAll(neiCells, ncI)
|
||||||
{
|
{
|
||||||
if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
|
if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,12 +22,9 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
#include "error.H"
|
||||||
|
|
||||||
#include "sammMesh.H"
|
#include "sammMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -35,7 +35,7 @@ void sammMesh::fixCollapsedEdges()
|
|||||||
{
|
{
|
||||||
cellFaces_.setSize(cellShapes_.size());
|
cellFaces_.setSize(cellShapes_.size());
|
||||||
|
|
||||||
forAll (cellShapes_, cellI)
|
forAll(cellShapes_, cellI)
|
||||||
{
|
{
|
||||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
||||||
}
|
}
|
||||||
@ -43,23 +43,23 @@ void sammMesh::fixCollapsedEdges()
|
|||||||
// go through the faces and find if there exist faces with duplicate
|
// go through the faces and find if there exist faces with duplicate
|
||||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
face& vertexLabels = curFaces[faceI];
|
face& vertexLabels = curFaces[faceI];
|
||||||
|
|
||||||
bool duplicatesFound = false;
|
bool duplicatesFound = false;
|
||||||
|
|
||||||
forAll (vertexLabels, vI)
|
forAll(vertexLabels, vI)
|
||||||
{
|
{
|
||||||
label curLabel = vertexLabels[vI];
|
label curLabel = vertexLabels[vI];
|
||||||
|
|
||||||
label nFound = 0;
|
label nFound = 0;
|
||||||
|
|
||||||
forAll (vertexLabels, searchI)
|
forAll(vertexLabels, searchI)
|
||||||
{
|
{
|
||||||
if (vertexLabels[searchI] == curLabel)
|
if (vertexLabels[searchI] == curLabel)
|
||||||
{
|
{
|
||||||
@ -91,7 +91,7 @@ void sammMesh::fixCollapsedEdges()
|
|||||||
|
|
||||||
label nNewVertices = 0;
|
label nNewVertices = 0;
|
||||||
|
|
||||||
forAll (vertexLabels, vI)
|
forAll(vertexLabels, vI)
|
||||||
{
|
{
|
||||||
// In order for a face to be a valid entity, duplicate
|
// In order for a face to be a valid entity, duplicate
|
||||||
// vertices can only be consecutive (othervise, the
|
// vertices can only be consecutive (othervise, the
|
||||||
|
|||||||
@ -33,18 +33,18 @@ Description
|
|||||||
|
|
||||||
void sammMesh::purgeCellShapes()
|
void sammMesh::purgeCellShapes()
|
||||||
{
|
{
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
// Get model faces
|
// Get model faces
|
||||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
faceList shapeFaces = cellShapes_[cellI].faces();
|
||||||
|
|
||||||
forAll (shapeFaces, faceI)
|
forAll(shapeFaces, faceI)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll (curFaces, i)
|
forAll(curFaces, i)
|
||||||
{
|
{
|
||||||
if (shapeFaces[faceI] == curFaces[i])
|
if (shapeFaces[faceI] == curFaces[i])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -163,7 +163,7 @@ void sammMesh::addSAMMcell
|
|||||||
// make a list of labels
|
// make a list of labels
|
||||||
labelList sammCellLabels(curModel.nPoints(), -1);
|
labelList sammCellLabels(curModel.nPoints(), -1);
|
||||||
|
|
||||||
forAll (sammCellLabels, labelI)
|
forAll(sammCellLabels, labelI)
|
||||||
{
|
{
|
||||||
sammCellLabels[labelI] = globalLabels[addressing[labelI]];
|
sammCellLabels[labelI] = globalLabels[addressing[labelI]];
|
||||||
}
|
}
|
||||||
@ -221,7 +221,7 @@ void sammMesh::readCells()
|
|||||||
starCellLabelLookup_.setSize(maxLabel+1);
|
starCellLabelLookup_.setSize(maxLabel+1);
|
||||||
|
|
||||||
// reset point labels to invalid value
|
// reset point labels to invalid value
|
||||||
forAll (starCellLabelLookup_, i)
|
forAll(starCellLabelLookup_, i)
|
||||||
{
|
{
|
||||||
starCellLabelLookup_[i] = -1;
|
starCellLabelLookup_[i] = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -128,13 +128,13 @@ void sammMesh::readCouples()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Once all couples are read, remove zero size faces from all cells
|
// Once all couples are read, remove zero size faces from all cells
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
label zeroSizeFound = 0;
|
label zeroSizeFound = 0;
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
if (curFaces[faceI].empty())
|
if (curFaces[faceI].empty())
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@ void sammMesh::readCouples()
|
|||||||
|
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
|
|
||||||
forAll (oldFaces, faceI)
|
forAll(oldFaces, faceI)
|
||||||
{
|
{
|
||||||
if (oldFaces[faceI].size())
|
if (oldFaces[faceI].size())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -116,11 +116,11 @@ void sammMesh::createPolyMeshData()
|
|||||||
label nProblemCells = 0;
|
label nProblemCells = 0;
|
||||||
|
|
||||||
// check that there is no zeros in the cellPolys_
|
// check that there is no zeros in the cellPolys_
|
||||||
forAll (cellPolys_, cellI)
|
forAll(cellPolys_, cellI)
|
||||||
{
|
{
|
||||||
const labelList& curFaceLabels = cellPolys_[cellI];
|
const labelList& curFaceLabels = cellPolys_[cellI];
|
||||||
|
|
||||||
forAll (curFaceLabels, faceI)
|
forAll(curFaceLabels, faceI)
|
||||||
{
|
{
|
||||||
if (curFaceLabels[faceI] == -1)
|
if (curFaceLabels[faceI] == -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("SAMM mesh file prefix");
|
argList::validArgs.append("SAMM mesh file prefix");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -50,8 +50,7 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar scaleFactor = 1.0;
|
scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
|
||||||
args.optionReadIfPresent("scale", scaleFactor);
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
|
|||||||
@ -62,28 +62,35 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("pro-STAR prefix");
|
argList::validArgs.append("pro-STAR prefix");
|
||||||
argList::validOptions.insert("ascii", "");
|
argList::addBoolOption
|
||||||
argList::validOptions.insert("scale", "scale");
|
(
|
||||||
argList::validOptions.insert("solids", "");
|
"ascii",
|
||||||
|
"write in ASCII instead of binary format"
|
||||||
|
);
|
||||||
|
argList::addOption
|
||||||
|
(
|
||||||
|
"scale",
|
||||||
|
"scale",
|
||||||
|
"geometry scaling factor - default is 0.001 ([mm] to [m])"
|
||||||
|
);
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"solids",
|
||||||
|
"retain solid cells and treat them like fluid cells"
|
||||||
|
);
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
Time runTime(args.rootPath(), args.caseName());
|
Time runTime(args.rootPath(), args.caseName());
|
||||||
const stringList& params = args.additionalArgs();
|
const stringList& params = args.additionalArgs();
|
||||||
|
|
||||||
// default rescale from [mm] to [m]
|
// default rescale from [mm] to [m]
|
||||||
scalar scaleFactor = 0.001;
|
scalar scaleFactor = args.optionLookupOrDefault("scale", 0.001);
|
||||||
if (args.optionReadIfPresent("scale", scaleFactor))
|
if (scaleFactor <= 0)
|
||||||
{
|
{
|
||||||
if (scaleFactor <= 0)
|
scaleFactor = 1;
|
||||||
{
|
|
||||||
scaleFactor = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.optionFound("solids"))
|
meshReaders::STARCD::keepSolids = args.optionFound("solids");
|
||||||
{
|
|
||||||
meshReaders::STARCD::keepSolids = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// default to binary output, unless otherwise specified
|
// default to binary output, unless otherwise specified
|
||||||
IOstream::streamFormat format = IOstream::BINARY;
|
IOstream::streamFormat format = IOstream::BINARY;
|
||||||
|
|||||||
@ -74,7 +74,7 @@ void starMesh::calcPointCells() const
|
|||||||
{
|
{
|
||||||
const faceList& faces = cellFaces_[cellI];
|
const faceList& faces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (faces, i)
|
forAll(faces, i)
|
||||||
{
|
{
|
||||||
// For each vertex
|
// For each vertex
|
||||||
const labelList& labels = faces[i];
|
const labelList& labels = faces[i];
|
||||||
|
|||||||
@ -47,11 +47,11 @@ bool starMesh::starEqualFace
|
|||||||
|
|
||||||
label nEqual = 0;
|
label nEqual = 0;
|
||||||
|
|
||||||
forAll (cellFace, cellFaceLabelI)
|
forAll(cellFace, cellFaceLabelI)
|
||||||
{
|
{
|
||||||
const label curCellFaceLabel = cellFace[cellFaceLabelI];
|
const label curCellFaceLabel = cellFace[cellFaceLabelI];
|
||||||
|
|
||||||
forAll (boundaryFace, bouFaceLabelI)
|
forAll(boundaryFace, bouFaceLabelI)
|
||||||
{
|
{
|
||||||
if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
|
if (boundaryFace[bouFaceLabelI] == curCellFaceLabel)
|
||||||
{
|
{
|
||||||
@ -70,13 +70,13 @@ bool starMesh::starEqualFace
|
|||||||
// Boundary face is happy if all of its vertices are recognised
|
// Boundary face is happy if all of its vertices are recognised
|
||||||
bool boundaryFaceHappy = true;
|
bool boundaryFaceHappy = true;
|
||||||
|
|
||||||
forAll (boundaryFace, bouFaceLabelI)
|
forAll(boundaryFace, bouFaceLabelI)
|
||||||
{
|
{
|
||||||
const label curBouFaceLabel = boundaryFace[bouFaceLabelI];
|
const label curBouFaceLabel = boundaryFace[bouFaceLabelI];
|
||||||
|
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll (cellFace, cellFaceLabelI)
|
forAll(cellFace, cellFaceLabelI)
|
||||||
{
|
{
|
||||||
if (curBouFaceLabel == cellFace[cellFaceLabelI])
|
if (curBouFaceLabel == cellFace[cellFaceLabelI])
|
||||||
{
|
{
|
||||||
@ -155,7 +155,7 @@ void starMesh::markBoundaryFaces()
|
|||||||
<< " Face : " << endl << curFace << endl
|
<< " Face : " << endl << curFace << endl
|
||||||
<< "PROSTAR Command: vset,news,vlis";
|
<< "PROSTAR Command: vset,news,vlis";
|
||||||
|
|
||||||
forAll (curFace, spI)
|
forAll(curFace, spI)
|
||||||
{
|
{
|
||||||
if (curFace[spI] > -1 && curFace[spI] < starPointID_.size())
|
if (curFace[spI] > -1 && curFace[spI] < starPointID_.size())
|
||||||
{
|
{
|
||||||
@ -185,7 +185,7 @@ void starMesh::collectBoundaryFaces()
|
|||||||
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
|
||||||
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
|
||||||
|
|
||||||
forAll (curBoundaryCellIDs, faceI)
|
forAll(curBoundaryCellIDs, faceI)
|
||||||
{
|
{
|
||||||
patchFaces[faceI] =
|
patchFaces[faceI] =
|
||||||
cellFaces_[curBoundaryCellIDs[faceI]]
|
cellFaces_[curBoundaryCellIDs[faceI]]
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void starMesh::createCoupleMatches()
|
|||||||
|
|
||||||
const label infoJump = max(1000, couples_.size()/20);
|
const label infoJump = max(1000, couples_.size()/20);
|
||||||
|
|
||||||
forAll (couples_, coupleI)
|
forAll(couples_, coupleI)
|
||||||
{
|
{
|
||||||
if (coupleI % infoJump == 0)
|
if (coupleI % infoJump == 0)
|
||||||
{
|
{
|
||||||
@ -168,7 +168,7 @@ void starMesh::createCoupleMatches()
|
|||||||
|
|
||||||
// Loop through all edges of the master face. For every edge,
|
// Loop through all edges of the master face. For every edge,
|
||||||
// intersect it with all edges of the cutting face.
|
// intersect it with all edges of the cutting face.
|
||||||
forAll (masterEdges, masterEdgeI)
|
forAll(masterEdges, masterEdgeI)
|
||||||
{
|
{
|
||||||
const edge& curMasterEdge = masterEdges[masterEdgeI];
|
const edge& curMasterEdge = masterEdges[masterEdgeI];
|
||||||
|
|
||||||
@ -186,7 +186,7 @@ void starMesh::createCoupleMatches()
|
|||||||
// go through all slave edges and try to get an intersection.
|
// go through all slave edges and try to get an intersection.
|
||||||
// The point is created along the original master edge rather
|
// The point is created along the original master edge rather
|
||||||
// than its corrected direction.
|
// than its corrected direction.
|
||||||
forAll (slaveEdges, slaveEdgeI)
|
forAll(slaveEdges, slaveEdgeI)
|
||||||
{
|
{
|
||||||
const edge& curSlaveEdge = slaveEdges[slaveEdgeI];
|
const edge& curSlaveEdge = slaveEdges[slaveEdgeI];
|
||||||
|
|
||||||
@ -464,7 +464,7 @@ void starMesh::createCoupleMatches()
|
|||||||
|
|
||||||
# ifdef DEBUG_COUPLE_INTERSECTION
|
# ifdef DEBUG_COUPLE_INTERSECTION
|
||||||
Info<< "additional slave edge points: " << endl;
|
Info<< "additional slave edge points: " << endl;
|
||||||
forAll (slaveEdgePoints, edgeI)
|
forAll(slaveEdgePoints, edgeI)
|
||||||
{
|
{
|
||||||
Info<< "edge: " << edgeI << ": " << slaveEdgePoints[edgeI]
|
Info<< "edge: " << edgeI << ": " << slaveEdgePoints[edgeI]
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -498,7 +498,7 @@ void starMesh::createCoupleMatches()
|
|||||||
// count the number of additional points for face
|
// count the number of additional points for face
|
||||||
label nAdditionalMasterPoints = 0;
|
label nAdditionalMasterPoints = 0;
|
||||||
|
|
||||||
forAll (masterEdgePoints, edgeI)
|
forAll(masterEdgePoints, edgeI)
|
||||||
{
|
{
|
||||||
nAdditionalMasterPoints += masterEdgePoints[edgeI].size();
|
nAdditionalMasterPoints += masterEdgePoints[edgeI].size();
|
||||||
}
|
}
|
||||||
@ -516,7 +516,7 @@ void starMesh::createCoupleMatches()
|
|||||||
<< endl;
|
<< endl;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
forAll (masterEdges, masterEdgeI)
|
forAll(masterEdges, masterEdgeI)
|
||||||
{
|
{
|
||||||
// Insert the starting point of the edge
|
// Insert the starting point of the edge
|
||||||
tmpMasterFace[nTmpMasterLabels] =
|
tmpMasterFace[nTmpMasterLabels] =
|
||||||
@ -637,7 +637,7 @@ void starMesh::createCoupleMatches()
|
|||||||
scalar masterTol =
|
scalar masterTol =
|
||||||
cpMergePointTol_*boundBox(tmpMasterFace.points(points_)).mag();
|
cpMergePointTol_*boundBox(tmpMasterFace.points(points_)).mag();
|
||||||
|
|
||||||
forAll (mstEdgesToCollapse, edgeI)
|
forAll(mstEdgesToCollapse, edgeI)
|
||||||
{
|
{
|
||||||
# ifdef DEBUG_FACE_ORDERING
|
# ifdef DEBUG_FACE_ORDERING
|
||||||
Info<< "edgeI: " << edgeI << " curEdge: "
|
Info<< "edgeI: " << edgeI << " curEdge: "
|
||||||
@ -693,7 +693,7 @@ void starMesh::createCoupleMatches()
|
|||||||
// count the number of additional points for face
|
// count the number of additional points for face
|
||||||
label nAdditionalSlavePoints = 0;
|
label nAdditionalSlavePoints = 0;
|
||||||
|
|
||||||
forAll (slaveEdgePoints, edgeI)
|
forAll(slaveEdgePoints, edgeI)
|
||||||
{
|
{
|
||||||
nAdditionalSlavePoints += slaveEdgePoints[edgeI].size();
|
nAdditionalSlavePoints += slaveEdgePoints[edgeI].size();
|
||||||
}
|
}
|
||||||
@ -710,7 +710,7 @@ void starMesh::createCoupleMatches()
|
|||||||
<< "nAdditionalSlavePoints: " << nAdditionalSlavePoints << endl;
|
<< "nAdditionalSlavePoints: " << nAdditionalSlavePoints << endl;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
forAll (slaveEdges, slaveEdgeI)
|
forAll(slaveEdges, slaveEdgeI)
|
||||||
{
|
{
|
||||||
// Insert the starting point of the edge
|
// Insert the starting point of the edge
|
||||||
tmpSlaveFace[nTmpSlaveLabels] =
|
tmpSlaveFace[nTmpSlaveLabels] =
|
||||||
@ -894,7 +894,7 @@ void starMesh::createCoupleMatches()
|
|||||||
|
|
||||||
vector masterProjDir = -newMasterFace.normal(points_);
|
vector masterProjDir = -newMasterFace.normal(points_);
|
||||||
|
|
||||||
forAll (newSlaveEdges, edgeI)
|
forAll(newSlaveEdges, edgeI)
|
||||||
{
|
{
|
||||||
// Take the slave edge points and project into the master.
|
// Take the slave edge points and project into the master.
|
||||||
// In order to create a good intersection, move the
|
// In order to create a good intersection, move the
|
||||||
@ -937,7 +937,7 @@ void starMesh::createCoupleMatches()
|
|||||||
{
|
{
|
||||||
vector slaveProjDir = -newSlaveFace.normal(points_);
|
vector slaveProjDir = -newSlaveFace.normal(points_);
|
||||||
|
|
||||||
forAll (newMasterEdges, edgeI)
|
forAll(newMasterEdges, edgeI)
|
||||||
{
|
{
|
||||||
// Take the edge master points and project into the slave.
|
// Take the edge master points and project into the slave.
|
||||||
// In order to create a good intersection, move the
|
// In order to create a good intersection, move the
|
||||||
@ -1053,7 +1053,7 @@ void starMesh::createCoupleMatches()
|
|||||||
SLList<edge> edgesToConsider;
|
SLList<edge> edgesToConsider;
|
||||||
|
|
||||||
// collect master edges
|
// collect master edges
|
||||||
forAll (newMasterEdges, edgeI)
|
forAll(newMasterEdges, edgeI)
|
||||||
{
|
{
|
||||||
const edge& cme = newMasterEdges[edgeI];
|
const edge& cme = newMasterEdges[edgeI];
|
||||||
|
|
||||||
@ -1072,7 +1072,7 @@ void starMesh::createCoupleMatches()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// collect slave edges
|
// collect slave edges
|
||||||
forAll (newSlaveEdges, edgeI)
|
forAll(newSlaveEdges, edgeI)
|
||||||
{
|
{
|
||||||
const edge& cse = newSlaveEdges[edgeI];
|
const edge& cse = newSlaveEdges[edgeI];
|
||||||
|
|
||||||
@ -1260,7 +1260,7 @@ void starMesh::createCoupleMatches()
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
// check the intersection face for duplicate points
|
// check the intersection face for duplicate points
|
||||||
forAll (intersectedFace, checkI)
|
forAll(intersectedFace, checkI)
|
||||||
{
|
{
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
@ -1312,7 +1312,7 @@ void starMesh::createCoupleMatches()
|
|||||||
// onto the master face to ensure closedness
|
// onto the master face to ensure closedness
|
||||||
vector pointProjectionNormal = -masterFace.normal(points_);
|
vector pointProjectionNormal = -masterFace.normal(points_);
|
||||||
|
|
||||||
forAll (intersectedFace, intPointI)
|
forAll(intersectedFace, intPointI)
|
||||||
{
|
{
|
||||||
# ifdef DEBUG_COUPLE_PROJECTION
|
# ifdef DEBUG_COUPLE_PROJECTION
|
||||||
Info<< "Proj: old point: "
|
Info<< "Proj: old point: "
|
||||||
@ -1424,7 +1424,7 @@ void starMesh::createCoupleMatches()
|
|||||||
// Loop through all cells and reset faces for removal to zero size
|
// Loop through all cells and reset faces for removal to zero size
|
||||||
const labelList crfToc = cellRemovedFaces.toc();
|
const labelList crfToc = cellRemovedFaces.toc();
|
||||||
|
|
||||||
forAll (crfToc, cellI)
|
forAll(crfToc, cellI)
|
||||||
{
|
{
|
||||||
const label curCell = crfToc[cellI];
|
const label curCell = crfToc[cellI];
|
||||||
|
|
||||||
@ -1451,7 +1451,7 @@ void starMesh::createCoupleMatches()
|
|||||||
const labelList cafToc = cellAddedFaces.toc();
|
const labelList cafToc = cellAddedFaces.toc();
|
||||||
|
|
||||||
// Insert the new faces into the list
|
// Insert the new faces into the list
|
||||||
forAll (cafToc, cellI)
|
forAll(cafToc, cellI)
|
||||||
{
|
{
|
||||||
const label curCell = cafToc[cellI];
|
const label curCell = cafToc[cellI];
|
||||||
|
|
||||||
@ -1465,7 +1465,7 @@ void starMesh::createCoupleMatches()
|
|||||||
label nNewFaces = 0;
|
label nNewFaces = 0;
|
||||||
|
|
||||||
// copy original faces that have not been removed
|
// copy original faces that have not been removed
|
||||||
forAll (oldFaces, faceI)
|
forAll(oldFaces, faceI)
|
||||||
{
|
{
|
||||||
if (oldFaces[faceI].size())
|
if (oldFaces[faceI].size())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -42,13 +42,13 @@ void starMesh::createPolyBoundary()
|
|||||||
|
|
||||||
const labelListList& PointCells = pointCells();
|
const labelListList& PointCells = pointCells();
|
||||||
|
|
||||||
forAll (boundary_, patchI)
|
forAll(boundary_, patchI)
|
||||||
{
|
{
|
||||||
const faceList& curShapePatch = boundary_[patchI];
|
const faceList& curShapePatch = boundary_[patchI];
|
||||||
|
|
||||||
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
|
||||||
|
|
||||||
forAll (curShapePatch, faceI)
|
forAll(curShapePatch, faceI)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ void starMesh::createPolyBoundary()
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
Info<< "PROSTAR Command: vset,news,vlis";
|
Info<< "PROSTAR Command: vset,news,vlis";
|
||||||
forAll (curCellFaces[cellFaceI], spI)
|
forAll(curCellFaces[cellFaceI], spI)
|
||||||
{
|
{
|
||||||
// check if the point is given by STAR
|
// check if the point is given by STAR
|
||||||
// or created locally
|
// or created locally
|
||||||
@ -136,7 +136,7 @@ void starMesh::createPolyBoundary()
|
|||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
Info<< "PROSTAR Command: vset,news,vlis";
|
Info<< "PROSTAR Command: vset,news,vlis";
|
||||||
forAll (curCellFaces[cellFaceI], spI)
|
forAll(curCellFaces[cellFaceI], spI)
|
||||||
{
|
{
|
||||||
// check if the point is given by STAR
|
// check if the point is given by STAR
|
||||||
// or created locally
|
// or created locally
|
||||||
@ -181,11 +181,11 @@ void starMesh::createPolyBoundary()
|
|||||||
// check all cellPolys_ to see if there are any missing faces
|
// check all cellPolys_ to see if there are any missing faces
|
||||||
label nMissingFaceFound = 0;
|
label nMissingFaceFound = 0;
|
||||||
|
|
||||||
forAll (cellPolys_, cellI)
|
forAll(cellPolys_, cellI)
|
||||||
{
|
{
|
||||||
const labelList& curFaces = cellPolys_[cellI];
|
const labelList& curFaces = cellPolys_[cellI];
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
if (curFaces[faceI] < 0)
|
if (curFaces[faceI] < 0)
|
||||||
{
|
{
|
||||||
@ -200,7 +200,7 @@ void starMesh::createPolyBoundary()
|
|||||||
nMissingFaceFound++;
|
nMissingFaceFound++;
|
||||||
|
|
||||||
Info<< "PROSTAR Command: vset,news,vlis";
|
Info<< "PROSTAR Command: vset,news,vlis";
|
||||||
forAll (missingFace, spI)
|
forAll(missingFace, spI)
|
||||||
{
|
{
|
||||||
// check if the point is given by STAR or created locally
|
// check if the point is given by STAR or created locally
|
||||||
if
|
if
|
||||||
@ -233,11 +233,11 @@ void starMesh::createPolyBoundary()
|
|||||||
// (faces addressed once or more than twice)
|
// (faces addressed once or more than twice)
|
||||||
labelList markupFaces(meshFaces_.size(), 0);
|
labelList markupFaces(meshFaces_.size(), 0);
|
||||||
|
|
||||||
forAll (cellPolys_, cellI)
|
forAll(cellPolys_, cellI)
|
||||||
{
|
{
|
||||||
const labelList& curFaces = cellPolys_[cellI];
|
const labelList& curFaces = cellPolys_[cellI];
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
markupFaces[curFaces[faceI]]++;
|
markupFaces[curFaces[faceI]]++;
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ void starMesh::createPolyBoundary()
|
|||||||
|
|
||||||
label nProblemFacesFound = 0;
|
label nProblemFacesFound = 0;
|
||||||
|
|
||||||
forAll (markupFaces, faceI)
|
forAll(markupFaces, faceI)
|
||||||
{
|
{
|
||||||
if (markupFaces[faceI] != 2)
|
if (markupFaces[faceI] != 2)
|
||||||
{
|
{
|
||||||
@ -264,7 +264,7 @@ void starMesh::createPolyBoundary()
|
|||||||
nProblemFacesFound++;
|
nProblemFacesFound++;
|
||||||
|
|
||||||
Info<< "PROSTAR Command: vset,news,vlis";
|
Info<< "PROSTAR Command: vset,news,vlis";
|
||||||
forAll (problemFace, spI)
|
forAll(problemFace, spI)
|
||||||
{
|
{
|
||||||
// check if the point is given by STAR or created locally
|
// check if the point is given by STAR or created locally
|
||||||
if
|
if
|
||||||
@ -299,7 +299,7 @@ List<polyPatch*> starMesh::polyBoundaryPatches(const polyMesh& pMesh)
|
|||||||
{
|
{
|
||||||
List<polyPatch*> p(boundary_.size());
|
List<polyPatch*> p(boundary_.size());
|
||||||
|
|
||||||
forAll (boundary_, patchI)
|
forAll(boundary_, patchI)
|
||||||
{
|
{
|
||||||
p[patchI] = polyPatch::New
|
p[patchI] = polyPatch::New
|
||||||
(
|
(
|
||||||
|
|||||||
@ -41,13 +41,13 @@ void starMesh::createPolyCells()
|
|||||||
|
|
||||||
label maxFaces = 0;
|
label maxFaces = 0;
|
||||||
|
|
||||||
forAll (cellPolys_, cellI)
|
forAll(cellPolys_, cellI)
|
||||||
{
|
{
|
||||||
cell& curCell = cellPolys_[cellI];
|
cell& curCell = cellPolys_[cellI];
|
||||||
|
|
||||||
curCell.setSize(cellFaces_[cellI].size());
|
curCell.setSize(cellFaces_[cellI].size());
|
||||||
|
|
||||||
forAll (curCell, fI)
|
forAll(curCell, fI)
|
||||||
{
|
{
|
||||||
curCell[fI] = -1;
|
curCell[fI] = -1;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ void starMesh::createPolyCells()
|
|||||||
label nextNei = -1;
|
label nextNei = -1;
|
||||||
label minNei = cellPolys_.size();
|
label minNei = cellPolys_.size();
|
||||||
|
|
||||||
forAll (neiCells, ncI)
|
forAll(neiCells, ncI)
|
||||||
{
|
{
|
||||||
if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
|
if (neiCells[ncI] > -1 && neiCells[ncI] < minNei)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -35,7 +35,7 @@ void starMesh::fixCollapsedEdges()
|
|||||||
{
|
{
|
||||||
cellFaces_.setSize(cellShapes_.size());
|
cellFaces_.setSize(cellShapes_.size());
|
||||||
|
|
||||||
forAll (cellShapes_, cellI)
|
forAll(cellShapes_, cellI)
|
||||||
{
|
{
|
||||||
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
cellFaces_[cellI] = cellShapes_[cellI].faces();
|
||||||
}
|
}
|
||||||
@ -43,23 +43,23 @@ void starMesh::fixCollapsedEdges()
|
|||||||
// go through the faces and find if there exist faces with duplicate
|
// go through the faces and find if there exist faces with duplicate
|
||||||
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
// vertices. If so, purge the duplicates and mark the mesh as a polyMesh
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
faceList& curFaces = cellFaces_[cellI];
|
faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
face& vertexLabels = curFaces[faceI];
|
face& vertexLabels = curFaces[faceI];
|
||||||
|
|
||||||
bool duplicatesFound = false;
|
bool duplicatesFound = false;
|
||||||
|
|
||||||
forAll (vertexLabels, vI)
|
forAll(vertexLabels, vI)
|
||||||
{
|
{
|
||||||
label curLabel = vertexLabels[vI];
|
label curLabel = vertexLabels[vI];
|
||||||
|
|
||||||
label nFound = 0;
|
label nFound = 0;
|
||||||
|
|
||||||
forAll (vertexLabels, searchI)
|
forAll(vertexLabels, searchI)
|
||||||
{
|
{
|
||||||
if (vertexLabels[searchI] == curLabel)
|
if (vertexLabels[searchI] == curLabel)
|
||||||
{
|
{
|
||||||
@ -90,7 +90,7 @@ void starMesh::fixCollapsedEdges()
|
|||||||
face newFace(vertexLabels.size());
|
face newFace(vertexLabels.size());
|
||||||
label nNewVertices = 0;
|
label nNewVertices = 0;
|
||||||
|
|
||||||
forAll (vertexLabels, vI)
|
forAll(vertexLabels, vI)
|
||||||
{
|
{
|
||||||
// In order for a face to be a valid entity, duplicate
|
// In order for a face to be a valid entity, duplicate
|
||||||
// vertices can only be consecutive (othervise, the
|
// vertices can only be consecutive (othervise, the
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
label nMergeSets = 0;
|
label nMergeSets = 0;
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
@ -74,13 +74,13 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
scalar pointMergeTol = GREAT;
|
scalar pointMergeTol = GREAT;
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
nPointsInCell += curFaces[faceI].size();
|
nPointsInCell += curFaces[faceI].size();
|
||||||
|
|
||||||
edgeList curEdges = curFaces[faceI].edges();
|
edgeList curEdges = curFaces[faceI].edges();
|
||||||
|
|
||||||
forAll (curEdges, edgeI)
|
forAll(curEdges, edgeI)
|
||||||
{
|
{
|
||||||
scalar length = curEdges[edgeI].mag(points_);
|
scalar length = curEdges[edgeI].mag(points_);
|
||||||
|
|
||||||
@ -98,11 +98,11 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
labelList cellPoints(nPointsInCell);
|
labelList cellPoints(nPointsInCell);
|
||||||
label nAddedPoints = 0;
|
label nAddedPoints = 0;
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
const face& f = curFaces[faceI];
|
const face& f = curFaces[faceI];
|
||||||
|
|
||||||
forAll (f, fI)
|
forAll(f, fI)
|
||||||
{
|
{
|
||||||
cellPoints[nAddedPoints] = f[fI];
|
cellPoints[nAddedPoints] = f[fI];
|
||||||
nAddedPoints++;
|
nAddedPoints++;
|
||||||
@ -210,7 +210,7 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
<< minMerge << " and " << maxMerge << endl;
|
<< minMerge << " and " << maxMerge << endl;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
forAll (renumberPoints, elimI)
|
forAll(renumberPoints, elimI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[elimI] == maxMerge)
|
if (renumberPoints[elimI] == maxMerge)
|
||||||
{
|
{
|
||||||
@ -235,7 +235,7 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
// Insert the primary point renumbering into the list
|
// Insert the primary point renumbering into the list
|
||||||
// Take care of possibly unused points in the list
|
// Take care of possibly unused points in the list
|
||||||
forAll (renumberPoints, pointI)
|
forAll(renumberPoints, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[pointI] < 0)
|
if (renumberPoints[pointI] < 0)
|
||||||
{
|
{
|
||||||
@ -253,17 +253,17 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
// renumbering of all faces. This will only be used to see which
|
// renumbering of all faces. This will only be used to see which
|
||||||
// points are still used!
|
// points are still used!
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
faceList& prelimFaces = cellFaces_[cellI];
|
faceList& prelimFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (prelimFaces, faceI)
|
forAll(prelimFaces, faceI)
|
||||||
{
|
{
|
||||||
face oldFacePoints = prelimFaces[faceI];
|
face oldFacePoints = prelimFaces[faceI];
|
||||||
|
|
||||||
face& prelimFacePoints = prelimFaces[faceI];
|
face& prelimFacePoints = prelimFaces[faceI];
|
||||||
|
|
||||||
forAll (prelimFacePoints, pointI)
|
forAll(prelimFacePoints, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
||||||
{
|
{
|
||||||
@ -284,26 +284,26 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
// re-create the point list and renumber the whole lot
|
// re-create the point list and renumber the whole lot
|
||||||
renumberPoints = 0;
|
renumberPoints = 0;
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (curFaces, faceI)
|
forAll(curFaces, faceI)
|
||||||
{
|
{
|
||||||
const face& curFacePoints = curFaces[faceI];
|
const face& curFacePoints = curFaces[faceI];
|
||||||
|
|
||||||
forAll (curFacePoints, pointI)
|
forAll(curFacePoints, pointI)
|
||||||
{
|
{
|
||||||
renumberPoints[curFacePoints[pointI]]++;
|
renumberPoints[curFacePoints[pointI]]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll (cellShapes_, cellI)
|
forAll(cellShapes_, cellI)
|
||||||
{
|
{
|
||||||
const labelList& curLabels = cellShapes_[cellI];
|
const labelList& curLabels = cellShapes_[cellI];
|
||||||
|
|
||||||
forAll (curLabels, pointI)
|
forAll(curLabels, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[curLabels[pointI]] == 0)
|
if (renumberPoints[curLabels[pointI]] == 0)
|
||||||
{
|
{
|
||||||
@ -320,7 +320,7 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
label nUsedPoints = 0;
|
label nUsedPoints = 0;
|
||||||
|
|
||||||
forAll (renumberPoints, pointI)
|
forAll(renumberPoints, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[pointI] > 0)
|
if (renumberPoints[pointI] > 0)
|
||||||
{
|
{
|
||||||
@ -347,17 +347,17 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
Info<< "Renumbering all faces" << endl;
|
Info<< "Renumbering all faces" << endl;
|
||||||
|
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
faceList& newFaces = cellFaces_[cellI];
|
faceList& newFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
forAll (newFaces, faceI)
|
forAll(newFaces, faceI)
|
||||||
{
|
{
|
||||||
face oldFacePoints = newFaces[faceI];
|
face oldFacePoints = newFaces[faceI];
|
||||||
|
|
||||||
face& newFacePoints = newFaces[faceI];
|
face& newFacePoints = newFaces[faceI];
|
||||||
|
|
||||||
forAll (newFacePoints, pointI)
|
forAll(newFacePoints, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
if (renumberPoints[oldFacePoints[pointI]] < 0)
|
||||||
{
|
{
|
||||||
@ -376,13 +376,13 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
Info<< "Renumbering all cell shapes" << endl;
|
Info<< "Renumbering all cell shapes" << endl;
|
||||||
|
|
||||||
forAll (cellShapes_, cellI)
|
forAll(cellShapes_, cellI)
|
||||||
{
|
{
|
||||||
labelList oldLabels = cellShapes_[cellI];
|
labelList oldLabels = cellShapes_[cellI];
|
||||||
|
|
||||||
labelList& curLabels = cellShapes_[cellI];
|
labelList& curLabels = cellShapes_[cellI];
|
||||||
|
|
||||||
forAll (curLabels, pointI)
|
forAll(curLabels, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[curLabels[pointI]] < 0)
|
if (renumberPoints[curLabels[pointI]] < 0)
|
||||||
{
|
{
|
||||||
@ -408,7 +408,7 @@ void starMesh::mergeCoupleFacePoints()
|
|||||||
|
|
||||||
starPointID_ = -1;
|
starPointID_ = -1;
|
||||||
|
|
||||||
forAll (starPointID_, pointI)
|
forAll(starPointID_, pointI)
|
||||||
{
|
{
|
||||||
if (renumberPoints[pointI] > -1)
|
if (renumberPoints[pointI] > -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -33,18 +33,18 @@ Description
|
|||||||
|
|
||||||
void starMesh::purgeCellShapes()
|
void starMesh::purgeCellShapes()
|
||||||
{
|
{
|
||||||
forAll (cellFaces_, cellI)
|
forAll(cellFaces_, cellI)
|
||||||
{
|
{
|
||||||
const faceList& curFaces = cellFaces_[cellI];
|
const faceList& curFaces = cellFaces_[cellI];
|
||||||
|
|
||||||
// Get model faces
|
// Get model faces
|
||||||
faceList shapeFaces = cellShapes_[cellI].faces();
|
faceList shapeFaces = cellShapes_[cellI].faces();
|
||||||
|
|
||||||
forAll (shapeFaces, faceI)
|
forAll(shapeFaces, faceI)
|
||||||
{
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
|
|
||||||
forAll (curFaces, i)
|
forAll(curFaces, i)
|
||||||
{
|
{
|
||||||
if (shapeFaces[faceI] == curFaces[i])
|
if (shapeFaces[faceI] == curFaces[i])
|
||||||
{
|
{
|
||||||
|
|||||||
@ -108,7 +108,7 @@ void starMesh::addRegularCell
|
|||||||
// get reference to the addressing list
|
// get reference to the addressing list
|
||||||
const label* addressing = regularAddressingTable[regularTypeFlag];
|
const label* addressing = regularAddressingTable[regularTypeFlag];
|
||||||
|
|
||||||
forAll (regularCellLabels, labelI)
|
forAll(regularCellLabels, labelI)
|
||||||
{
|
{
|
||||||
regularCellLabels[labelI] = labels[addressing[labelI]];
|
regularCellLabels[labelI] = labels[addressing[labelI]];
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ void starMesh::addSAMMcell
|
|||||||
// get reference to the addressing list
|
// get reference to the addressing list
|
||||||
const label* addressing = sammAddressingTable[sammTypeFlag];
|
const label* addressing = sammAddressingTable[sammTypeFlag];
|
||||||
|
|
||||||
forAll (sammCellLabels, labelI)
|
forAll(sammCellLabels, labelI)
|
||||||
{
|
{
|
||||||
sammCellLabels[labelI] = labels[addressing[labelI]];
|
sammCellLabels[labelI] = labels[addressing[labelI]];
|
||||||
}
|
}
|
||||||
@ -259,7 +259,7 @@ void starMesh::readCells()
|
|||||||
starCellPermutation_.setSize(nCells);
|
starCellPermutation_.setSize(nCells);
|
||||||
|
|
||||||
// reset permutation to invalid value
|
// reset permutation to invalid value
|
||||||
forAll (starCellPermutation_, i)
|
forAll(starCellPermutation_, i)
|
||||||
{
|
{
|
||||||
starCellPermutation_[i] = -1;
|
starCellPermutation_[i] = -1;
|
||||||
}
|
}
|
||||||
@ -267,7 +267,7 @@ void starMesh::readCells()
|
|||||||
starCellLabelLookup_.setSize(maxLabel+1);
|
starCellLabelLookup_.setSize(maxLabel+1);
|
||||||
|
|
||||||
// reset point labels to invalid value
|
// reset point labels to invalid value
|
||||||
forAll (starCellLabelLookup_, i)
|
forAll(starCellLabelLookup_, i)
|
||||||
{
|
{
|
||||||
starCellLabelLookup_[i] = -1;
|
starCellLabelLookup_[i] = -1;
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ void starMesh::readCells()
|
|||||||
label addOnToCell = 0;
|
label addOnToCell = 0;
|
||||||
|
|
||||||
// reset the labels to -1. Debugging.
|
// reset the labels to -1. Debugging.
|
||||||
forAll (labels, i)
|
forAll(labels, i)
|
||||||
{
|
{
|
||||||
labels[i] = -1;
|
labels[i] = -1;
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ void starMesh::readCells()
|
|||||||
// check cell labels
|
// check cell labels
|
||||||
const labelList& curShapeLabels = cellShapes_[cellI];
|
const labelList& curShapeLabels = cellShapes_[cellI];
|
||||||
|
|
||||||
forAll (curShapeLabels, i)
|
forAll(curShapeLabels, i)
|
||||||
{
|
{
|
||||||
if (curShapeLabels[i] < 0)
|
if (curShapeLabels[i] < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,7 +41,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validArgs.append("STAR mesh file prefix");
|
argList::validArgs.append("STAR mesh file prefix");
|
||||||
argList::validOptions.insert("scale", "scale factor");
|
argList::addOption("scale", "scale factor");
|
||||||
|
|
||||||
argList args(argc, argv);
|
argList args(argc, argv);
|
||||||
|
|
||||||
@ -50,8 +50,7 @@ int main(int argc, char *argv[])
|
|||||||
FatalError.exit();
|
FatalError.exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar scaleFactor = 1.0;
|
scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0);
|
||||||
args.optionReadIfPresent("scale", scaleFactor);
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|
||||||
|
|||||||
@ -30,33 +30,34 @@ Description
|
|||||||
and run tetgen with -f option.
|
and run tetgen with -f option.
|
||||||
|
|
||||||
Sample smesh file:
|
Sample smesh file:
|
||||||
|
@verbatim
|
||||||
# cube.smesh -- A 10x10x10 cube
|
# cube.smesh -- A 10x10x10 cube
|
||||||
8 3
|
8 3
|
||||||
1 0 0 0
|
1 0 0 0
|
||||||
2 0 10 0
|
2 0 10 0
|
||||||
3 10 10 0
|
3 10 10 0
|
||||||
4 10 0 0
|
4 10 0 0
|
||||||
5 0 0 10
|
5 0 0 10
|
||||||
6 0 10 10
|
6 0 10 10
|
||||||
7 10 10 10
|
7 10 10 10
|
||||||
8 10 0 10
|
8 10 0 10
|
||||||
6 1 # 1 for boundary info present
|
6 1 # 1 for boundary info present
|
||||||
4 1 2 3 4 11 # region number 11
|
4 1 2 3 4 11 # region number 11
|
||||||
4 5 6 7 8 21 # region number 21
|
4 5 6 7 8 21 # region number 21
|
||||||
4 1 2 6 5 3
|
4 1 2 6 5 3
|
||||||
4 4 3 7 8 43
|
4 4 3 7 8 43
|
||||||
4 1 5 8 4 5
|
4 1 5 8 4 5
|
||||||
4 2 6 7 3 65
|
4 2 6 7 3 65
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
|
@endverbatim
|
||||||
|
|
||||||
NOTE:
|
Note
|
||||||
- for some reason boundary faces point inwards. I just reverse them
|
- for some reason boundary faces point inwards. I just reverse them
|
||||||
always. Might use some geometric check instead.
|
always. Might use some geometric check instead.
|
||||||
- marked faces might not actually be boundary faces of mesh.
|
- marked faces might not actually be boundary faces of mesh.
|
||||||
This is hopefully handled now by first constructing without boundaries
|
This is hopefully handled now by first constructing without boundaries
|
||||||
and then reconstructing with boundary faces.
|
and then reconstructing with boundary faces.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ label findFace(const primitiveMesh& mesh, const face& f)
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validArgs.append("file prefix");
|
argList::validArgs.append("file prefix");
|
||||||
argList::validOptions.insert("noFaceFile", "");
|
argList::addBoolOption("noFaceFile");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
|
|||||||
@ -378,13 +378,13 @@ void writePointCells
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
timeSelector::addOptions();
|
timeSelector::addOptions();
|
||||||
argList::validOptions.insert("patchFaces", "");
|
argList::addBoolOption("patchFaces");
|
||||||
argList::validOptions.insert("patchEdges", "");
|
argList::addBoolOption("patchEdges");
|
||||||
argList::validOptions.insert("cell", "cellI");
|
argList::addOption("cell", "cellI");
|
||||||
argList::validOptions.insert("face", "faceI");
|
argList::addOption("face", "faceI");
|
||||||
argList::validOptions.insert("point", "pointI");
|
argList::addOption("point", "pointI");
|
||||||
argList::validOptions.insert("cellSet", "setName");
|
argList::addOption("cellSet", "setName");
|
||||||
argList::validOptions.insert("faceSet", "setName");
|
argList::addOption("faceSet", "setName");
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|||||||
@ -72,8 +72,18 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("blockTopology", "");
|
argList::addBoolOption
|
||||||
argList::validOptions.insert("dict", "dictionary");
|
(
|
||||||
|
"blockTopology",
|
||||||
|
"write block edges and centres as .obj files"
|
||||||
|
);
|
||||||
|
argList::addOption
|
||||||
|
(
|
||||||
|
"dict",
|
||||||
|
"NAME",
|
||||||
|
"specify an alternative dictionary for the blockMesh description"
|
||||||
|
);
|
||||||
|
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
@ -83,10 +93,9 @@ int main(int argc, char *argv[])
|
|||||||
word regionName;
|
word regionName;
|
||||||
fileName polyMeshDir;
|
fileName polyMeshDir;
|
||||||
|
|
||||||
if (args.optionFound("region"))
|
if (args.optionReadIfPresent("region", regionName, polyMesh::defaultRegion))
|
||||||
{
|
{
|
||||||
// constant/<region>/polyMesh/blockMeshDict
|
// constant/<region>/polyMesh/blockMeshDict
|
||||||
regionName = args.option("region");
|
|
||||||
polyMeshDir = regionName/polyMesh::meshSubDir;
|
polyMeshDir = regionName/polyMesh::meshSubDir;
|
||||||
|
|
||||||
Info<< nl << "Generating mesh for region " << regionName << endl;
|
Info<< nl << "Generating mesh for region " << regionName << endl;
|
||||||
@ -94,7 +103,6 @@ int main(int argc, char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// constant/polyMesh/blockMeshDict
|
// constant/polyMesh/blockMeshDict
|
||||||
regionName = polyMesh::defaultRegion;
|
|
||||||
polyMeshDir = polyMesh::meshSubDir;
|
polyMeshDir = polyMesh::meshSubDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
List<faceZone*> fz(3*mergePatchPairs.size());
|
List<faceZone*> fz(3*mergePatchPairs.size());
|
||||||
List<cellZone*> cz(0);
|
List<cellZone*> cz(0);
|
||||||
|
|
||||||
forAll (mergePatchPairs, pairI)
|
forAll(mergePatchPairs, pairI)
|
||||||
{
|
{
|
||||||
const word mergeName
|
const word mergeName
|
||||||
(
|
(
|
||||||
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
labelList isf(masterPatch.size());
|
labelList isf(masterPatch.size());
|
||||||
|
|
||||||
forAll (isf, i)
|
forAll(isf, i)
|
||||||
{
|
{
|
||||||
isf[i] = masterPatch.start() + i;
|
isf[i] = masterPatch.start() + i;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
labelList osf(slavePatch.size());
|
labelList osf(slavePatch.size());
|
||||||
|
|
||||||
forAll (osf, i)
|
forAll(osf, i)
|
||||||
{
|
{
|
||||||
osf[i] = slavePatch.start() + i;
|
osf[i] = slavePatch.start() + i;
|
||||||
}
|
}
|
||||||
@ -91,7 +91,7 @@
|
|||||||
attachPolyTopoChanger polyMeshAttacher(mesh);
|
attachPolyTopoChanger polyMeshAttacher(mesh);
|
||||||
polyMeshAttacher.setSize(mergePatchPairs.size());
|
polyMeshAttacher.setSize(mergePatchPairs.size());
|
||||||
|
|
||||||
forAll (mergePatchPairs, pairI)
|
forAll(mergePatchPairs, pairI)
|
||||||
{
|
{
|
||||||
const word mergeName
|
const word mergeName
|
||||||
(
|
(
|
||||||
|
|||||||
@ -58,7 +58,7 @@ using namespace Foam;
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
argList::validArgs.append("thickness");
|
argList::validArgs.append("thickness");
|
||||||
argList::validOptions.insert("overwrite", "");
|
argList::addBoolOption("overwrite");
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
runTime.functionObjects().off();
|
runTime.functionObjects().off();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user