mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into cvm
This commit is contained in:
@ -32,8 +32,8 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
export WM_PROJECT=OpenFOAM
|
export WM_PROJECT=OpenFOAM
|
||||||
#export WM_PROJECT_VERSION=dev
|
export WM_PROJECT_VERSION=1.5
|
||||||
: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
|
#: ${WM_PROJECT_VERSION:=dev}; export WM_PROJECT_VERSION
|
||||||
|
|
||||||
|
|
||||||
#!!User:
|
#!!User:
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: 1.5 |
|
||||||
| \\ / A nd | Web: http://www.openfoam.org |
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: 1.5 |
|
||||||
| \\ / A nd | Web: http://www.openfoam.org |
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|||||||
@ -32,8 +32,8 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
setenv WM_PROJECT OpenFOAM
|
setenv WM_PROJECT OpenFOAM
|
||||||
#setenv WM_PROJECT_VERSION dev
|
setenv WM_PROJECT_VERSION 1.5
|
||||||
if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
|
#if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
|
||||||
|
|
||||||
#!!User:
|
#!!User:
|
||||||
# either setenv FOAM_INST_DIR before sourcing this file or set
|
# either setenv FOAM_INST_DIR before sourcing this file or set
|
||||||
|
|||||||
@ -22,9 +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
|
|
||||||
Wrapper for stat() system call.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fileStat.H"
|
#include "fileStat.H"
|
||||||
@ -35,33 +32,15 @@ Description
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
|
|
||||||
/*
|
|
||||||
#undef major
|
|
||||||
#undef minor
|
|
||||||
#undef makedev
|
|
||||||
|
|
||||||
# define major(dev) ((int)(((dev) >> 8) & 0xff))
|
|
||||||
# define minor(dev) ((int)((dev) & 0xff))
|
|
||||||
# define makedev(major, minor) ((((unsigned int) (major)) << 8) \
|
|
||||||
| ((unsigned int) (minor)))
|
|
||||||
*/
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct null
|
Foam::fileStat::fileStat()
|
||||||
fileStat::fileStat()
|
|
||||||
:
|
:
|
||||||
isValid_(false)
|
isValid_(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from components
|
Foam::fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
|
||||||
fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
|
|
||||||
{
|
{
|
||||||
// Work on volatile
|
// Work on volatile
|
||||||
volatile bool locIsValid = false;
|
volatile bool locIsValid = false;
|
||||||
@ -85,8 +64,7 @@ fileStat::fileStat(const fileName& fName, const unsigned int maxTime)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream.
|
Foam::fileStat::fileStat(Istream& is)
|
||||||
fileStat::fileStat(Istream& is)
|
|
||||||
{
|
{
|
||||||
is >> *this;
|
is >> *this;
|
||||||
}
|
}
|
||||||
@ -94,8 +72,7 @@ fileStat::fileStat(Istream& is)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// compare two fileStates for same device
|
bool Foam::fileStat::sameDevice(const fileStat& stat2) const
|
||||||
bool fileStat::sameDevice(const fileStat& stat2) const
|
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
isValid_
|
isValid_
|
||||||
@ -105,14 +82,14 @@ bool fileStat::sameDevice(const fileStat& stat2) const
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare two fileStates for same Inode
|
|
||||||
bool fileStat::sameINode(const fileStat& stat2) const
|
bool Foam::fileStat::sameINode(const fileStat& stat2) const
|
||||||
{
|
{
|
||||||
return isValid_ && (status_.st_ino == stat2.status().st_ino);
|
return isValid_ && (status_.st_ino == stat2.status().st_ino);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compare state against inode
|
|
||||||
bool fileStat::sameINode(const label iNode) const
|
bool Foam::fileStat::sameINode(const label iNode) const
|
||||||
{
|
{
|
||||||
return isValid_ && (status_.st_ino == ino_t(iNode));
|
return isValid_ && (status_.st_ino == ino_t(iNode));
|
||||||
}
|
}
|
||||||
@ -120,8 +97,7 @@ bool fileStat::sameINode(const label iNode) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Input in list syntax
|
Foam::Istream& Foam::operator>>(Istream& is, fileStat& fStat)
|
||||||
Istream& operator>>(Istream& is, fileStat& fStat)
|
|
||||||
{
|
{
|
||||||
// Read beginning of machine info list
|
// Read beginning of machine info list
|
||||||
is.readBegin("fileStat");
|
is.readBegin("fileStat");
|
||||||
@ -172,8 +148,7 @@ Istream& operator>>(Istream& is, fileStat& fStat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Output in list syntax
|
Foam::Ostream& Foam::operator<<(Ostream& os, const fileStat& fStat)
|
||||||
Ostream& operator<<(Ostream& os, const fileStat& fStat)
|
|
||||||
{
|
{
|
||||||
// Set precision so 32bit unsigned int can be printed
|
// Set precision so 32bit unsigned int can be printed
|
||||||
// int oldPrecision = os.precision();
|
// int oldPrecision = os.precision();
|
||||||
@ -200,8 +175,4 @@ Ostream& operator<<(Ostream& os, const fileStat& fStat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,16 +28,12 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// allow undef in results
|
|
||||||
bool Foam::ensightFile::allowUndef_ = false;
|
bool Foam::ensightFile::allowUndef_ = false;
|
||||||
|
|
||||||
// value to represent undef in results
|
|
||||||
Foam::scalar Foam::ensightFile::undefValue_ = Foam::floatScalarVGREAT;
|
Foam::scalar Foam::ensightFile::undefValue_ = Foam::floatScalarVGREAT;
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from pathname
|
|
||||||
Foam::ensightFile::ensightFile
|
Foam::ensightFile::ensightFile
|
||||||
(
|
(
|
||||||
const fileName& pathname,
|
const fileName& pathname,
|
||||||
@ -55,6 +51,7 @@ Foam::ensightFile::ensightFile
|
|||||||
precision(5);
|
precision(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::ensightFile::~ensightFile()
|
Foam::ensightFile::~ensightFile()
|
||||||
@ -88,7 +85,6 @@ Foam::scalar Foam::ensightFile::undefValue(const scalar& value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// binary write
|
|
||||||
Foam::Ostream& Foam::ensightFile::write
|
Foam::Ostream& Foam::ensightFile::write
|
||||||
(
|
(
|
||||||
const char* buf,
|
const char* buf,
|
||||||
@ -100,11 +96,7 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write string as "%80s" or as binary
|
Foam::Ostream& Foam::ensightFile::write(const string& value)
|
||||||
Foam::Ostream& Foam::ensightFile::write
|
|
||||||
(
|
|
||||||
const string& value
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
char buf[80];
|
char buf[80];
|
||||||
|
|
||||||
@ -141,11 +133,7 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write integer as "%10d" or as binary
|
Foam::Ostream& Foam::ensightFile::write(const label& value)
|
||||||
Foam::Ostream& Foam::ensightFile::write
|
|
||||||
(
|
|
||||||
const label& value
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (format() == IOstream::BINARY)
|
if (format() == IOstream::BINARY)
|
||||||
{
|
{
|
||||||
@ -167,7 +155,6 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write integer with specified width or as binary
|
|
||||||
Foam::Ostream& Foam::ensightFile::write
|
Foam::Ostream& Foam::ensightFile::write
|
||||||
(
|
(
|
||||||
const label& value,
|
const label& value,
|
||||||
@ -194,11 +181,7 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write float as "%12.5e" or as binary
|
Foam::Ostream& Foam::ensightFile::write(const scalar& value)
|
||||||
Foam::Ostream& Foam::ensightFile::write
|
|
||||||
(
|
|
||||||
const scalar& value
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (format() == IOstream::BINARY)
|
if (format() == IOstream::BINARY)
|
||||||
{
|
{
|
||||||
@ -220,7 +203,6 @@ Foam::Ostream& Foam::ensightFile::write
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Add carriage return to ascii stream
|
|
||||||
void Foam::ensightFile::newline()
|
void Foam::ensightFile::newline()
|
||||||
{
|
{
|
||||||
if (format() == IOstream::ASCII)
|
if (format() == IOstream::ASCII)
|
||||||
@ -230,7 +212,6 @@ void Foam::ensightFile::newline()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write undef value
|
|
||||||
Foam::Ostream& Foam::ensightFile::writeUndef()
|
Foam::Ostream& Foam::ensightFile::writeUndef()
|
||||||
{
|
{
|
||||||
write(undefValue_);
|
write(undefValue_);
|
||||||
@ -238,11 +219,7 @@ Foam::Ostream& Foam::ensightFile::writeUndef()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write element keyword with trailing newline, optionally with undef
|
Foam::Ostream& Foam::ensightFile::writeKeyword(const string& key)
|
||||||
Foam::Ostream& Foam::ensightFile::writeKeyword
|
|
||||||
(
|
|
||||||
const string& key
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (allowUndef_)
|
if (allowUndef_)
|
||||||
{
|
{
|
||||||
@ -260,7 +237,6 @@ Foam::Ostream& Foam::ensightFile::writeKeyword
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write "C Binary" for binary files
|
|
||||||
Foam::Ostream& Foam::ensightFile::writeBinaryHeader()
|
Foam::Ostream& Foam::ensightFile::writeBinaryHeader()
|
||||||
{
|
{
|
||||||
if (format() == IOstream::BINARY)
|
if (format() == IOstream::BINARY)
|
||||||
@ -274,8 +250,6 @@ Foam::Ostream& Foam::ensightFile::writeBinaryHeader()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// '*' mask appropriate for subDir
|
|
||||||
Foam::string Foam::ensightFile::mask()
|
Foam::string Foam::ensightFile::mask()
|
||||||
{
|
{
|
||||||
char buf[16] = "********";
|
char buf[16] = "********";
|
||||||
@ -283,7 +257,6 @@ Foam::string Foam::ensightFile::mask()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// consistent zero-padded numbers for subdirectories
|
|
||||||
Foam::string Foam::ensightFile::subDir(const label n)
|
Foam::string Foam::ensightFile::subDir(const label n)
|
||||||
{
|
{
|
||||||
char buf[16];
|
char buf[16];
|
||||||
@ -293,6 +266,4 @@ Foam::string Foam::ensightFile::subDir(const label n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -30,12 +30,15 @@ Description
|
|||||||
Correctly handles binary write as well.
|
Correctly handles binary write as well.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef ensightFile_H
|
#ifndef ensightFile_H
|
||||||
#define ensightFile_H
|
#define ensightFile_H
|
||||||
|
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "IOstream.H"
|
#include "IOstream.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -47,19 +50,26 @@ class ensightFile
|
|||||||
:
|
:
|
||||||
public OFstream
|
public OFstream
|
||||||
{
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
//- allow undef in results
|
//- allow undef in results
|
||||||
static bool allowUndef_;
|
static bool allowUndef_;
|
||||||
|
|
||||||
//- value to represent undef in results
|
//- value to represent undef in results
|
||||||
static scalar undefValue_;
|
static scalar undefValue_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private member functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const ensightFile&);
|
void operator=(const ensightFile&);
|
||||||
|
|
||||||
//- Disallow default copy constructor
|
//- Disallow default copy constructor
|
||||||
ensightFile(const ensightFile&);
|
ensightFile(const ensightFile&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from pathname
|
//- Construct from pathname
|
||||||
@ -69,10 +79,13 @@ public:
|
|||||||
IOstream::streamFormat format=IOstream::BINARY
|
IOstream::streamFormat format=IOstream::BINARY
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
// Destructor
|
||||||
~ensightFile();
|
~ensightFile();
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- Return setting for whether 'undef' values are allowed in results
|
//- Return setting for whether 'undef' values are allowed in results
|
||||||
static bool allowUndef();
|
static bool allowUndef();
|
||||||
|
|
||||||
@ -82,7 +95,9 @@ public:
|
|||||||
//- consistent zero-padded numbers for subdirectories
|
//- consistent zero-padded numbers for subdirectories
|
||||||
static string subDir(const label);
|
static string subDir(const label);
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
static bool allowUndef(bool);
|
static bool allowUndef(bool);
|
||||||
|
|
||||||
//- Assign the value to represent undef in the results
|
//- Assign the value to represent undef in the results
|
||||||
@ -90,6 +105,7 @@ public:
|
|||||||
// NB: do not use values larger than floatScalarVGREAT
|
// NB: do not use values larger than floatScalarVGREAT
|
||||||
static scalar undefValue(const scalar&);
|
static scalar undefValue(const scalar&);
|
||||||
|
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
|
|
||||||
//- binary write
|
//- binary write
|
||||||
@ -125,6 +141,8 @@ public:
|
|||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,8 +28,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// Construct from pathname
|
|
||||||
Foam::ensightGeoFile::ensightGeoFile
|
Foam::ensightGeoFile::ensightGeoFile
|
||||||
(
|
(
|
||||||
const fileName& pathname,
|
const fileName& pathname,
|
||||||
@ -53,11 +51,7 @@ Foam::ensightGeoFile::~ensightGeoFile()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// write keyword with trailing newline
|
Foam::Ostream& Foam::ensightGeoFile::writeKeyword(const string& key)
|
||||||
Foam::Ostream& Foam::ensightGeoFile::writeKeyword
|
|
||||||
(
|
|
||||||
const string& key
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
write(key);
|
write(key);
|
||||||
newline();
|
newline();
|
||||||
@ -65,6 +59,5 @@ Foam::Ostream& Foam::ensightGeoFile::writeKeyword
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,28 +29,36 @@ Description
|
|||||||
Specialized Ensight output with extra geometry file header
|
Specialized Ensight output with extra geometry file header
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef ensightGeoFile_H
|
#ifndef ensightGeoFile_H
|
||||||
#define ensightGeoFile_H
|
#define ensightGeoFile_H
|
||||||
|
|
||||||
#include "ensightFile.H"
|
#include "ensightFile.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class ensightGeoFile Declaration
|
Class ensightGeoFile Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
class ensightGeoFile
|
class ensightGeoFile
|
||||||
:
|
:
|
||||||
public ensightFile
|
public ensightFile
|
||||||
{
|
{
|
||||||
|
// Private member functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const ensightGeoFile&);
|
void operator=(const ensightGeoFile&);
|
||||||
|
|
||||||
//- Disallow default copy constructor
|
//- Disallow default copy constructor
|
||||||
ensightGeoFile(const ensightGeoFile&);
|
ensightGeoFile(const ensightGeoFile&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from pathname
|
//- Construct from pathname
|
||||||
@ -60,21 +68,23 @@ public:
|
|||||||
IOstream::streamFormat format=IOstream::BINARY
|
IOstream::streamFormat format=IOstream::BINARY
|
||||||
);
|
);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
//- Destructor
|
||||||
~ensightGeoFile();
|
~ensightGeoFile();
|
||||||
|
|
||||||
|
|
||||||
// Output
|
// Output
|
||||||
|
|
||||||
//- write keyword with trailing newline
|
//- write keyword with trailing newline
|
||||||
virtual Ostream& writeKeyword(const string& key);
|
virtual Ostream& writeKeyword(const string& key);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -41,11 +41,7 @@ Foam::List<Foam::word> Foam::ensightPart::elemTypes_(0);
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
//- check for fully defined fields
|
bool Foam::ensightPart::isFieldDefined(const List<scalar>& field) const
|
||||||
bool Foam::ensightPart::isFieldDefined
|
|
||||||
(
|
|
||||||
const List<scalar>& field
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
forAll(elemLists_, elemI)
|
forAll(elemLists_, elemI)
|
||||||
{
|
{
|
||||||
@ -67,7 +63,6 @@ bool Foam::ensightPart::isFieldDefined
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Null constructor
|
|
||||||
Foam::ensightPart::ensightPart
|
Foam::ensightPart::ensightPart
|
||||||
()
|
()
|
||||||
:
|
:
|
||||||
@ -82,7 +77,6 @@ Foam::ensightPart::ensightPart
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct empty part with number and description
|
|
||||||
Foam::ensightPart::ensightPart
|
Foam::ensightPart::ensightPart
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -100,7 +94,6 @@ Foam::ensightPart::ensightPart
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct empty part with number and description
|
|
||||||
Foam::ensightPart::ensightPart
|
Foam::ensightPart::ensightPart
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -119,11 +112,7 @@ Foam::ensightPart::ensightPart
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy
|
Foam::ensightPart::ensightPart(const ensightPart& part)
|
||||||
Foam::ensightPart::ensightPart
|
|
||||||
(
|
|
||||||
const ensightPart& part
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
number_(part.number_),
|
number_(part.number_),
|
||||||
name_(part.name_),
|
name_(part.name_),
|
||||||
@ -138,7 +127,6 @@ Foam::ensightPart::ensightPart
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// runtime selection
|
|
||||||
Foam::autoPtr<Foam::ensightPart> Foam::ensightPart::New(Istream& is)
|
Foam::autoPtr<Foam::ensightPart> Foam::ensightPart::New(Istream& is)
|
||||||
{
|
{
|
||||||
word partType(is);
|
word partType(is);
|
||||||
@ -161,6 +149,7 @@ Foam::autoPtr<Foam::ensightPart> Foam::ensightPart::New(Istream& is)
|
|||||||
return autoPtr<ensightPart>(cstrIter()(is));
|
return autoPtr<ensightPart>(cstrIter()(is));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::ensightPart::~ensightPart()
|
Foam::ensightPart::~ensightPart()
|
||||||
@ -169,7 +158,6 @@ Foam::ensightPart::~ensightPart()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// reconstruct from Istream
|
|
||||||
void Foam::ensightPart::reconstruct(Istream& is)
|
void Foam::ensightPart::reconstruct(Istream& is)
|
||||||
{
|
{
|
||||||
dictionary dict(is);
|
dictionary dict(is);
|
||||||
@ -198,7 +186,6 @@ void Foam::ensightPart::reconstruct(Istream& is)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// renumber elements
|
|
||||||
void Foam::ensightPart::renumber(labelList const& origId)
|
void Foam::ensightPart::renumber(labelList const& origId)
|
||||||
{
|
{
|
||||||
// transform to global values first
|
// transform to global values first
|
||||||
@ -226,6 +213,4 @@ void Foam::ensightPart::renumber(labelList const& origId)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -63,9 +63,9 @@ class ensightPart
|
|||||||
// Static data members
|
// Static data members
|
||||||
static List<word> elemTypes_;
|
static List<word> elemTypes_;
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- part number
|
//- part number
|
||||||
@ -92,6 +92,7 @@ protected:
|
|||||||
//- mesh reference used
|
//- mesh reference used
|
||||||
const polyMesh* meshPtr_;
|
const polyMesh* meshPtr_;
|
||||||
|
|
||||||
|
|
||||||
// Protected Classes
|
// Protected Classes
|
||||||
|
|
||||||
//- track the points used by the part and map global to local indices
|
//- track the points used by the part and map global to local indices
|
||||||
@ -155,12 +156,12 @@ protected:
|
|||||||
) const
|
) const
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
TypeName("ensightPart");
|
TypeName("ensightPart");
|
||||||
|
|
||||||
// Public data
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -206,10 +207,10 @@ public:
|
|||||||
static autoPtr<ensightPart> New(Istream& is);
|
static autoPtr<ensightPart> New(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
|
||||||
virtual ~ensightPart();
|
virtual ~ensightPart();
|
||||||
|
|
||||||
|
|
||||||
// Static members
|
// Static members
|
||||||
|
|
||||||
virtual List<word> const& elementTypes() const
|
virtual List<word> const& elementTypes() const
|
||||||
@ -217,6 +218,7 @@ public:
|
|||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Access
|
// Access
|
||||||
|
|
||||||
//- number of elements in this part
|
//- number of elements in this part
|
||||||
@ -272,6 +274,7 @@ public:
|
|||||||
return offset_;
|
return offset_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- renumber elements
|
//- renumber elements
|
||||||
@ -332,7 +335,6 @@ public:
|
|||||||
ensightGeoFile&,
|
ensightGeoFile&,
|
||||||
const ensightPart&
|
const ensightPart&
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,6 @@ namespace Foam
|
|||||||
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
|
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// names for addressable ensight element types
|
|
||||||
Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
|
Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
|
||||||
(
|
(
|
||||||
IStringStream
|
IStringStream
|
||||||
@ -52,11 +51,7 @@ Foam::List<Foam::word> Foam::ensightPartCells::elemTypes_
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// classify the cell types, track the points used
|
void Foam::ensightPartCells::classify(const labelList& idList)
|
||||||
void Foam::ensightPartCells::classify
|
|
||||||
(
|
|
||||||
const labelList& idList
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// References to cell shape models
|
// References to cell shape models
|
||||||
const cellModel& tet = *(cellModeller::lookup("tet"));
|
const cellModel& tet = *(cellModeller::lookup("tet"));
|
||||||
@ -229,7 +224,6 @@ void Foam::ensightPartCells::classify
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct empty part with number and description
|
|
||||||
Foam::ensightPartCells::ensightPartCells
|
Foam::ensightPartCells::ensightPartCells
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -240,7 +234,6 @@ Foam::ensightPartCells::ensightPartCells
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from polyMesh without zones
|
|
||||||
Foam::ensightPartCells::ensightPartCells
|
Foam::ensightPartCells::ensightPartCells
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -253,7 +246,6 @@ Foam::ensightPartCells::ensightPartCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from polyMesh and list of (non-zoned) cells
|
|
||||||
Foam::ensightPartCells::ensightPartCells
|
Foam::ensightPartCells::ensightPartCells
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -267,7 +259,6 @@ Foam::ensightPartCells::ensightPartCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from polyMesh and cellZone
|
|
||||||
Foam::ensightPartCells::ensightPartCells
|
Foam::ensightPartCells::ensightPartCells
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -281,21 +272,13 @@ Foam::ensightPartCells::ensightPartCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct as copy
|
Foam::ensightPartCells::ensightPartCells(const ensightPartCells& part)
|
||||||
Foam::ensightPartCells::ensightPartCells
|
|
||||||
(
|
|
||||||
const ensightPartCells& part
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
ensightPart(part)
|
ensightPart(part)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
Foam::ensightPartCells::ensightPartCells(Istream& is)
|
||||||
Foam::ensightPartCells::ensightPartCells
|
|
||||||
(
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
ensightPart()
|
ensightPart()
|
||||||
{
|
{
|
||||||
@ -305,15 +288,12 @@ Foam::ensightPartCells::ensightPartCells
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
Foam::ensightPartCells::~ensightPartCells()
|
Foam::ensightPartCells::~ensightPartCells()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// track the points used
|
|
||||||
Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
|
Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
|
||||||
{
|
{
|
||||||
const polyMesh& mesh = *meshPtr_;
|
const polyMesh& mesh = *meshPtr_;
|
||||||
@ -362,7 +342,6 @@ Foam::ensightPart::localPoints Foam::ensightPartCells::calcLocalPoints() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write cell connectivities
|
|
||||||
void Foam::ensightPartCells::writeConnectivity
|
void Foam::ensightPartCells::writeConnectivity
|
||||||
(
|
(
|
||||||
ensightGeoFile& os,
|
ensightGeoFile& os,
|
||||||
@ -449,6 +428,4 @@ void Foam::ensightPartCells::writeConnectivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -52,8 +52,6 @@ class ensightPartCells
|
|||||||
:
|
:
|
||||||
public ensightPart
|
public ensightPart
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
@ -77,6 +75,7 @@ class ensightPartCells
|
|||||||
const labelList& pointMap
|
const labelList& pointMap
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- addressable Ensight element types
|
//- addressable Ensight element types
|
||||||
@ -135,8 +134,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
|
||||||
virtual ~ensightPartCells();
|
virtual ~ensightPartCells();
|
||||||
|
|
||||||
|
|
||||||
@ -147,7 +145,6 @@ public:
|
|||||||
{
|
{
|
||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,13 +31,14 @@ License
|
|||||||
#include "dictionary.H"
|
#include "dictionary.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineTypeNameAndDebug(ensightPartFaces, 0);
|
defineTypeNameAndDebug(ensightPartFaces, 0);
|
||||||
addToRunTimeSelectionTable(ensightPart, ensightPartFaces, istream);
|
addToRunTimeSelectionTable(ensightPart, ensightPartFaces, istream);
|
||||||
}
|
}
|
||||||
|
|
||||||
// names for addressable ensight element types
|
|
||||||
Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
|
Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
|
||||||
(
|
(
|
||||||
IStringStream
|
IStringStream
|
||||||
@ -46,9 +47,9 @@ Foam::List<Foam::word> Foam::ensightPartFaces::elemTypes_
|
|||||||
)()
|
)()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct empty part with number and description
|
|
||||||
Foam::ensightPartFaces::ensightPartFaces
|
Foam::ensightPartFaces::ensightPartFaces
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -61,7 +62,6 @@ Foam::ensightPartFaces::ensightPartFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from polyMesh and polyPatch
|
|
||||||
Foam::ensightPartFaces::ensightPartFaces
|
Foam::ensightPartFaces::ensightPartFaces
|
||||||
(
|
(
|
||||||
label partNumber,
|
label partNumber,
|
||||||
@ -137,22 +137,13 @@ Foam::ensightPartFaces::ensightPartFaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::ensightPartFaces::ensightPartFaces(const ensightPartFaces &part)
|
||||||
// Construct as copy
|
|
||||||
Foam::ensightPartFaces::ensightPartFaces
|
|
||||||
(
|
|
||||||
const ensightPartFaces &part
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
ensightPart(part)
|
ensightPart(part)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
Foam::ensightPartFaces::ensightPartFaces(Istream& is)
|
||||||
Foam::ensightPartFaces::ensightPartFaces
|
|
||||||
(
|
|
||||||
Istream& is
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
ensightPart()
|
ensightPart()
|
||||||
{
|
{
|
||||||
@ -160,6 +151,7 @@ Foam::ensightPartFaces::ensightPartFaces
|
|||||||
reconstruct(is);
|
reconstruct(is);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::ensightPartFaces::~ensightPartFaces()
|
Foam::ensightPartFaces::~ensightPartFaces()
|
||||||
@ -168,7 +160,6 @@ Foam::ensightPartFaces::~ensightPartFaces()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// track the points used
|
|
||||||
Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
|
Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
|
||||||
{
|
{
|
||||||
const polyMesh& mesh = *meshPtr_;
|
const polyMesh& mesh = *meshPtr_;
|
||||||
@ -212,7 +203,6 @@ Foam::ensightPart::localPoints Foam::ensightPartFaces::calcLocalPoints() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write face connectivities
|
|
||||||
void Foam::ensightPartFaces::writeConnectivity
|
void Foam::ensightPartFaces::writeConnectivity
|
||||||
(
|
(
|
||||||
ensightGeoFile& os,
|
ensightGeoFile& os,
|
||||||
@ -258,6 +248,4 @@ void Foam::ensightPartFaces::writeConnectivity
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -51,8 +51,6 @@ class ensightPartFaces
|
|||||||
:
|
:
|
||||||
public ensightPart
|
public ensightPart
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
@ -70,6 +68,7 @@ class ensightPartFaces
|
|||||||
const labelList& pointMap
|
const labelList& pointMap
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//- addressable ensight element types
|
//- addressable ensight element types
|
||||||
@ -115,8 +114,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
|
|
||||||
virtual ~ensightPartFaces();
|
virtual ~ensightPartFaces();
|
||||||
|
|
||||||
|
|
||||||
@ -127,7 +125,6 @@ public:
|
|||||||
{
|
{
|
||||||
return elemTypes_;
|
return elemTypes_;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,6 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// write generalized field components
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::ensightPart::writeField
|
void Foam::ensightPart::writeField
|
||||||
(
|
(
|
||||||
@ -66,6 +65,4 @@ void Foam::ensightPart::writeField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -33,7 +33,6 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// write the part header
|
|
||||||
void Foam::ensightPart::writeHeader
|
void Foam::ensightPart::writeHeader
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -54,7 +53,6 @@ void Foam::ensightPart::writeHeader
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write scalar field for idList
|
|
||||||
void Foam::ensightPart::writeFieldList
|
void Foam::ensightPart::writeFieldList
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -80,12 +78,7 @@ void Foam::ensightPart::writeFieldList
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::ensightPart::writeSummary(Ostream& os) const
|
||||||
// write summary information about the object
|
|
||||||
bool Foam::ensightPart::writeSummary
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
os << indent << type() << nl
|
os << indent << type() << nl
|
||||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
@ -102,11 +95,7 @@ bool Foam::ensightPart::writeSummary
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write reconstruction information for the object
|
bool Foam::ensightPart::writeData(Ostream& os) const
|
||||||
bool Foam::ensightPart::writeData
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
os << indent << type() << nl
|
os << indent << type() << nl
|
||||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||||
@ -130,12 +119,7 @@ bool Foam::ensightPart::writeData
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::ensightPart::writeGeometry(ensightGeoFile& os) const
|
||||||
// write geometry by components
|
|
||||||
void Foam::ensightPart::writeGeometry
|
|
||||||
(
|
|
||||||
ensightGeoFile& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
if (size() && meshPtr_)
|
if (size() && meshPtr_)
|
||||||
{
|
{
|
||||||
@ -182,7 +166,6 @@ void Foam::ensightPart::writeGeometry
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write scalar field
|
|
||||||
void Foam::ensightPart::writeScalarField
|
void Foam::ensightPart::writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -207,7 +190,6 @@ void Foam::ensightPart::writeScalarField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write vector field components
|
|
||||||
void Foam::ensightPart::writeVectorField
|
void Foam::ensightPart::writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -259,6 +241,5 @@ Foam::ensightGeoFile& Foam::operator<<
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -28,11 +28,7 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from polyMesh
|
Foam::ensightParts::ensightParts(const polyMesh& pMesh)
|
||||||
Foam::ensightParts::ensightParts
|
|
||||||
(
|
|
||||||
const polyMesh& pMesh
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
partsList_()
|
partsList_()
|
||||||
{
|
{
|
||||||
@ -40,11 +36,7 @@ Foam::ensightParts::ensightParts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from IOobject
|
Foam::ensightParts::ensightParts(const IOobject& ioObj)
|
||||||
Foam::ensightParts::ensightParts
|
|
||||||
(
|
|
||||||
const IOobject& ioObj
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
partsList_()
|
partsList_()
|
||||||
{
|
{
|
||||||
@ -61,12 +53,7 @@ Foam::ensightParts::~ensightParts()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
void Foam::ensightParts::recalculate(const polyMesh& pMesh)
|
||||||
// clear old information and construct anew from polyMesh
|
|
||||||
void Foam::ensightParts::recalculate
|
|
||||||
(
|
|
||||||
const polyMesh& pMesh
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
partsList_.clear();
|
partsList_.clear();
|
||||||
|
|
||||||
@ -197,7 +184,6 @@ void Foam::ensightParts::recalculate
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// renumber elements
|
|
||||||
void Foam::ensightParts::renumber
|
void Foam::ensightParts::renumber
|
||||||
(
|
(
|
||||||
const labelList& origCellId,
|
const labelList& origCellId,
|
||||||
@ -218,11 +204,7 @@ void Foam::ensightParts::renumber
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write the geometry
|
void Foam::ensightParts::writeGeometry( ensightGeoFile& os) const
|
||||||
void Foam::ensightParts::writeGeometry
|
|
||||||
(
|
|
||||||
ensightGeoFile& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
// with some feedback
|
// with some feedback
|
||||||
Info<< "write geometry part:" << nl << flush;
|
Info<< "write geometry part:" << nl << flush;
|
||||||
@ -235,11 +217,7 @@ void Foam::ensightParts::writeGeometry
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write summary information about the objects
|
bool Foam::ensightParts::writeSummary(Ostream& os) const
|
||||||
bool Foam::ensightParts::writeSummary
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
forAll(partsList_, partI)
|
forAll(partsList_, partI)
|
||||||
{
|
{
|
||||||
@ -250,10 +228,7 @@ bool Foam::ensightParts::writeSummary
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::ensightParts::writeData
|
void Foam::ensightParts::writeData(Ostream& os) const
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
// Write size of list
|
// Write size of list
|
||||||
os << nl << partsList_.size();
|
os << nl << partsList_.size();
|
||||||
@ -275,7 +250,6 @@ void Foam::ensightParts::writeData
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write scalar field
|
|
||||||
void Foam::ensightParts::writeScalarField
|
void Foam::ensightParts::writeScalarField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -298,7 +272,6 @@ void Foam::ensightParts::writeScalarField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write vector field components
|
|
||||||
void Foam::ensightParts::writeVectorField
|
void Foam::ensightParts::writeVectorField
|
||||||
(
|
(
|
||||||
ensightFile& os,
|
ensightFile& os,
|
||||||
@ -322,8 +295,6 @@ void Foam::ensightParts::writeVectorField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -337,6 +308,5 @@ Foam::ensightGeoFile& Foam::operator<<
|
|||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -66,6 +66,7 @@ class ensightParts
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const ensightParts&);
|
void operator=(const ensightParts&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
@ -76,10 +77,13 @@ public:
|
|||||||
//- Construct from IOobject
|
//- Construct from IOobject
|
||||||
ensightParts(const IOobject&);
|
ensightParts(const IOobject&);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
~ensightParts();
|
~ensightParts();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
//- clear old information and construct anew from polyMesh
|
//- clear old information and construct anew from polyMesh
|
||||||
void recalculate(const polyMesh&);
|
void recalculate(const polyMesh&);
|
||||||
|
|
||||||
@ -132,6 +136,7 @@ public:
|
|||||||
const GeometricField<Type, fvPatchField, volMesh>&
|
const GeometricField<Type, fvPatchField, volMesh>&
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// Friend Operators
|
// Friend Operators
|
||||||
|
|
||||||
friend ensightGeoFile& operator<<
|
friend ensightGeoFile& operator<<
|
||||||
@ -139,7 +144,6 @@ public:
|
|||||||
ensightGeoFile&,
|
ensightGeoFile&,
|
||||||
const ensightParts&
|
const ensightParts&
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -26,11 +26,11 @@ Description
|
|||||||
Template to write generalized field components
|
Template to write generalized field components
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "ensightParts.H"
|
#include "ensightParts.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// write generalized field components
|
|
||||||
template <class Type>
|
template <class Type>
|
||||||
void Foam::ensightParts::writeField
|
void Foam::ensightParts::writeField
|
||||||
(
|
(
|
||||||
@ -72,6 +72,5 @@ void Foam::ensightParts::writeField
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -177,7 +177,5 @@ const Foam::labelListList& Foam::meshReader::pointCells() const
|
|||||||
return *pointCellsPtr_;
|
return *pointCellsPtr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -42,7 +42,6 @@ Description
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// add in boundary face
|
|
||||||
void Foam::meshReader::addPolyBoundaryFace
|
void Foam::meshReader::addPolyBoundaryFace
|
||||||
(
|
(
|
||||||
const label cellId,
|
const label cellId,
|
||||||
@ -86,7 +85,6 @@ void Foam::meshReader::addPolyBoundaryFace
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// add in boundary face
|
|
||||||
void Foam::meshReader::addPolyBoundaryFace
|
void Foam::meshReader::addPolyBoundaryFace
|
||||||
(
|
(
|
||||||
const cellFaceIdentifier& identifier,
|
const cellFaceIdentifier& identifier,
|
||||||
@ -96,6 +94,7 @@ void Foam::meshReader::addPolyBoundaryFace
|
|||||||
addPolyBoundaryFace(identifier.cell, identifier.face, nCreatedFaces);
|
addPolyBoundaryFace(identifier.cell, identifier.face, nCreatedFaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::meshReader::createPolyBoundary()
|
void Foam::meshReader::createPolyBoundary()
|
||||||
@ -370,6 +369,7 @@ void Foam::meshReader::createPolyBoundary()
|
|||||||
<< "Number of interfaces: " << nInterfaces << endl;
|
<< "Number of interfaces: " << nInterfaces << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::List<Foam::polyPatch*>
|
Foam::List<Foam::polyPatch*>
|
||||||
@ -445,6 +445,5 @@ Foam::meshReader::polyBoundaryPatches(const polyMesh& mesh)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -31,6 +31,7 @@ Description
|
|||||||
- standard connectivity checks
|
- standard connectivity checks
|
||||||
|
|
||||||
- added baffle support
|
- added baffle support
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "meshReader.H"
|
#include "meshReader.H"
|
||||||
@ -325,6 +326,5 @@ void Foam::meshReader::createPolyCells()
|
|||||||
// added in createPolyBoundary()
|
// added in createPolyBoundary()
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -34,7 +34,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Pointers to cell shape models
|
|
||||||
const Foam::cellModel* Foam::meshReader::unknownModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshReader::unknownModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
@ -65,27 +64,17 @@ lookup
|
|||||||
"hex"
|
"hex"
|
||||||
);
|
);
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// attach cellZones based on the cellTable Id
|
void Foam::meshReader::addCellZones(polyMesh& mesh) const
|
||||||
// - any other values can be extracted later from the cellTable dictionary
|
|
||||||
void Foam::meshReader::addCellZones
|
|
||||||
(
|
|
||||||
polyMesh& mesh
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
cellTable_.addCellZones(mesh, cellTableId_);
|
cellTable_.addCellZones(mesh, cellTableId_);
|
||||||
warnDuplicates("cellZones", mesh.cellZones().names());
|
warnDuplicates("cellZones", mesh.cellZones().names());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// attach faceZones based on the monitoring boundary conditions
|
void Foam::meshReader::addFaceZones(polyMesh& mesh) const
|
||||||
void Foam::meshReader::addFaceZones
|
|
||||||
(
|
|
||||||
polyMesh& mesh
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
label nZone = monitoringSets_.size();
|
label nZone = monitoringSets_.size();
|
||||||
mesh.faceZones().setSize(nZone);
|
mesh.faceZones().setSize(nZone);
|
||||||
@ -128,7 +117,6 @@ void Foam::meshReader::addFaceZones
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// create and access the polyMesh
|
|
||||||
Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
|
Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
|
||||||
(
|
(
|
||||||
const objectRegistry& registry
|
const objectRegistry& registry
|
||||||
@ -172,7 +160,6 @@ Foam::autoPtr<Foam::polyMesh> Foam::meshReader::mesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- write the polyMesh
|
|
||||||
void Foam::meshReader::writeMesh
|
void Foam::meshReader::writeMesh
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
@ -199,7 +186,6 @@ void Foam::meshReader::writeMesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Clear extra storage before creation of the mesh to reduce the memory usage
|
|
||||||
void Foam::meshReader::clearExtraStorage()
|
void Foam::meshReader::clearExtraStorage()
|
||||||
{
|
{
|
||||||
cellFaces_.clear();
|
cellFaces_.clear();
|
||||||
@ -241,6 +227,7 @@ Foam::meshReader::meshReader
|
|||||||
cellTable_()
|
cellTable_()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::meshReader::~meshReader()
|
Foam::meshReader::~meshReader()
|
||||||
@ -248,7 +235,5 @@ Foam::meshReader::~meshReader()
|
|||||||
deleteDemandDrivenData(pointCellsPtr_);
|
deleteDemandDrivenData(pointCellsPtr_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -51,6 +51,7 @@ SourceFiles
|
|||||||
createPolyCells.C
|
createPolyCells.C
|
||||||
meshReader.C
|
meshReader.C
|
||||||
meshReaderAux.C
|
meshReaderAux.C
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef meshReader_H
|
#ifndef meshReader_H
|
||||||
@ -74,37 +75,46 @@ namespace Foam
|
|||||||
class meshReader
|
class meshReader
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
//- identify cell faces in terms of cell Id and face Id
|
|
||||||
|
//- Identify cell faces in terms of cell Id and face Id
|
||||||
class cellFaceIdentifier
|
class cellFaceIdentifier
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//- cell Id
|
// Public data
|
||||||
|
|
||||||
|
//- Cell Id
|
||||||
label cell;
|
label cell;
|
||||||
|
|
||||||
//- face Id
|
//- Face Id
|
||||||
label face;
|
label face;
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
//- Construct null
|
//- Construct null
|
||||||
cellFaceIdentifier() : cell(-1), face(-1) {}
|
cellFaceIdentifier() : cell(-1), face(-1) {}
|
||||||
|
|
||||||
//- Construct from cell/face components
|
//- Construct from cell/face components
|
||||||
cellFaceIdentifier(label c, label f) : cell(c), face(f) {}
|
cellFaceIdentifier(label c, label f) : cell(c), face(f) {}
|
||||||
|
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
|
|
||||||
//- used if cell or face are non-negative
|
//- Used if cell or face are non-negative
|
||||||
bool used() const
|
bool used() const
|
||||||
{
|
{
|
||||||
return (cell >= 0 && face >= 0);
|
return (cell >= 0 && face >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//- unsed if cell or face are negative
|
//- Unused if cell or face are negative
|
||||||
bool unused() const
|
bool unused() const
|
||||||
{
|
{
|
||||||
return (cell < 0 || face < 0);
|
return (cell < 0 || face < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
bool operator!=(const cellFaceIdentifier& cf) const
|
bool operator!=(const cellFaceIdentifier& cf) const
|
||||||
{
|
{
|
||||||
return (cell != cf.cell || face != cf.face);
|
return (cell != cf.cell || face != cf.face);
|
||||||
@ -116,13 +126,19 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
friend Ostream& operator<<(Ostream& os, const cellFaceIdentifier& cf)
|
|
||||||
|
friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const cellFaceIdentifier& cf
|
||||||
|
)
|
||||||
{
|
{
|
||||||
os << "(" << cf.cell << "/" << cf.face << ")";
|
os << "(" << cf.cell << "/" << cf.face << ")";
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -154,6 +170,7 @@ private:
|
|||||||
//- Face sets for monitoring
|
//- Face sets for monitoring
|
||||||
HashTable<List<label>, word, string::hash> monitoringSets_;
|
HashTable<List<label>, word, string::hash> monitoringSets_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
@ -170,7 +187,7 @@ private:
|
|||||||
//- Make polyhedral cells and global faces if the mesh is polyhedral
|
//- Make polyhedral cells and global faces if the mesh is polyhedral
|
||||||
void createPolyCells();
|
void createPolyCells();
|
||||||
|
|
||||||
//- add in boundary face
|
//- Add in boundary face
|
||||||
void addPolyBoundaryFace
|
void addPolyBoundaryFace
|
||||||
(
|
(
|
||||||
const label cellId,
|
const label cellId,
|
||||||
@ -178,17 +195,17 @@ private:
|
|||||||
const label nCreatedFaces
|
const label nCreatedFaces
|
||||||
);
|
);
|
||||||
|
|
||||||
//- add in boundary face
|
//- Add in boundary face
|
||||||
void addPolyBoundaryFace
|
void addPolyBoundaryFace
|
||||||
(
|
(
|
||||||
const cellFaceIdentifier& identifier,
|
const cellFaceIdentifier& identifier,
|
||||||
const label nCreatedFaces
|
const label nCreatedFaces
|
||||||
);
|
);
|
||||||
|
|
||||||
//- add cellZones based on cellTable Id
|
//- Add cellZones based on cellTable Id
|
||||||
void addCellZones(polyMesh&) const;
|
void addCellZones(polyMesh&) const;
|
||||||
|
|
||||||
//- add faceZones based on monitoring boundary conditions
|
//- Add faceZones based on monitoring boundary conditions
|
||||||
void addFaceZones(polyMesh&) const;
|
void addFaceZones(polyMesh&) const;
|
||||||
|
|
||||||
//- Make polyhedral boundary from shape boundary
|
//- Make polyhedral boundary from shape boundary
|
||||||
@ -204,7 +221,7 @@ private:
|
|||||||
|
|
||||||
void writeInterfaces(const objectRegistry&) const;
|
void writeInterfaces(const objectRegistry&) const;
|
||||||
|
|
||||||
// write List<label> in constant/polyMesh
|
//- Write List<label> in constant/polyMesh
|
||||||
void writeMeshLabelList
|
void writeMeshLabelList
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -219,7 +236,9 @@ private:
|
|||||||
return const_cast<faceListList&>(cellFaces_);
|
return const_cast<faceListList&>(cellFaces_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- Pointers to cell shape models
|
//- Pointers to cell shape models
|
||||||
@ -229,19 +248,19 @@ protected:
|
|||||||
static const cellModel* prismModel;
|
static const cellModel* prismModel;
|
||||||
static const cellModel* hexModel;
|
static const cellModel* hexModel;
|
||||||
|
|
||||||
//- referenced filename
|
//- Referenced filename
|
||||||
fileName geometryFile_;
|
fileName geometryFile_;
|
||||||
|
|
||||||
//- geometry scaling
|
//- Geometry scaling
|
||||||
scalar scaleFactor_;
|
scalar scaleFactor_;
|
||||||
|
|
||||||
//- Points supporting the mesh
|
//- Points supporting the mesh
|
||||||
pointField points_;
|
pointField points_;
|
||||||
|
|
||||||
//- lookup original Cell number for a given cell
|
//- Lookup original Cell number for a given cell
|
||||||
labelList origCellId_;
|
labelList origCellId_;
|
||||||
|
|
||||||
//- identify boundary faces by cells and their faces
|
//- Identify boundary faces by cells and their faces
|
||||||
// for each patch
|
// for each patch
|
||||||
List<List<cellFaceIdentifier> > boundaryIds_;
|
List<List<cellFaceIdentifier> > boundaryIds_;
|
||||||
|
|
||||||
@ -260,19 +279,17 @@ protected:
|
|||||||
//- List of each baffle face
|
//- List of each baffle face
|
||||||
faceList baffleFaces_;
|
faceList baffleFaces_;
|
||||||
|
|
||||||
// cell table id for each cell
|
//- Cell table id for each cell
|
||||||
labelList cellTableId_;
|
labelList cellTableId_;
|
||||||
|
|
||||||
// cell table persistent data saved as a dictionary
|
//- Cell table persistent data saved as a dictionary
|
||||||
cellTable cellTable_;
|
cellTable cellTable_;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- subclasses are required to supply this information
|
//- Subclasses are required to supply this information
|
||||||
virtual bool readGeometry
|
virtual bool readGeometry(const scalar scaleFactor = 1.0) = 0;
|
||||||
(
|
|
||||||
const scalar scaleFactor = 1.0
|
|
||||||
) = 0;
|
|
||||||
|
|
||||||
//- Return mesh points
|
//- Return mesh points
|
||||||
pointField& points() const
|
pointField& points() const
|
||||||
@ -280,23 +297,28 @@ protected:
|
|||||||
return const_cast<pointField&>(points_);
|
return const_cast<pointField&>(points_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Static Members
|
// Static Members
|
||||||
|
|
||||||
//- warn about repeated names
|
//- Warn about repeated names
|
||||||
static void warnDuplicates(const word& context, const wordList&);
|
static void warnDuplicates(const word& context, const wordList&);
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from fileName
|
//- Construct from fileName
|
||||||
meshReader(const fileName&, const scalar scaleFactor = 1.0);
|
meshReader(const fileName&, const scalar scaleFactor = 1.0);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
//- Destructor
|
||||||
virtual ~meshReader();
|
virtual ~meshReader();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- create and return polyMesh
|
//- Create and return polyMesh
|
||||||
virtual autoPtr<polyMesh> mesh(const objectRegistry&);
|
virtual autoPtr<polyMesh> mesh(const objectRegistry&);
|
||||||
|
|
||||||
//- Write auxiliary information
|
//- Write auxiliary information
|
||||||
@ -310,6 +332,7 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|||||||
@ -23,17 +23,14 @@ License
|
|||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
\*----------------------------------------------------------------------------*/
|
\*----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "meshReader.H"
|
#include "meshReader.H"
|
||||||
#include "IOMap.H"
|
#include "IOMap.H"
|
||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// warn about duplicate names
|
|
||||||
void Foam::meshReader::warnDuplicates
|
void Foam::meshReader::warnDuplicates
|
||||||
(
|
(
|
||||||
const word& context,
|
const word& context,
|
||||||
@ -76,8 +73,6 @@ void Foam::meshReader::warnDuplicates
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// write interface (baffle) mapping
|
|
||||||
void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
|
void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
|
||||||
{
|
{
|
||||||
// write constant/polyMesh/interface
|
// write constant/polyMesh/interface
|
||||||
@ -103,14 +98,12 @@ void Foam::meshReader::writeInterfaces(const objectRegistry& registry) const
|
|||||||
ioObj.writeHeader(os);
|
ioObj.writeHeader(os);
|
||||||
|
|
||||||
os << interfaces_
|
os << interfaces_
|
||||||
<< "// ************************************************************************* //"
|
<< "// *************************************"
|
||||||
|
<< "************************************ //"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write List<label> in constant/polyMesh
|
|
||||||
// this is crucial for later conversion back to ccm/starcd
|
|
||||||
void Foam::meshReader::writeMeshLabelList
|
void Foam::meshReader::writeMeshLabelList
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -151,6 +144,7 @@ void Foam::meshReader::writeMeshLabelList
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::meshReader::writeAux(const objectRegistry& registry) const
|
void Foam::meshReader::writeAux(const objectRegistry& registry) const
|
||||||
@ -179,10 +173,4 @@ void Foam::meshReader::writeAux(const objectRegistry& registry) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -34,21 +34,16 @@ License
|
|||||||
#include "IFstream.H"
|
#include "IFstream.H"
|
||||||
#include "IOMap.H"
|
#include "IOMap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// special boundary regions
|
|
||||||
const char* Foam::meshReaders::STARCD::defaultBoundaryName =
|
const char* Foam::meshReaders::STARCD::defaultBoundaryName =
|
||||||
"Default_Boundary_Region";
|
"Default_Boundary_Region";
|
||||||
|
|
||||||
const char* Foam::meshReaders::STARCD::defaultSolidBoundaryName =
|
const char* Foam::meshReaders::STARCD::defaultSolidBoundaryName =
|
||||||
"Default_Boundary_Solid";
|
"Default_Boundary_Solid";
|
||||||
|
|
||||||
// keep solids
|
|
||||||
bool Foam::meshReaders::STARCD::keepSolids = false;
|
bool Foam::meshReaders::STARCD::keepSolids = false;
|
||||||
|
|
||||||
// face addressing from pro-STAR faces -> foam faces
|
|
||||||
const int Foam::meshReaders::STARCD::starToFoamFaceAddr[4][6] =
|
const int Foam::meshReaders::STARCD::starToFoamFaceAddr[4][6] =
|
||||||
{
|
{
|
||||||
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
|
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
|
||||||
@ -57,12 +52,9 @@ const int Foam::meshReaders::STARCD::starToFoamFaceAddr[4][6] =
|
|||||||
{ 0, -1, 4, 2, 1, 3 } // 14 = pro-STAR pyramid
|
{ 0, -1, 4, 2, 1, 3 } // 14 = pro-STAR pyramid
|
||||||
};
|
};
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// read and discard to newline
|
|
||||||
void Foam::meshReaders::STARCD::readToNewline(IFstream& is)
|
void Foam::meshReaders::STARCD::readToNewline(IFstream& is)
|
||||||
{
|
{
|
||||||
char ch = '\n';
|
char ch = '\n';
|
||||||
@ -73,14 +65,8 @@ void Foam::meshReaders::STARCD::readToNewline(IFstream& is)
|
|||||||
while ((is) && ch != '\n');
|
while ((is) && ch != '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// read header
|
bool Foam::meshReaders::STARCD::readHeader(IFstream& is, word fileSignature)
|
||||||
bool Foam::meshReaders::STARCD::readHeader
|
|
||||||
(
|
|
||||||
IFstream& is,
|
|
||||||
word fileSignature
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if (!is.good())
|
if (!is.good())
|
||||||
{
|
{
|
||||||
@ -108,19 +94,16 @@ bool Foam::meshReaders::STARCD::readHeader
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
// read boundaryRegion names and the cellTable information from
|
void Foam::meshReaders::STARCD::readAux(const objectRegistry& registry)
|
||||||
// dictionaries that have been extracted from the .inp file
|
|
||||||
void Foam::meshReaders::STARCD::readAux
|
|
||||||
(
|
|
||||||
const objectRegistry& registry
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
boundaryRegion_.readDict(registry);
|
boundaryRegion_.readDict(registry);
|
||||||
cellTable_.readDict(registry);
|
cellTable_.readDict(registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// read in the points from the .vrt file
|
// read in the points from the .vrt file
|
||||||
//
|
//
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -219,7 +202,6 @@ void Foam::meshReaders::STARCD::readPoints
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// read in the cells from the .cel file
|
// read in the cells from the .cel file
|
||||||
//
|
//
|
||||||
@ -261,10 +243,7 @@ for each cell face.
|
|||||||
Strictly speaking, we only need the cellModeller for adding boundaries.
|
Strictly speaking, we only need the cellModeller for adding boundaries.
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void Foam::meshReaders::STARCD::readCells
|
void Foam::meshReaders::STARCD::readCells(const fileName& inputName)
|
||||||
(
|
|
||||||
const fileName& inputName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word fileSignature = "PROSTAR_CELL";
|
const word fileSignature = "PROSTAR_CELL";
|
||||||
label nFluids = 0, nSolids = 0, nBaffles = 0, nShells = 0;
|
label nFluids = 0, nSolids = 0, nBaffles = 0, nShells = 0;
|
||||||
@ -545,7 +524,8 @@ void Foam::meshReaders::STARCD::readCells
|
|||||||
{
|
{
|
||||||
Info<< "star cell " << starCellId << " has "
|
Info<< "star cell " << starCellId << " has "
|
||||||
<< (nFaces - faceI)
|
<< (nFaces - faceI)
|
||||||
<< " empty faces - could cause boundary addressing problems"
|
<< " empty faces - could cause boundary "
|
||||||
|
<< "addressing problems"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
nFaces = faceI;
|
nFaces = faceI;
|
||||||
@ -633,6 +613,7 @@ void Foam::meshReaders::STARCD::readCells
|
|||||||
mapToFoamPointId_.clear();
|
mapToFoamPointId_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// read in the boundaries from the .bnd file
|
// read in the boundaries from the .bnd file
|
||||||
//
|
//
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
@ -653,10 +634,7 @@ BAFFLE
|
|||||||
etc,
|
etc,
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
void Foam::meshReaders::STARCD::readBoundary
|
void Foam::meshReaders::STARCD::readBoundary(const fileName& inputName)
|
||||||
(
|
|
||||||
const fileName& inputName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const word fileSignature = "PROSTAR_BOUNDARY";
|
const word fileSignature = "PROSTAR_BOUNDARY";
|
||||||
label nPatches = 0, nFaces = 0, nBafflePatches = 0, maxId = 0;
|
label nPatches = 0, nFaces = 0, nBafflePatches = 0, maxId = 0;
|
||||||
@ -1059,13 +1037,9 @@ void Foam::meshReaders::STARCD::cullPoints()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::meshReaders::STARCD::readGeometry
|
bool Foam::meshReaders::STARCD::readGeometry(const scalar scaleFactor)
|
||||||
(
|
|
||||||
const scalar scaleFactor
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// Info<< "called meshReaders::STARCD::readGeometry" << endl;
|
// Info<< "called meshReaders::STARCD::readGeometry" << endl;
|
||||||
|
|
||||||
@ -1077,9 +1051,9 @@ bool Foam::meshReaders::STARCD::readGeometry
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from reading a file
|
|
||||||
Foam::meshReaders::STARCD::STARCD
|
Foam::meshReaders::STARCD::STARCD
|
||||||
(
|
(
|
||||||
const fileName& prefix,
|
const fileName& prefix,
|
||||||
@ -1095,11 +1069,11 @@ Foam::meshReaders::STARCD::STARCD
|
|||||||
readAux(registry);
|
readAux(registry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::meshReaders::STARCD::~STARCD()
|
Foam::meshReaders::STARCD::~STARCD()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -67,7 +67,8 @@ class STARCD
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Private Data
|
// Protected Data
|
||||||
|
|
||||||
static const char* defaultBoundaryName;
|
static const char* defaultBoundaryName;
|
||||||
static const char* defaultSolidBoundaryName;
|
static const char* defaultSolidBoundaryName;
|
||||||
|
|
||||||
@ -83,10 +84,11 @@ protected:
|
|||||||
//- Cell labels (imported Cell numbering not necessarily contiguous)
|
//- Cell labels (imported Cell numbering not necessarily contiguous)
|
||||||
labelList mapToFoamCellId_;
|
labelList mapToFoamCellId_;
|
||||||
|
|
||||||
//- boundary region data
|
//- Boundary region data
|
||||||
boundaryRegion boundaryRegion_;
|
boundaryRegion boundaryRegion_;
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
STARCD(const STARCD&);
|
STARCD(const STARCD&);
|
||||||
@ -97,27 +99,28 @@ protected:
|
|||||||
//- Read the mesh from the file(s)
|
//- Read the mesh from the file(s)
|
||||||
virtual bool readGeometry(const scalar scaleFactor = 1.0);
|
virtual bool readGeometry(const scalar scaleFactor = 1.0);
|
||||||
|
|
||||||
//- read points from file
|
//- Read points from file
|
||||||
void readPoints(const fileName&, const scalar scaleFactor);
|
void readPoints(const fileName&, const scalar scaleFactor);
|
||||||
|
|
||||||
//- read cell connectivities from file
|
//- Read cell connectivities from file
|
||||||
virtual void readCells(const fileName&);
|
virtual void readCells(const fileName&);
|
||||||
|
|
||||||
//- remove unused points
|
//- Remove unused points
|
||||||
void cullPoints();
|
void cullPoints();
|
||||||
|
|
||||||
//- read boundary (cell/face) definitions
|
//- Read boundary (cell/face) definitions
|
||||||
void readBoundary(const fileName&);
|
void readBoundary(const fileName&);
|
||||||
|
|
||||||
//- read auxiliary data from constant/{boundaryRegion,cellTable}
|
//- Read auxiliary data from constant/{boundaryRegion,cellTable}
|
||||||
void readAux(const objectRegistry&);
|
void readAux(const objectRegistry&);
|
||||||
|
|
||||||
//- read and discard to newline
|
//- Read and discard to newline
|
||||||
static void readToNewline(IFstream&);
|
static void readToNewline(IFstream&);
|
||||||
|
|
||||||
//- read header
|
//- Read header
|
||||||
static bool readHeader(IFstream&, word fileSignature);
|
static bool readHeader(IFstream&, word fileSignature);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
enum cellType
|
enum cellType
|
||||||
@ -145,9 +148,12 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- keep solids (default false)
|
// Static data
|
||||||
|
|
||||||
|
//- Keep solids (default false)
|
||||||
static bool keepSolids;
|
static bool keepSolids;
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from case name
|
//- Construct from case name
|
||||||
@ -158,19 +164,19 @@ public:
|
|||||||
const scalar scaleFactor = 1.0
|
const scalar scaleFactor = 1.0
|
||||||
);
|
);
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
//- Destructor
|
||||||
virtual ~STARCD();
|
virtual ~STARCD();
|
||||||
|
|
||||||
// Member Functions
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace meshReaders
|
} // End namespace meshReaders
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -36,7 +36,6 @@ Foam::boundaryRegion::boundaryRegion()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// read constant/boundaryRegion (IOMap<dictionary>)
|
|
||||||
Foam::boundaryRegion::boundaryRegion
|
Foam::boundaryRegion::boundaryRegion
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -55,6 +54,7 @@ Foam::boundaryRegion::boundaryRegion
|
|||||||
Foam::boundaryRegion::~boundaryRegion()
|
Foam::boundaryRegion::~boundaryRegion()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::boundaryRegion::append(const dictionary& dict)
|
Foam::label Foam::boundaryRegion::append(const dictionary& dict)
|
||||||
@ -73,8 +73,7 @@ Foam::label Foam::boundaryRegion::append(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::boundaryRegion::names() const
|
||||||
Foam::boundaryRegion::names() const
|
|
||||||
{
|
{
|
||||||
Map<word> lookup;
|
Map<word> lookup;
|
||||||
|
|
||||||
@ -90,8 +89,7 @@ Foam::boundaryRegion::names() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::boundaryRegion::boundaryTypes() const
|
||||||
Foam::boundaryRegion::boundaryTypes() const
|
|
||||||
{
|
{
|
||||||
Map<word> lookup;
|
Map<word> lookup;
|
||||||
|
|
||||||
@ -139,7 +137,6 @@ Foam::word Foam::boundaryRegion::boundaryType(const word& name) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// read constant/boundaryRegion (IOMap<dictionary>)
|
|
||||||
void Foam::boundaryRegion::readDict
|
void Foam::boundaryRegion::readDict
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -174,7 +171,6 @@ void Foam::boundaryRegion::readDict
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write constant/boundaryRegion for later reuse
|
|
||||||
void Foam::boundaryRegion::writeDict
|
void Foam::boundaryRegion::writeDict
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -208,12 +204,12 @@ void Foam::boundaryRegion::writeDict
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
void Foam::boundaryRegion::operator=(const boundaryRegion& rhs)
|
void Foam::boundaryRegion::operator=(const boundaryRegion& rhs)
|
||||||
{
|
{
|
||||||
Map<dictionary>::operator=(rhs);
|
Map<dictionary>::operator=(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::boundaryRegion::operator=(const Map<dictionary>& rhs)
|
void Foam::boundaryRegion::operator=(const Map<dictionary>& rhs)
|
||||||
{
|
{
|
||||||
Map<dictionary>::operator=(rhs);
|
Map<dictionary>::operator=(rhs);
|
||||||
@ -260,9 +256,5 @@ void Foam::boundaryRegion::rename(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -72,15 +72,13 @@ class boundaryRegion
|
|||||||
:
|
:
|
||||||
public Map<dictionary>
|
public Map<dictionary>
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
boundaryRegion(const boundaryRegion&);
|
boundaryRegion(const boundaryRegion&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Static Members
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -96,7 +94,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
~boundaryRegion();
|
~boundaryRegion();
|
||||||
|
|
||||||
|
|
||||||
@ -126,7 +124,6 @@ public:
|
|||||||
const fileName& instance = "constant"
|
const fileName& instance = "constant"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//- Write constant/boundaryRegion for later reuse
|
//- Write constant/boundaryRegion for later reuse
|
||||||
void writeDict
|
void writeDict
|
||||||
(
|
(
|
||||||
@ -153,13 +150,14 @@ public:
|
|||||||
// newPatchName originalName;
|
// newPatchName originalName;
|
||||||
// @endverbatim
|
// @endverbatim
|
||||||
void rename(const dictionary&);
|
void rename(const dictionary&);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -37,7 +37,6 @@ const char* const Foam::cellTable::defaultMaterial_ = "fluid";
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
//- map from cellTable Id -> zone number (unmapped = -1)
|
|
||||||
Foam::labelList Foam::cellTable::zoneMap() const
|
Foam::labelList Foam::cellTable::zoneMap() const
|
||||||
{
|
{
|
||||||
label maxId = 0;
|
label maxId = 0;
|
||||||
@ -78,7 +77,6 @@ Foam::wordList Foam::cellTable::namesList() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// add required entries - MaterialType
|
|
||||||
void Foam::cellTable::addDefaults()
|
void Foam::cellTable::addDefaults()
|
||||||
{
|
{
|
||||||
forAllIter(Map<dictionary>, *this, iter)
|
forAllIter(Map<dictionary>, *this, iter)
|
||||||
@ -115,14 +113,12 @@ void Foam::cellTable::setEntry
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
Foam::cellTable::cellTable()
|
Foam::cellTable::cellTable()
|
||||||
:
|
:
|
||||||
Map<dictionary>()
|
Map<dictionary>()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// read constant/cellTable (IOMap<dictionary>)
|
|
||||||
Foam::cellTable::cellTable
|
Foam::cellTable::cellTable
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -136,13 +132,12 @@ Foam::cellTable::cellTable
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::cellTable::~cellTable()
|
Foam::cellTable::~cellTable()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::label Foam::cellTable::append(const dictionary& dict)
|
Foam::label Foam::cellTable::append(const dictionary& dict)
|
||||||
@ -161,8 +156,7 @@ Foam::label Foam::cellTable::append(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::names() const
|
||||||
Foam::cellTable::names() const
|
|
||||||
{
|
{
|
||||||
Map<word> lookup;
|
Map<word> lookup;
|
||||||
|
|
||||||
@ -211,8 +205,10 @@ Foam::label Foam::cellTable::findIndex(const word& name) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::selectType
|
||||||
Foam::cellTable::selectType(const word& materialType) const
|
(
|
||||||
|
const word& materialType
|
||||||
|
) const
|
||||||
{
|
{
|
||||||
Map<word> lookup;
|
Map<word> lookup;
|
||||||
|
|
||||||
@ -236,29 +232,25 @@ Foam::cellTable::selectType(const word& materialType) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::fluids() const
|
||||||
Foam::cellTable::fluids() const
|
|
||||||
{
|
{
|
||||||
return selectType("fluid");
|
return selectType("fluid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::solids() const
|
||||||
Foam::cellTable::solids() const
|
|
||||||
{
|
{
|
||||||
return selectType("solid");
|
return selectType("solid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::shells() const
|
||||||
Foam::cellTable::shells() const
|
|
||||||
{
|
{
|
||||||
return selectType("shell");
|
return selectType("shell");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::Map<Foam::word>
|
Foam::Map<Foam::word> Foam::cellTable::materialTypes() const
|
||||||
Foam::cellTable::materialTypes() const
|
|
||||||
{
|
{
|
||||||
Map<word> lookup;
|
Map<word> lookup;
|
||||||
|
|
||||||
@ -275,7 +267,6 @@ Foam::cellTable::materialTypes() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- assign material Type
|
|
||||||
void Foam::cellTable::setMaterial(const label& id, const word& matlType)
|
void Foam::cellTable::setMaterial(const label& id, const word& matlType)
|
||||||
{
|
{
|
||||||
setEntry(id, "MaterialType", matlType);
|
setEntry(id, "MaterialType", matlType);
|
||||||
@ -299,7 +290,6 @@ void Foam::cellTable::setName(const label& id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// read constant/cellTable (IOMap<dictionary>)
|
|
||||||
void Foam::cellTable::readDict
|
void Foam::cellTable::readDict
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -335,7 +325,6 @@ void Foam::cellTable::readDict
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// write constant/cellTable for later reuse
|
|
||||||
void Foam::cellTable::writeDict
|
void Foam::cellTable::writeDict
|
||||||
(
|
(
|
||||||
const objectRegistry& registry,
|
const objectRegistry& registry,
|
||||||
@ -369,19 +358,20 @@ void Foam::cellTable::writeDict
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
void Foam::cellTable::operator=(const cellTable& rhs)
|
void Foam::cellTable::operator=(const cellTable& rhs)
|
||||||
{
|
{
|
||||||
Map<dictionary>::operator=(rhs);
|
Map<dictionary>::operator=(rhs);
|
||||||
addDefaults();
|
addDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::cellTable::operator=(const Map<dictionary>& rhs)
|
void Foam::cellTable::operator=(const Map<dictionary>& rhs)
|
||||||
{
|
{
|
||||||
Map<dictionary>::operator=(rhs);
|
Map<dictionary>::operator=(rhs);
|
||||||
addDefaults();
|
addDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::cellTable::operator=(const polyMesh& mesh)
|
void Foam::cellTable::operator=(const polyMesh& mesh)
|
||||||
{
|
{
|
||||||
Map<dictionary> zoneDict;
|
Map<dictionary> zoneDict;
|
||||||
@ -430,9 +420,6 @@ void Foam::cellTable::operator=(const polyMesh& mesh)
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
// attach cellZones based on the cellTable Id
|
|
||||||
// - any other values can be extracted later from the cellTable dictionary
|
|
||||||
void Foam::cellTable::addCellZones
|
void Foam::cellTable::addCellZones
|
||||||
(
|
(
|
||||||
polyMesh& mesh,
|
polyMesh& mesh,
|
||||||
@ -580,8 +567,5 @@ void Foam::cellTable::combine(const dictionary& dict, labelList& tableIds)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -80,8 +80,10 @@ class cellTable
|
|||||||
public Map<dictionary>
|
public Map<dictionary>
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
static const char* const defaultMaterial_;
|
static const char* const defaultMaterial_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Map from cellTable ID => zone number (unmapped = -1)
|
//- Map from cellTable ID => zone number (unmapped = -1)
|
||||||
@ -98,8 +100,8 @@ class cellTable
|
|||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
cellTable(const cellTable&);
|
cellTable(const cellTable&);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Static Members
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Destructor
|
//- Destructor
|
||||||
~cellTable();
|
~cellTable();
|
||||||
|
|
||||||
|
|
||||||
@ -175,6 +177,7 @@ public:
|
|||||||
const fileName& instance = "constant"
|
const fileName& instance = "constant"
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
//- Assignment
|
//- Assignment
|
||||||
@ -195,13 +198,14 @@ public:
|
|||||||
//- Combine tableIds together
|
//- Combine tableIds together
|
||||||
// each dictionary entry is a wordList
|
// each dictionary entry is a wordList
|
||||||
void combine(const dictionary&, labelList& tableIds);
|
void combine(const dictionary&, labelList& tableIds);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -29,27 +29,34 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Pointers to cell shape models
|
|
||||||
const Foam::cellModel* Foam::meshWriter::unknownModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshWriter::unknownModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
"unknown"
|
"unknown"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const Foam::cellModel* Foam::meshWriter::tetModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshWriter::tetModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
"tet"
|
"tet"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const Foam::cellModel* Foam::meshWriter::pyrModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshWriter::pyrModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
"pyr"
|
"pyr"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const Foam::cellModel* Foam::meshWriter::prismModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshWriter::prismModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
"prism"
|
"prism"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const Foam::cellModel* Foam::meshWriter::hexModel = Foam::cellModeller::
|
const Foam::cellModel* Foam::meshWriter::hexModel = Foam::cellModeller::
|
||||||
lookup
|
lookup
|
||||||
(
|
(
|
||||||
@ -61,15 +68,9 @@ Foam::string Foam::meshWriter::defaultMeshName = "meshExport";
|
|||||||
Foam::string Foam::meshWriter::defaultSurfaceName = "surfExport";
|
Foam::string Foam::meshWriter::defaultSurfaceName = "surfExport";
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::meshWriter::meshWriter
|
Foam::meshWriter::meshWriter(const polyMesh& mesh, const scalar scaleFactor)
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const scalar scaleFactor
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
scaleFactor_(scaleFactor),
|
scaleFactor_(scaleFactor),
|
||||||
@ -80,27 +81,10 @@ Foam::meshWriter::meshWriter
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::meshWriter::~meshWriter()
|
Foam::meshWriter::~meshWriter()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -90,8 +90,6 @@ namespace Foam
|
|||||||
|
|
||||||
class meshWriter
|
class meshWriter
|
||||||
{
|
{
|
||||||
// Private data
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
@ -100,16 +98,18 @@ class meshWriter
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const meshWriter&);
|
void operator=(const meshWriter&);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected data
|
// Protected data
|
||||||
|
|
||||||
//- mesh reference
|
//- Mesh reference
|
||||||
const polyMesh& mesh_;
|
const polyMesh& mesh_;
|
||||||
|
|
||||||
//- scaling factor for points (eg, [m] -> [mm])
|
//- Scaling factor for points (eg, [m] -> [mm])
|
||||||
scalar scaleFactor_;
|
scalar scaleFactor_;
|
||||||
|
|
||||||
//- write bnd file
|
//- Write bnd file
|
||||||
bool writeBoundary_;
|
bool writeBoundary_;
|
||||||
|
|
||||||
//- boundaryRegion persistent data saved as a dictionary
|
//- boundaryRegion persistent data saved as a dictionary
|
||||||
@ -118,7 +118,7 @@ protected:
|
|||||||
//- cellTable persistent data saved as a dictionary
|
//- cellTable persistent data saved as a dictionary
|
||||||
cellTable cellTable_;
|
cellTable cellTable_;
|
||||||
|
|
||||||
// cellTable IDs for each cell
|
//- cellTable IDs for each cell
|
||||||
labelList cellTableId_;
|
labelList cellTableId_;
|
||||||
|
|
||||||
//- Pointers to cell shape models
|
//- Pointers to cell shape models
|
||||||
@ -128,6 +128,7 @@ protected:
|
|||||||
static const cellModel* prismModel;
|
static const cellModel* prismModel;
|
||||||
static const cellModel* hexModel;
|
static const cellModel* hexModel;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
@ -138,7 +139,7 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- create a writer obejct
|
//- Ccreate a writer obejct
|
||||||
meshWriter
|
meshWriter
|
||||||
(
|
(
|
||||||
const polyMesh&,
|
const polyMesh&,
|
||||||
@ -146,43 +147,37 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// Selectors
|
//- Destructor
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
virtual ~meshWriter();
|
virtual ~meshWriter();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
//- set points scaling
|
//- Set points scaling
|
||||||
void scaleFactor(const scalar scaling)
|
void scaleFactor(const scalar scaling)
|
||||||
{
|
{
|
||||||
scaleFactor_ = scaling;
|
scaleFactor_ = scaling;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- suppress writing bnd file
|
//- Suppress writing bnd file
|
||||||
void noBoundary()
|
void noBoundary()
|
||||||
{
|
{
|
||||||
writeBoundary_ = false;
|
writeBoundary_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Write
|
// Write
|
||||||
|
|
||||||
//- write volume mesh
|
//- Write volume mesh
|
||||||
// subclass must to supply this method
|
// subclass must to supply this method
|
||||||
virtual bool write
|
virtual bool write
|
||||||
(
|
(
|
||||||
const fileName& timeName = fileName::null
|
const fileName& timeName = fileName::null
|
||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- write surface mesh with optional triangulation
|
//- Write surface mesh with optional triangulation
|
||||||
// subclass could supply this information
|
// subclass could supply this information
|
||||||
virtual bool writeSurface
|
virtual bool writeSurface
|
||||||
(
|
(
|
||||||
@ -192,14 +187,6 @@ public:
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -209,10 +196,6 @@ public:
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// #include "meshWriterI.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -32,11 +32,9 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// special boundary regions
|
|
||||||
const char* Foam::meshWriters::STARCD::defaultBoundaryName =
|
const char* Foam::meshWriters::STARCD::defaultBoundaryName =
|
||||||
"Default_Boundary_Region";
|
"Default_Boundary_Region";
|
||||||
|
|
||||||
// face addressing from foam faces -> pro-STAR faces for primitive shapes
|
|
||||||
const Foam::label Foam::meshWriters::STARCD::foamToStarFaceAddr[4][6] =
|
const Foam::label Foam::meshWriters::STARCD::foamToStarFaceAddr[4][6] =
|
||||||
{
|
{
|
||||||
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
|
{ 4, 5, 2, 3, 0, 1 }, // 11 = pro-STAR hex
|
||||||
@ -174,12 +172,7 @@ void Foam::meshWriters::STARCD::getCellTable()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Prostar 4+ header format
|
void Foam::meshWriters::STARCD::writeHeader(Ostream& os, const char* filetype)
|
||||||
void Foam::meshWriters::STARCD::writeHeader
|
|
||||||
(
|
|
||||||
Ostream& os,
|
|
||||||
const char* filetype
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
os << "PROSTAR_" << filetype << nl
|
os << "PROSTAR_" << filetype << nl
|
||||||
<< 4000
|
<< 4000
|
||||||
@ -194,10 +187,7 @@ void Foam::meshWriters::STARCD::writeHeader
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshWriters::STARCD::writePoints
|
void Foam::meshWriters::STARCD::writePoints(const fileName& prefix) const
|
||||||
(
|
|
||||||
const fileName& prefix
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
OFstream os(prefix + ".vrt");
|
OFstream os(prefix + ".vrt");
|
||||||
writeHeader(os, "VERTEX");
|
writeHeader(os, "VERTEX");
|
||||||
@ -227,10 +217,7 @@ void Foam::meshWriters::STARCD::writePoints
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshWriters::STARCD::writeCells
|
void Foam::meshWriters::STARCD::writeCells(const fileName& prefix) const
|
||||||
(
|
|
||||||
const fileName& prefix
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
OFstream os(prefix + ".cel");
|
OFstream os(prefix + ".cel");
|
||||||
writeHeader(os, "CELL");
|
writeHeader(os, "CELL");
|
||||||
@ -372,10 +359,7 @@ void Foam::meshWriters::STARCD::writeCells
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::meshWriters::STARCD::writeBoundary
|
void Foam::meshWriters::STARCD::writeBoundary(const fileName& prefix) const
|
||||||
(
|
|
||||||
const fileName& prefix
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
OFstream os(prefix + ".bnd");
|
OFstream os(prefix + ".bnd");
|
||||||
writeHeader(os, "BOUNDARY");
|
writeHeader(os, "BOUNDARY");
|
||||||
@ -495,9 +479,6 @@ Foam::meshWriters::STARCD::STARCD
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::meshWriters::STARCD::~STARCD()
|
Foam::meshWriters::STARCD::~STARCD()
|
||||||
@ -506,10 +487,7 @@ Foam::meshWriters::STARCD::~STARCD()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::meshWriters::STARCD::rmFiles
|
void Foam::meshWriters::STARCD::rmFiles(const fileName& baseName) const
|
||||||
(
|
|
||||||
const fileName& baseName
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
rm(baseName + ".vrt");
|
rm(baseName + ".vrt");
|
||||||
rm(baseName + ".cel");
|
rm(baseName + ".cel");
|
||||||
@ -518,10 +496,7 @@ void Foam::meshWriters::STARCD::rmFiles
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::meshWriters::STARCD::write
|
bool Foam::meshWriters::STARCD::write(const fileName& meshName) const
|
||||||
(
|
|
||||||
const fileName& meshName
|
|
||||||
) const
|
|
||||||
{
|
{
|
||||||
fileName baseName(meshName);
|
fileName baseName(meshName);
|
||||||
|
|
||||||
@ -748,10 +723,4 @@ bool Foam::meshWriters::STARCD::writeSurface
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -64,8 +64,10 @@ class STARCD
|
|||||||
public meshWriter
|
public meshWriter
|
||||||
{
|
{
|
||||||
// Private Data
|
// Private Data
|
||||||
|
|
||||||
static const char* defaultBoundaryName;
|
static const char* defaultBoundaryName;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
@ -74,22 +76,23 @@ class STARCD
|
|||||||
//- Disallow default bitwise assignment
|
//- Disallow default bitwise assignment
|
||||||
void operator=(const STARCD&);
|
void operator=(const STARCD&);
|
||||||
|
|
||||||
//- pro-STAR 4+ header format
|
//- Pro-STAR 4+ header format
|
||||||
static void writeHeader(Ostream&, const char* filetype);
|
static void writeHeader(Ostream&, const char* filetype);
|
||||||
|
|
||||||
//- write points
|
//- Write points
|
||||||
void writePoints(const fileName& baseName) const;
|
void writePoints(const fileName& baseName) const;
|
||||||
|
|
||||||
//- write cells
|
//- Write cells
|
||||||
void writeCells(const fileName& baseName) const;
|
void writeCells(const fileName& baseName) const;
|
||||||
|
|
||||||
//- write boundary
|
//- Write boundary
|
||||||
void writeBoundary(const fileName& baseName) const;
|
void writeBoundary(const fileName& baseName) const;
|
||||||
|
|
||||||
void getCellTable();
|
void getCellTable();
|
||||||
|
|
||||||
label findDefaultBoundary() const;
|
label findDefaultBoundary() const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Static data members
|
// Static data members
|
||||||
@ -100,68 +103,50 @@ public:
|
|||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- open a file for writing
|
//- Open a file for writing
|
||||||
STARCD
|
STARCD
|
||||||
(
|
(
|
||||||
const polyMesh&,
|
const polyMesh&,
|
||||||
const scalar scaleFactor = 1.0
|
const scalar scaleFactor = 1.0
|
||||||
);
|
);
|
||||||
|
|
||||||
// Selectors
|
|
||||||
|
|
||||||
// Destructor
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
virtual ~STARCD();
|
virtual ~STARCD();
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
// Check
|
|
||||||
|
|
||||||
// Edit
|
// Edit
|
||||||
|
|
||||||
// Write
|
|
||||||
|
|
||||||
|
|
||||||
//- Remove STAR-CD files for the baseName
|
//- Remove STAR-CD files for the baseName
|
||||||
void rmFiles(const fileName& baseName) const;
|
void rmFiles(const fileName& baseName) const;
|
||||||
|
|
||||||
//- write volume mesh
|
|
||||||
|
// Write
|
||||||
|
|
||||||
|
//- Write volume mesh
|
||||||
virtual bool write
|
virtual bool write
|
||||||
(
|
(
|
||||||
const fileName& meshName = fileName::null
|
const fileName& meshName = fileName::null
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- write surface mesh with optional triangulation
|
//- Write surface mesh with optional triangulation
|
||||||
virtual bool writeSurface
|
virtual bool writeSurface
|
||||||
(
|
(
|
||||||
const fileName& meshName = fileName::null,
|
const fileName& meshName = fileName::null,
|
||||||
const bool& triangulate = false
|
const bool& triangulate = false
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
|
||||||
|
|
||||||
// Friend Functions
|
|
||||||
|
|
||||||
// Friend Operators
|
|
||||||
|
|
||||||
// IOstream Operators
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
} // End namespace meshWriters
|
} // End namespace meshWriters
|
||||||
|
|
||||||
} // End namespace Foam
|
} // End namespace Foam
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -474,7 +474,7 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
|
|||||||
|
|
||||||
forAll(typEdgeLenSqr, levelI)
|
forAll(typEdgeLenSqr, levelI)
|
||||||
{
|
{
|
||||||
if (typEdgeLenSqr[levelI] == GREAT2)
|
if (typEdgeLenSqr[levelI] == GREAT2 && maxEdgeLenSqr[levelI] >= 0)
|
||||||
{
|
{
|
||||||
typEdgeLenSqr[levelI] = maxEdgeLenSqr[levelI];
|
typEdgeLenSqr[levelI] = maxEdgeLenSqr[levelI];
|
||||||
}
|
}
|
||||||
@ -496,13 +496,14 @@ Foam::scalar Foam::hexRef8::getLevel0EdgeLength() const
|
|||||||
|
|
||||||
if (lenSqr < GREAT2)
|
if (lenSqr < GREAT2)
|
||||||
{
|
{
|
||||||
level0Size = Foam::sqrt(lenSqr)/(1<<levelI);
|
level0Size = Foam::sqrt(lenSqr)*(1<<levelI);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Pout<< "hexRef8::getLevel0EdgeLength() :"
|
Pout<< "hexRef8::getLevel0EdgeLength() :"
|
||||||
<< " For level:" << levelI
|
<< " For level:" << levelI
|
||||||
<< " found edgeLen:" << level0Size
|
<< " have edgeLen:" << Foam::sqrt(lenSqr)
|
||||||
|
<< " with equivalent level0 len:" << level0Size
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
// The FOAM Project // File: motionProperties
|
||||||
|
/*
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
========= | dictionary
|
||||||
|
\\ / |
|
||||||
|
\\ / | Name: motionProperties
|
||||||
|
\\ / | Family: FoamX configuration file
|
||||||
|
\\/ |
|
||||||
|
F ield | FOAM version: 2.1
|
||||||
|
O peration | Product of Nabla Ltd.
|
||||||
|
A and |
|
||||||
|
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
// FoamX Case Dictionary.
|
||||||
|
|
||||||
|
version 1.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/warhol/chris/foam/chris2.1/run/Test";
|
||||||
|
case "movingCone";
|
||||||
|
instance "constant";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
form dictionary;
|
||||||
|
object motionProperties;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//motionSolverLibs ("libfvMotionSolvers.so");
|
||||||
|
solver laplacian;
|
||||||
|
//solver componentLaplacian x;
|
||||||
|
|
||||||
|
twoDMotion no;
|
||||||
|
|
||||||
|
diffusivity uniform;
|
||||||
|
|
||||||
|
//motionPlaneNormal (0 0 1);
|
||||||
|
//
|
||||||
|
//movingSurface yes;
|
||||||
|
//
|
||||||
|
//twoFluids no;
|
||||||
|
//
|
||||||
|
//normalMotionDir no;
|
||||||
|
//
|
||||||
|
//motionURF 1.0;
|
||||||
|
//
|
||||||
|
//boundaryCorrection yes;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-2.03 -2.0 0)
|
||||||
|
( 8.03 -2.0 0)
|
||||||
|
( 8.03 8.0 0)
|
||||||
|
(-2.03 8.0 0)
|
||||||
|
(-2.03 -2.0 5)
|
||||||
|
( 8.03 -2.0 5)
|
||||||
|
( 8.03 8.0 5)
|
||||||
|
(-2.03 8.0 5)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (20 20 20) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
patches
|
||||||
|
(
|
||||||
|
patch maxY
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
)
|
||||||
|
patch minX
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
)
|
||||||
|
patch maxX
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
)
|
||||||
|
patch minY
|
||||||
|
(
|
||||||
|
(1 5 4 0)
|
||||||
|
)
|
||||||
|
patch minZ
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
)
|
||||||
|
patch maxZ
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
57
tutorials/snappyHexMesh/iglooWithFridges/system/controlDict
Normal file
57
tutorials/snappyHexMesh/iglooWithFridges/system/controlDict
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application icoFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 100;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 1;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
//writeFormat binary;
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 7;
|
||||||
|
|
||||||
|
writeCompression uncompressed;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
// The FOAM Project // File: decomposeParDict
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
========= | dictionary
|
||||||
|
\\ / |
|
||||||
|
\\ / | Name: decomposeParDict
|
||||||
|
\\ / | Family: FoamX configuration file
|
||||||
|
\\/ |
|
||||||
|
F ield | FOAM version: 2.1
|
||||||
|
O peration | Product of Nabla Ltd.
|
||||||
|
A and |
|
||||||
|
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
// FoamX Case Dictionary.
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||||
|
case "cavity";
|
||||||
|
instance "system";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
|
||||||
|
|
||||||
|
numberOfSubdomains 6;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
//method metis;
|
||||||
|
//method parMetis;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (4 1 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (3 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
metisCoeffs
|
||||||
|
{
|
||||||
|
//n (5 1 1);
|
||||||
|
//cellWeightsFile "constant/cellWeightsFile";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
71
tutorials/snappyHexMesh/iglooWithFridges/system/fvSchemes
Normal file
71
tutorials/snappyHexMesh/iglooWithFridges/system/fvSchemes
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
|
||||||
|
//snGradCorr(cellMotionU) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(nu,U) Gauss linear corrected;
|
||||||
|
laplacian(1|A(U),p) Gauss linear corrected;
|
||||||
|
|
||||||
|
laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
interpolate(HbyA) linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
45
tutorials/snappyHexMesh/iglooWithFridges/system/fvSolution
Normal file
45
tutorials/snappyHexMesh/iglooWithFridges/system/fvSolution
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
//p ICCG 1e-06 0;
|
||||||
|
p AMG 1e-06 0 10;
|
||||||
|
U BICCG 1e-05 0;
|
||||||
|
|
||||||
|
// Meshmotion
|
||||||
|
cellMotionU ICCG 1e-6 0.0;
|
||||||
|
cellMotionUx ICCG 1e-6 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pRefCell 0;
|
||||||
|
pRefValue 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,338 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||||
|
case "cavity";
|
||||||
|
instance "system";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object autoHexMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Which of the steps to run
|
||||||
|
castellatedMesh true;
|
||||||
|
snap true;
|
||||||
|
addLayers true;
|
||||||
|
|
||||||
|
|
||||||
|
// Geometry. Definition of all surfaces. All surfaces are of class
|
||||||
|
// searchableSurface.
|
||||||
|
// Surfaces are used
|
||||||
|
// - to specify refinement for any mesh cell intersecting it
|
||||||
|
// - to specify refinement for any mesh cell inside/outside/near
|
||||||
|
// - to 'snap' the mesh boundary to the surface
|
||||||
|
geometry
|
||||||
|
{
|
||||||
|
fridgeA
|
||||||
|
{
|
||||||
|
type searchableBox;
|
||||||
|
min (2 2 0);
|
||||||
|
max (3 3 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
fridgeB
|
||||||
|
{
|
||||||
|
type searchableBox;
|
||||||
|
min (3.5 3 0);
|
||||||
|
max (4.3 3.8 1.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
igloo
|
||||||
|
{
|
||||||
|
type searchableSphere;
|
||||||
|
centre (3 3 0);
|
||||||
|
radius 4;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the castellatedMesh generation.
|
||||||
|
castellatedMeshControls
|
||||||
|
{
|
||||||
|
|
||||||
|
// Refinement parameters
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// While refining maximum number of cells per processor. This is basically
|
||||||
|
// the number of cells that fit on a processor. If you choose this too small
|
||||||
|
// it will do just more refinement iterations to obtain a similar mesh.
|
||||||
|
maxLocalCells 1000000;
|
||||||
|
|
||||||
|
// Overall cell limit (approximately). Refinement will stop immediately
|
||||||
|
// upon reaching this number so a refinement level might not complete.
|
||||||
|
// Note that this is the number of cells before removing the part which
|
||||||
|
// is not 'visible' from the keepPoint. The final number of cells might
|
||||||
|
// actually be a lot less.
|
||||||
|
maxGlobalCells 2000000;
|
||||||
|
|
||||||
|
// The surface refinement loop might spend lots of iterations refining just a
|
||||||
|
// few cells. This setting will cause refinement to stop if <= minimumRefine
|
||||||
|
// are selected for refinement. Note: it will at least do one iteration
|
||||||
|
// (unless the number of cells to refine is 0)
|
||||||
|
minRefinementCells 0;
|
||||||
|
|
||||||
|
// Number of buffer layers between different levels.
|
||||||
|
// 1 means normal 2:1 refinement restriction, larger means slower
|
||||||
|
// refinement.
|
||||||
|
nCellsBetweenLevels 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit feature edge refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies a level for any cell intersected by its edges.
|
||||||
|
// This is a featureEdgeMesh, read from constant/triSurface for now.
|
||||||
|
features
|
||||||
|
(
|
||||||
|
//{
|
||||||
|
// file "someLine.eMesh";
|
||||||
|
// level 2;
|
||||||
|
//}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Surface based refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies two levels for every surface. The first is the minimum level,
|
||||||
|
// every cell intersecting a surface gets refined up to the minimum level.
|
||||||
|
// The second level is the maximum level. Cells that 'see' multiple
|
||||||
|
// intersections where the intersections make an
|
||||||
|
// angle > resolveFeatureAngle get refined up to the maximum level.
|
||||||
|
|
||||||
|
refinementSurfaces
|
||||||
|
{
|
||||||
|
fridgeA
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (2 2);
|
||||||
|
}
|
||||||
|
fridgeB
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (2 2);
|
||||||
|
}
|
||||||
|
igloo
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (1 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve sharp angles on fridges
|
||||||
|
resolveFeatureAngle 60;
|
||||||
|
|
||||||
|
|
||||||
|
// Region-wise refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies refinement level for cells in relation to a surface. One of
|
||||||
|
// three modes
|
||||||
|
// - distance. 'levels' specifies per distance to the surface the
|
||||||
|
// wanted refinement level. The distances need to be specified in
|
||||||
|
// descending order.
|
||||||
|
// - inside. 'levels' is only one entry and only the level is used. All
|
||||||
|
// cells inside the surface get refined up to the level. The surface
|
||||||
|
// needs to be closed for this to be possible.
|
||||||
|
// - outside. Same but cells outside.
|
||||||
|
|
||||||
|
refinementRegions
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mesh selection
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// After refinement patches get added for all refinementSurfaces and
|
||||||
|
// all cells intersecting the surfaces get put into these patches. The
|
||||||
|
// section reachable from the locationInMesh is kept.
|
||||||
|
// NOTE: This point should never be on a face, always inside a cell, even
|
||||||
|
// after refinement.
|
||||||
|
locationInMesh (3 0.28 0.43);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the snapping.
|
||||||
|
snapControls
|
||||||
|
{
|
||||||
|
//- Number of patch smoothing iterations before finding correspondence
|
||||||
|
// to surface
|
||||||
|
nSmoothPatch 3;
|
||||||
|
|
||||||
|
//- Relative distance for points to be attracted by surface feature point
|
||||||
|
// or edge. True distance is this factor times local
|
||||||
|
// maximum edge length.
|
||||||
|
tolerance 4.0;
|
||||||
|
|
||||||
|
//- Number of mesh displacement relaxation iterations.
|
||||||
|
nSolveIter 30;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the layer addition.
|
||||||
|
addLayersControls
|
||||||
|
{
|
||||||
|
// Per final patch (so not geometry!) the layer information
|
||||||
|
layers
|
||||||
|
{
|
||||||
|
fridgeA_region0
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
fridgeB_region0
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
igloo_region0
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expansion factor for layer mesh
|
||||||
|
expansionRatio 1.0;
|
||||||
|
|
||||||
|
//- Wanted thickness of final added cell layer. If multiple layers
|
||||||
|
// is the
|
||||||
|
// thickness of the layer furthest away from the wall.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
finalLayerRatio 0.5;
|
||||||
|
|
||||||
|
//- Minimum thickness of cell layer. If for any reason layer
|
||||||
|
// cannot be above minThickness do not add layer.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
minThickness 0.25;
|
||||||
|
|
||||||
|
//- If points get not extruded do nGrow layers of connected faces that are
|
||||||
|
// also not grown. This helps convergence of the layer addition process
|
||||||
|
// close to features.
|
||||||
|
nGrow 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced settings
|
||||||
|
|
||||||
|
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||||
|
// make straight angle.
|
||||||
|
featureAngle 60;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of surface normals
|
||||||
|
nSmoothSurfaceNormals 1;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of interior mesh movement direction
|
||||||
|
nSmoothNormals 3;
|
||||||
|
|
||||||
|
// Smooth layer thickness over surface patches
|
||||||
|
nSmoothThickness 10;
|
||||||
|
|
||||||
|
// Stop layer growth on highly warped cells
|
||||||
|
maxFaceThicknessRatio 0.5;
|
||||||
|
|
||||||
|
// Reduce layer growth where ratio thickness to medial
|
||||||
|
// distance is large
|
||||||
|
maxThicknessToMedialRatio 0.3;
|
||||||
|
|
||||||
|
// Angle used to pick up medial axis points
|
||||||
|
minMedianAxisAngle 130;
|
||||||
|
|
||||||
|
// Create buffer region for new layer terminations
|
||||||
|
nBufferCellsNoExtrude 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Generic mesh quality settings. At any undoable phase these determine
|
||||||
|
// where to undo.
|
||||||
|
meshQualityControls
|
||||||
|
{
|
||||||
|
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||||
|
maxNonOrtho 65;
|
||||||
|
|
||||||
|
//- Max skewness allowed. Set to <0 to disable.
|
||||||
|
maxBoundarySkewness 20;
|
||||||
|
maxInternalSkewness 4;
|
||||||
|
|
||||||
|
//- Max concaveness allowed. Is angle (in degrees) below which concavity
|
||||||
|
// is allowed. 0 is straight face, <0 would be convex face.
|
||||||
|
// Set to 180 to disable.
|
||||||
|
maxConcave 80;
|
||||||
|
|
||||||
|
//- Minimum projected area v.s. actual area. Set to -1 to disable.
|
||||||
|
minFlatness 0.5;
|
||||||
|
|
||||||
|
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
|
||||||
|
// Set to very negative number (e.g. -1E30) to disable.
|
||||||
|
minVol 1e-13;
|
||||||
|
|
||||||
|
//- Minimum face area. Set to <0 to disable.
|
||||||
|
minArea -1;
|
||||||
|
|
||||||
|
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
|
||||||
|
//- and face centre triangles normal
|
||||||
|
minTwist 0.05;
|
||||||
|
|
||||||
|
//- minimum normalised cell determinant
|
||||||
|
//- 1 = hex, <= 0 = folded or flattened illegal cell
|
||||||
|
minDeterminant 0.001;
|
||||||
|
|
||||||
|
//- minFaceWeight (0 -> 0.5)
|
||||||
|
minFaceWeight 0.05;
|
||||||
|
|
||||||
|
//- minVolRatio (0 -> 1)
|
||||||
|
minVolRatio 0.01;
|
||||||
|
|
||||||
|
//must be >0 for Fluent compatibility
|
||||||
|
minTriangleTwist -1;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
//- Number of error distribution iterations
|
||||||
|
nSmoothScale 4;
|
||||||
|
//- amount to scale back displacement at error points
|
||||||
|
errorReduction 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
// Flags for optional output
|
||||||
|
// 0 : only write final meshes
|
||||||
|
// 1 : write intermediate meshes
|
||||||
|
// 2 : write volScalarField with cellLevel for postprocessing
|
||||||
|
// 4 : write current intersections as .obj files
|
||||||
|
debug 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
|
||||||
|
// Note: the write tolerance needs to be higher than this.
|
||||||
|
mergeTolerance 1E-6;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
52
tutorials/snappyHexMesh/motorBike/constant/dynamicMeshDict
Normal file
52
tutorials/snappyHexMesh/motorBike/constant/dynamicMeshDict
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
// The FOAM Project // File: motionProperties
|
||||||
|
/*
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
========= | dictionary
|
||||||
|
\\ / |
|
||||||
|
\\ / | Name: motionProperties
|
||||||
|
\\ / | Family: FoamX configuration file
|
||||||
|
\\/ |
|
||||||
|
F ield | FOAM version: 2.1
|
||||||
|
O peration | Product of Nabla Ltd.
|
||||||
|
A and |
|
||||||
|
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
// FoamX Case Dictionary.
|
||||||
|
|
||||||
|
version 1.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/warhol/chris/foam/chris2.1/run/Test";
|
||||||
|
case "movingCone";
|
||||||
|
instance "constant";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
form dictionary;
|
||||||
|
object motionProperties;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
//motionSolverLibs ("libfvMotionSolvers.so");
|
||||||
|
solver laplacian;
|
||||||
|
//solver componentLaplacian x;
|
||||||
|
|
||||||
|
twoDMotion no;
|
||||||
|
|
||||||
|
diffusivity uniform;
|
||||||
|
|
||||||
|
//motionPlaneNormal (0 0 1);
|
||||||
|
//
|
||||||
|
//movingSurface yes;
|
||||||
|
//
|
||||||
|
//twoFluids no;
|
||||||
|
//
|
||||||
|
//normalMotionDir no;
|
||||||
|
//
|
||||||
|
//motionURF 1.0;
|
||||||
|
//
|
||||||
|
//boundaryCorrection yes;
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
|
convertToMeters 1;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
(-20.29 -10 -4.232e-05)
|
||||||
|
( 41.71 -10 -4.232e-05)
|
||||||
|
( 41.71 10 -4.232e-05)
|
||||||
|
(-20.29 10 -4.232e-05)
|
||||||
|
(-20.29 -10 20)
|
||||||
|
( 41.71 -10 20)
|
||||||
|
( 41.71 10 20)
|
||||||
|
(-20.29 10 20)
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 2 3 4 5 6 7) (60 20 20) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
patches
|
||||||
|
(
|
||||||
|
patch maxY
|
||||||
|
(
|
||||||
|
(3 7 6 2)
|
||||||
|
)
|
||||||
|
patch minX
|
||||||
|
(
|
||||||
|
(0 4 7 3)
|
||||||
|
)
|
||||||
|
patch maxX
|
||||||
|
(
|
||||||
|
(2 6 5 1)
|
||||||
|
)
|
||||||
|
patch minY
|
||||||
|
(
|
||||||
|
(1 5 4 0)
|
||||||
|
)
|
||||||
|
patch minZ
|
||||||
|
(
|
||||||
|
(0 3 2 1)
|
||||||
|
)
|
||||||
|
patch maxZ
|
||||||
|
(
|
||||||
|
(4 5 6 7)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,28 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object transportProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
2321705
tutorials/snappyHexMesh/motorBike/constant/triSurface/motorBike.stl
Normal file
2321705
tutorials/snappyHexMesh/motorBike/constant/triSurface/motorBike.stl
Normal file
File diff suppressed because it is too large
Load Diff
57
tutorials/snappyHexMesh/motorBike/system/controlDict
Normal file
57
tutorials/snappyHexMesh/motorBike/system/controlDict
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application icoFoam;
|
||||||
|
|
||||||
|
startFrom latestTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 100;
|
||||||
|
|
||||||
|
deltaT 1;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 1;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
//writeFormat binary;
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 7;
|
||||||
|
|
||||||
|
writeCompression uncompressed;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
runTimeModifiable yes;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
66
tutorials/snappyHexMesh/motorBike/system/decomposeParDict
Normal file
66
tutorials/snappyHexMesh/motorBike/system/decomposeParDict
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// The FOAM Project // File: decomposeParDict
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
========= | dictionary
|
||||||
|
\\ / |
|
||||||
|
\\ / | Name: decomposeParDict
|
||||||
|
\\ / | Family: FoamX configuration file
|
||||||
|
\\/ |
|
||||||
|
F ield | FOAM version: 2.1
|
||||||
|
O peration | Product of Nabla Ltd.
|
||||||
|
A and |
|
||||||
|
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
// FoamX Case Dictionary.
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||||
|
case "cavity";
|
||||||
|
instance "system";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
|
||||||
|
|
||||||
|
numberOfSubdomains 6;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
//method metis;
|
||||||
|
//method parMetis;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (4 1 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (3 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "cellDecomposition";
|
||||||
|
}
|
||||||
|
|
||||||
|
metisCoeffs
|
||||||
|
{
|
||||||
|
//n (5 1 1);
|
||||||
|
//cellWeightsFile "constant/cellWeightsFile";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
71
tutorials/snappyHexMesh/motorBike/system/fvSchemes
Normal file
71
tutorials/snappyHexMesh/motorBike/system/fvSchemes
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
grad(p) Gauss linear;
|
||||||
|
|
||||||
|
//snGradCorr(cellMotionU) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
div(phi,U) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
laplacian(nu,U) Gauss linear corrected;
|
||||||
|
laplacian(1|A(U),p) Gauss linear corrected;
|
||||||
|
|
||||||
|
laplacian(diffusivity,cellMotionU) Gauss linear uncorrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
interpolate(HbyA) linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
fluxRequired
|
||||||
|
{
|
||||||
|
default no;
|
||||||
|
p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
45
tutorials/snappyHexMesh/motorBike/system/fvSolution
Normal file
45
tutorials/snappyHexMesh/motorBike/system/fvSolution
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "";
|
||||||
|
case "";
|
||||||
|
instance "";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
//p ICCG 1e-06 0;
|
||||||
|
p AMG 1e-06 0 10;
|
||||||
|
U BICCG 1e-05 0;
|
||||||
|
|
||||||
|
// Meshmotion
|
||||||
|
cellMotionU ICCG 1e-6 0.0;
|
||||||
|
cellMotionUx ICCG 1e-6 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
PISO
|
||||||
|
{
|
||||||
|
nCorrectors 2;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pRefCell 0;
|
||||||
|
pRefValue 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
585
tutorials/snappyHexMesh/motorBike/system/snappyHexMeshDict
Normal file
585
tutorials/snappyHexMesh/motorBike/system/snappyHexMeshDict
Normal file
@ -0,0 +1,585 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: 1.0 |
|
||||||
|
| \\ / A nd | Web: http://www.openfoam.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
|
||||||
|
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||||
|
case "cavity";
|
||||||
|
instance "system";
|
||||||
|
local "";
|
||||||
|
|
||||||
|
class dictionary;
|
||||||
|
object autoHexMeshDict;
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Which of the steps to run
|
||||||
|
castellatedMesh true;
|
||||||
|
snap true;
|
||||||
|
addLayers true;
|
||||||
|
|
||||||
|
|
||||||
|
// Geometry. Definition of all surfaces. All surfaces are of class
|
||||||
|
// searchableSurface.
|
||||||
|
// Surfaces are used
|
||||||
|
// - to specify refinement for any mesh cell intersecting it
|
||||||
|
// - to specify refinement for any mesh cell inside/outside/near
|
||||||
|
// - to 'snap' the mesh boundary to the surface
|
||||||
|
geometry
|
||||||
|
{
|
||||||
|
motorBike.stl
|
||||||
|
{
|
||||||
|
type triSurfaceMesh;
|
||||||
|
name motorBike;
|
||||||
|
}
|
||||||
|
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
type searchableBox;
|
||||||
|
min (-0.3 -0.4 -0.1);
|
||||||
|
max ( 3.0 0.4 1.4);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the castellatedMesh generation.
|
||||||
|
castellatedMeshControls
|
||||||
|
{
|
||||||
|
|
||||||
|
// Refinement parameters
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// While refining maximum number of cells per processor. This is basically
|
||||||
|
// the number of cells that fit on a processor. If you choose this too small
|
||||||
|
// it will do just more refinement iterations to obtain a similar mesh.
|
||||||
|
maxLocalCells 1000000;
|
||||||
|
|
||||||
|
// Overall cell limit (approximately). Refinement will stop immediately
|
||||||
|
// upon reaching this number so a refinement level might not complete.
|
||||||
|
// Note that this is the number of cells before removing the part which
|
||||||
|
// is not 'visible' from the keepPoint. The final number of cells might
|
||||||
|
// actually be a lot less.
|
||||||
|
maxGlobalCells 2000000;
|
||||||
|
|
||||||
|
// The surface refinement loop might spend lots of iterations refining just a
|
||||||
|
// few cells. This setting will cause refinement to stop if <= minimumRefine
|
||||||
|
// are selected for refinement. Note: it will at least do one iteration
|
||||||
|
// (unless the number of cells to refine is 0)
|
||||||
|
minRefinementCells 10;
|
||||||
|
|
||||||
|
// Number of buffer layers between different levels.
|
||||||
|
// 1 means normal 2:1 refinement restriction, larger means slower
|
||||||
|
// refinement.
|
||||||
|
nCellsBetweenLevels 2;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Explicit feature edge refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies a level for any cell intersected by its edges.
|
||||||
|
// This is a featureEdgeMesh, read from constant/triSurface for now.
|
||||||
|
features
|
||||||
|
(
|
||||||
|
//{
|
||||||
|
// file "someLine.eMesh";
|
||||||
|
// level 2;
|
||||||
|
//}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Surface based refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies two levels for every surface. The first is the minimum level,
|
||||||
|
// every cell intersecting a surface gets refined up to the minimum level.
|
||||||
|
// The second level is the maximum level. Cells that 'see' multiple
|
||||||
|
// intersections where the intersections make an
|
||||||
|
// angle > resolveFeatureAngle get refined up to the maximum level.
|
||||||
|
|
||||||
|
refinementSurfaces
|
||||||
|
{
|
||||||
|
motorBike
|
||||||
|
{
|
||||||
|
// Surface-wise min and max refinement level
|
||||||
|
level (5 6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Resolve sharp angles
|
||||||
|
resolveFeatureAngle 30;
|
||||||
|
|
||||||
|
|
||||||
|
// Region-wise refinement
|
||||||
|
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// Specifies refinement level for cells in relation to a surface. One of
|
||||||
|
// three modes
|
||||||
|
// - distance. 'levels' specifies per distance to the surface the
|
||||||
|
// wanted refinement level. The distances need to be specified in
|
||||||
|
// descending order.
|
||||||
|
// - inside. 'levels' is only one entry and only the level is used. All
|
||||||
|
// cells inside the surface get refined up to the level. The surface
|
||||||
|
// needs to be closed for this to be possible.
|
||||||
|
// - outside. Same but cells outside.
|
||||||
|
|
||||||
|
refinementRegions
|
||||||
|
{
|
||||||
|
refinementBox
|
||||||
|
{
|
||||||
|
mode inside;
|
||||||
|
levels ((1E15 4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Mesh selection
|
||||||
|
// ~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
// After refinement patches get added for all refinementSurfaces and
|
||||||
|
// all cells intersecting the surfaces get put into these patches. The
|
||||||
|
// section reachable from the locationInMesh is kept.
|
||||||
|
// NOTE: This point should never be on a face, always inside a cell, even
|
||||||
|
// after refinement.
|
||||||
|
locationInMesh (3 3 0.43);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the snapping.
|
||||||
|
snapControls
|
||||||
|
{
|
||||||
|
//- Number of patch smoothing iterations before finding correspondence
|
||||||
|
// to surface
|
||||||
|
nSmoothPatch 3;
|
||||||
|
|
||||||
|
//- Relative distance for points to be attracted by surface feature point
|
||||||
|
// or edge. True distance is this factor times local
|
||||||
|
// maximum edge length.
|
||||||
|
tolerance 4.0;
|
||||||
|
|
||||||
|
//- Number of mesh displacement relaxation iterations.
|
||||||
|
nSolveIter 30;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Settings for the layer addition.
|
||||||
|
addLayersControls
|
||||||
|
{
|
||||||
|
// Per final patch (so not geometry!) the layer information
|
||||||
|
layers
|
||||||
|
{
|
||||||
|
minZ
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frt-fairing:001%1
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_windshield:002%2
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-rim:005%5
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-rim:010%10
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-rim:011%11
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-brake-disk:012%12
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frame:016-shadow%13
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-susp:014%14
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-susp:014-shadow%15
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frame:016%16
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-rim:005-shadow%17
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-chain-hub:022%22
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rearseat%24
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frt-fairing%25
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_windshield%26
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_headlights%27
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_driversseat%28
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-body%29
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fuel-tank%30
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_exhaust%31
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-rim%32
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-mud-guard%33
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-rim%34
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-brake-disk%35
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-brake-caliper%36
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-tyre%37
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_hbars%38
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-forks%39
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_chain%40
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-tyre%41
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_square-dial%42
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_round-dial%43
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_dial-holder%44
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-susp%45
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-brake-lights%46
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-light-bracket%47
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frame%48
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-mud-guard%49
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-susp-spring-damp%50
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fairing-inner-plate%51
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_clutch-housing%52
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_radiator%53
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_water-pipe%54
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_water-pump%55
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_engine%56
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-shock-link%57
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-brake-fluid-pot-bracket%58
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-brake-fluid-pot%59
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_footpeg%60
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-chain-hub%61
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-brake-caliper%62
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rider-helmet%65
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rider-visor%66
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rider-boots%67
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rider-gloves%68
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rider-body%69
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frame:0%70
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_frt-fairing:001-shadow%74
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_windshield-shadow%75
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-mud-guard-shadow%81
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_fr-wh-brake-disk-shadow%83
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-mud-guard-shadow%84
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-susp-spring-damp-shadow%85
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_radiator-shadow%86
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-shock-link-shadow%87
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rear-brake-fluid-pot-bracket-shadow%88
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
motorBike_rr-wh-chain-hub-shadow%89
|
||||||
|
{
|
||||||
|
nSurfaceLayers 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Expansion factor for layer mesh
|
||||||
|
expansionRatio 1.0;
|
||||||
|
|
||||||
|
//- Wanted thickness of final added cell layer. If multiple layers
|
||||||
|
// is the
|
||||||
|
// thickness of the layer furthest away from the wall.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
finalLayerRatio 0.3;
|
||||||
|
|
||||||
|
//- Minimum thickness of cell layer. If for any reason layer
|
||||||
|
// cannot be above minThickness do not add layer.
|
||||||
|
// Relative to undistorted size of cell outside layer.
|
||||||
|
minThickness 0.1;
|
||||||
|
|
||||||
|
//- If points get not extruded do nGrow layers of connected faces that are
|
||||||
|
// also not grown. This helps convergence of the layer addition process
|
||||||
|
// close to features.
|
||||||
|
nGrow 1;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced settings
|
||||||
|
|
||||||
|
//- When not to extrude surface. 0 is flat surface, 90 is when two faces
|
||||||
|
// make straight angle.
|
||||||
|
featureAngle 30;
|
||||||
|
|
||||||
|
//- Maximum number of snapping relaxation iterations. Should stop
|
||||||
|
// before upon reaching a correct mesh.
|
||||||
|
nRelaxIter 3;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of surface normals
|
||||||
|
nSmoothSurfaceNormals 1;
|
||||||
|
|
||||||
|
// Number of smoothing iterations of interior mesh movement direction
|
||||||
|
nSmoothNormals 3;
|
||||||
|
|
||||||
|
// Smooth layer thickness over surface patches
|
||||||
|
nSmoothThickness 10;
|
||||||
|
|
||||||
|
// Stop layer growth on highly warped cells
|
||||||
|
maxFaceThicknessRatio 0.5;
|
||||||
|
|
||||||
|
// Reduce layer growth where ratio thickness to medial
|
||||||
|
// distance is large
|
||||||
|
maxThicknessToMedialRatio 0.3;
|
||||||
|
|
||||||
|
// Angle used to pick up medial axis points
|
||||||
|
minMedianAxisAngle 130;
|
||||||
|
|
||||||
|
// Create buffer region for new layer terminations
|
||||||
|
nBufferCellsNoExtrude 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Generic mesh quality settings. At any undoable phase these determine
|
||||||
|
// where to undo.
|
||||||
|
meshQualityControls
|
||||||
|
{
|
||||||
|
//- Maximum non-orthogonality allowed. Set to 180 to disable.
|
||||||
|
maxNonOrtho 65;
|
||||||
|
|
||||||
|
//- Max skewness allowed. Set to <0 to disable.
|
||||||
|
maxBoundarySkewness 20;
|
||||||
|
maxInternalSkewness 4;
|
||||||
|
|
||||||
|
//- Max concaveness allowed. Is angle (in degrees) below which concavity
|
||||||
|
// is allowed. 0 is straight face, <0 would be convex face.
|
||||||
|
// Set to 180 to disable.
|
||||||
|
maxConcave 80;
|
||||||
|
|
||||||
|
//- Minimum projected area v.s. actual area. Set to -1 to disable.
|
||||||
|
minFlatness 0.5;
|
||||||
|
|
||||||
|
//- Minimum pyramid volume. Is absolute volume of cell pyramid.
|
||||||
|
// Set to very negative number (e.g. -1E30) to disable.
|
||||||
|
minVol 1e-13;
|
||||||
|
|
||||||
|
//- Minimum face area. Set to <0 to disable.
|
||||||
|
minArea -1;
|
||||||
|
|
||||||
|
//- Minimum face twist. Set to <-1 to disable. dot product of face normal
|
||||||
|
//- and face centre triangles normal
|
||||||
|
minTwist 0.02;
|
||||||
|
|
||||||
|
//- minimum normalised cell determinant
|
||||||
|
//- 1 = hex, <= 0 = folded or flattened illegal cell
|
||||||
|
minDeterminant 0.001;
|
||||||
|
|
||||||
|
//- minFaceWeight (0 -> 0.5)
|
||||||
|
minFaceWeight 0.02;
|
||||||
|
|
||||||
|
//- minVolRatio (0 -> 1)
|
||||||
|
minVolRatio 0.01;
|
||||||
|
|
||||||
|
//must be >0 for Fluent compatibility
|
||||||
|
minTriangleTwist -1;
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
//- Number of error distribution iterations
|
||||||
|
nSmoothScale 4;
|
||||||
|
//- amount to scale back displacement at error points
|
||||||
|
errorReduction 0.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Advanced
|
||||||
|
|
||||||
|
// Flags for optional output
|
||||||
|
// 0 : only write final meshes
|
||||||
|
// 1 : write intermediate meshes
|
||||||
|
// 2 : write volScalarField with cellLevel for postprocessing
|
||||||
|
// 4 : write current intersections as .obj files
|
||||||
|
debug 0;
|
||||||
|
|
||||||
|
|
||||||
|
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
|
||||||
|
// Note: the write tolerance needs to be higher than this.
|
||||||
|
mergeTolerance 1E-6;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user