mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add createNamedPolyMeshes.H file
This commit is contained in:
@ -67,13 +67,10 @@ if (args.dryRun() || args.found("dry-run-write"))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Foam::Info << "Create mesh";
|
||||||
if (args.readIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Foam::Info << "Create mesh " << regionName;
|
Foam::Info << ' ' << regionName;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Foam::Info << "Create mesh";
|
|
||||||
}
|
}
|
||||||
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
||||||
|
|
||||||
|
|||||||
@ -27,13 +27,10 @@ Provided Variables
|
|||||||
Foam::word regionName(Foam::polyMesh::defaultRegion);
|
Foam::word regionName(Foam::polyMesh::defaultRegion);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Foam::Info << "Create mesh";
|
||||||
if (args.readIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Foam::Info << "Create mesh " << regionName;
|
Foam::Info << ' ' << regionName;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Foam::Info << "Create mesh";
|
|
||||||
}
|
}
|
||||||
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,13 +26,10 @@ Provided Variables
|
|||||||
Foam::word regionName(Foam::polyMesh::defaultRegion);
|
Foam::word regionName(Foam::polyMesh::defaultRegion);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Foam::Info << "Create polyMesh";
|
||||||
if (args.readIfPresent("region", regionName))
|
if (args.readIfPresent("region", regionName))
|
||||||
{
|
{
|
||||||
Foam::Info << "Create polyMesh " << regionName;
|
Foam::Info << ' ' << regionName;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Foam::Info << "Create polyMesh";
|
|
||||||
}
|
}
|
||||||
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
Foam::Info << " for time = " << runTime.timeName() << Foam::nl;
|
||||||
}
|
}
|
||||||
@ -51,4 +48,5 @@ Foam::polyMesh mesh
|
|||||||
|
|
||||||
Foam::Info << Foam::endl;
|
Foam::Info << Foam::endl;
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
68
src/OpenFOAM/include/createNamedPolyMeshes.H
Normal file
68
src/OpenFOAM/include/createNamedPolyMeshes.H
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | www.openfoam.com
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Copyright (C) 2022 OpenCFD Ltd.
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
License
|
||||||
|
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
|
||||||
|
Description
|
||||||
|
Create single or multiple polyMesh regions based on the
|
||||||
|
wordList 'regionNames'
|
||||||
|
|
||||||
|
Required Variables
|
||||||
|
- runTime [Time]
|
||||||
|
- regionNames [wordList]
|
||||||
|
|
||||||
|
Provided Variables
|
||||||
|
- meshes [PtrList<polyMesh>]
|
||||||
|
|
||||||
|
See Also
|
||||||
|
addAllRegionOptions.H
|
||||||
|
getAllRegionOptions.H
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
Foam::PtrList<Foam::polyMesh> meshes(regionNames.size());
|
||||||
|
|
||||||
|
{
|
||||||
|
forAll(regionNames, regioni)
|
||||||
|
{
|
||||||
|
const Foam::word& regionName = regionNames[regioni];
|
||||||
|
|
||||||
|
Foam::Info<< "Create polyMesh";
|
||||||
|
if
|
||||||
|
(
|
||||||
|
regionNames.size() > 1
|
||||||
|
|| regionName != Foam::polyMesh::defaultRegion
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Foam::Info<< ' ' << regionName;
|
||||||
|
}
|
||||||
|
Foam::Info<< " for time = " << runTime.timeName() << Foam::nl;
|
||||||
|
|
||||||
|
meshes.set
|
||||||
|
(
|
||||||
|
regioni,
|
||||||
|
new Foam::polyMesh
|
||||||
|
(
|
||||||
|
Foam::IOobject
|
||||||
|
(
|
||||||
|
regionName,
|
||||||
|
runTime.timeName(),
|
||||||
|
runTime,
|
||||||
|
Foam::IOobject::MUST_READ
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Foam::Info<< Foam::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user