Merge commit 'bundle/home' into olesenm

This commit is contained in:
Mark Olesen
2009-02-06 08:34:43 +01:00
58 changed files with 685 additions and 429 deletions

View File

@ -59,6 +59,7 @@ Note
#include "triSurface.H"
#include "surfMesh.H"
#include "surfFields.H"
#include "surfPointFields.H"
#include "PackedBoolList.H"
#include "MeshedSurfaces.H"
@ -312,6 +313,30 @@ int main(int argc, char *argv[])
Info<< "write zoneIds (for testing only): "
<< zoneIds.objectPath() << endl;
zoneIds.write();
surfPointLabelField pointIds
(
IOobject
(
"pointIds",
surfOut.instance(),
"pointFields",
surfOut,
IOobject::NO_READ,
IOobject::NO_WRITE
),
surfOut,
dimless
);
forAll(pointIds, i)
{
pointIds[i] = i;
}
Info<< "write pointIds (for testing only): "
<< pointIds.objectPath() << endl;
pointIds.write();
}
}

View File

@ -322,7 +322,7 @@ Foam::Istream* Foam::IOobject::objectStream()
{
fileName fName = filePath();
if (fName != fileName::null)
if (fName.size())
{
IFstream* isPtr = new IFstream(fName);

View File

@ -29,14 +29,10 @@ License
#include "Time.H"
#include "PstreamReduceOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Istream& regIOobject::readStream()
Foam::Istream& Foam::regIOobject::readStream()
{
if (IFstream::debug)
{
@ -48,7 +44,7 @@ Istream& regIOobject::readStream()
if (readOpt() == NO_READ)
{
FatalErrorIn("regIOobject::readStream(const word&)")
FatalErrorIn("regIOobject::readStream()")
<< "NO_READ specified for read-constructor of object " << name()
<< " of class " << headerClassName()
<< abort(FatalError);
@ -61,7 +57,7 @@ Istream& regIOobject::readStream()
{
FatalIOError
(
"regIOobject::readStream(const word&)",
"regIOobject::readStream()",
__FILE__,
__LINE__,
objectPath(),
@ -71,7 +67,7 @@ Istream& regIOobject::readStream()
}
else if (!readHeader(*isPtr_))
{
FatalIOErrorIn("regIOobject::readStream(const word&)", *isPtr_)
FatalIOErrorIn("regIOobject::readStream()", *isPtr_)
<< "problem while reading header for object " << name()
<< exit(FatalIOError);
}
@ -86,7 +82,7 @@ Istream& regIOobject::readStream()
}
Istream& regIOobject::readStream(const word& aType)
Foam::Istream& Foam::regIOobject::readStream(const word& expectName)
{
if (IFstream::debug)
{
@ -106,14 +102,14 @@ Istream& regIOobject::readStream(const word& aType)
// instantiated is a dictionary
if
(
aType != word::null
&& headerClassName() != aType
expectName.size()
&& headerClassName() != expectName
&& headerClassName() != "dictionary"
)
{
FatalIOErrorIn("regIOobject::readStream(const word&)", *isPtr_)
<< "unexpected class name " << headerClassName()
<< " expected " << aType << endl
<< " expected " << expectName << endl
<< " while reading object " << name()
<< exit(FatalIOError);
}
@ -123,7 +119,7 @@ Istream& regIOobject::readStream(const word& aType)
}
void regIOobject::close()
void Foam::regIOobject::close()
{
if (IFstream::debug)
{
@ -140,13 +136,13 @@ void regIOobject::close()
}
bool regIOobject::readData(Istream&)
bool Foam::regIOobject::readData(Istream&)
{
return false;
}
bool regIOobject::read()
bool Foam::regIOobject::read()
{
bool ok = readData(readStream(type()));
close();
@ -154,7 +150,7 @@ bool regIOobject::read()
}
bool regIOobject::modified() const
bool Foam::regIOobject::modified() const
{
return
(
@ -164,7 +160,7 @@ bool regIOobject::modified() const
}
bool regIOobject::readIfModified()
bool Foam::regIOobject::readIfModified()
{
if (lastModified_)
{
@ -213,8 +209,4 @@ bool regIOobject::readIfModified()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -105,7 +105,7 @@ void pointPatchField<Type>::write(Ostream& os) const
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
if (patchType_ != word::null)
if (patchType_.size())
{
os.writeKeyword("patchType") << patchType_
<< token::END_STATEMENT << nl;

View File

@ -37,7 +37,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(name),
boundaryIndex_(index),
index_(index),
physicalType_(physicalType)
{}
@ -50,7 +50,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(name),
boundaryIndex_(index)
index_(index)
{
dict.readIfPresent("physicalType", physicalType_);
}
@ -63,7 +63,7 @@ Foam::patchIdentifier::patchIdentifier
)
:
name_(p.name_),
boundaryIndex_(index),
index_(index),
physicalType_(p.physicalType_)
{}

View File

@ -64,7 +64,7 @@ class patchIdentifier
word name_;
//- Index of patch in boundary
label boundaryIndex_;
label index_;
//- Optional physical type
mutable word physicalType_;
@ -86,14 +86,14 @@ public:
patchIdentifier
(
const word& name,
const dictionary& dict,
const dictionary&,
const label index
);
//- Construct from geometric patch, resetting the index
patchIdentifier
(
const patchIdentifier& p,
const patchIdentifier&,
const label index
);
@ -132,13 +132,13 @@ public:
//- Return the index of this patch in the boundaryMesh
label index() const
{
return boundaryIndex_;
return index_;
}
//- Return the index of this patch in the boundaryMesh for modification
label& index()
{
return boundaryIndex_;
return index_;
}
//- Write patchIdentifier as a dictionary

View File

@ -25,35 +25,28 @@ License
\*---------------------------------------------------------------------------*/
#include "globalPointPatch.H"
#include "globalMeshData.H"
#include "triFace.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(globalPointPatch, 0);
defineTypeNameAndDebug(Foam::globalPointPatch, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
globalPointPatch::globalPointPatch
Foam::globalPointPatch::globalPointPatch
(
const pointBoundaryMesh& bm,
const label bi
const label index
)
:
pointPatch(bm),
coupledPointPatch(bm),
boundaryIndex_(bi)
index_(index)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
globalPointPatch::~globalPointPatch()
Foam::globalPointPatch::~globalPointPatch()
{}
@ -62,6 +55,4 @@ globalPointPatch::~globalPointPatch()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -61,7 +61,7 @@ class globalPointPatch
// const globalMeshData& globalMeshData_;
//- Index in the boundary mesh
label boundaryIndex_;
label index_;
// Protected Member Functions
@ -113,7 +113,7 @@ public:
//- Construct from components
globalPointPatch
(
const pointBoundaryMesh& bm,
const pointBoundaryMesh&,
const label index
);
@ -161,7 +161,7 @@ public:
//- Return the index of this patch in the pointBoundaryMesh
virtual label index() const
{
return boundaryIndex_;
return index_;
}
//- Return mesh points

View File

@ -236,7 +236,7 @@ void Foam::fvPatchField<Type>::write(Ostream& os) const
{
os.writeKeyword("type") << type() << token::END_STATEMENT << nl;
if (patchType_ != word::null)
if (patchType_.size())
{
os.writeKeyword("patchType") << patchType_
<< token::END_STATEMENT << nl;

View File

@ -50,7 +50,7 @@ const Foam::fileName& Foam::triSurfaceMesh::checkFile
const fileName& objectName
)
{
if (fName == fileName::null)
if (fName.empty())
{
FatalErrorIn
(

View File

@ -8,6 +8,7 @@ UnsortedMeshedSurface/UnsortedMeshedSurfaces.C
surfaceRegistry/surfaceRegistry.C
surfFields/surfFields.C
surfPointFields/surfPointFields.C
surfMesh/surfMesh.C
surfMesh/surfMeshClear.C
surfMesh/surfMeshIO.C

View File

@ -51,30 +51,6 @@ const word surfSymmTensorField::typeName("surfSymmTensorField");
template<>
const word surfTensorField::typeName("surfTensorField");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
tmp<DimensionedField<scalar, surfMesh> >
DimensionedField<scalar, surfMesh>::component
(
const direction
) const
{
return *this;
}
template<>
void DimensionedField<scalar, surfMesh>::replace
(
const direction,
const DimensionedField<scalar, surfMesh>& sf
)
{
*this == sf;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam

View File

@ -42,32 +42,6 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<>
tmp<DimensionedField<scalar, surfMesh> >
DimensionedField<scalar, surfMesh>::component
(
const direction
) const;
template<>
void DimensionedField<scalar, surfMesh>::replace
(
const direction,
const DimensionedField<scalar, surfMesh>& sf
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -27,14 +27,15 @@ Class
Description
The surfMesh GeoMesh (for holding fields).
Similar to a volGeoMesh needed to do the Finite Volume discretisation.
Similar to the volGeoMesh used for the Finite Volume discretization.
\*---------------------------------------------------------------------------*/
#ifndef surfGeoMesh_H
#define surfGeoMesh_H
#include "SurfGeoMesh.H"
#include "GeoMesh.H"
#include "surfMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,7 +49,7 @@ namespace Foam
class surfGeoMesh
:
public SurfGeoMesh<surfMesh>
public GeoMesh<surfMesh>
{
public:
@ -58,7 +59,7 @@ public:
//- Construct from surfMesh reference
explicit surfGeoMesh(const surfMesh& mesh)
:
SurfGeoMesh<surfMesh>(mesh)
GeoMesh<surfMesh>(mesh)
{}

View File

@ -188,6 +188,9 @@ public:
typedef surfMesh Mesh;
//- Placeholder only, but do not remove - it is needed for GeoMesh
typedef bool BoundaryMesh;
//- Runtime type information
TypeName("surfMesh");

View File

@ -0,0 +1,58 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#include "surfPointFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
template<>
const word surfPointLabelField::typeName("surfPointLabelField");
template<>
const word surfPointScalarField::typeName("surfPointScalarField");
template<>
const word surfPointVectorField::typeName("surfPointVectorField");
template<>
const word surfPointSphericalTensorField::typeName("surfPointSphericalTensorField");
template<>
const word surfPointSymmTensorField::typeName("surfPointSymmTensorField");
template<>
const word surfPointTensorField::typeName("surfPointTensorField");
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -0,0 +1,47 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::surfPointFields
Description
Point fields for surfMesh
SourceFiles
surfPointFields.C
\*---------------------------------------------------------------------------*/
#ifndef surfPointFields_H
#define surfPointFields_H
#include "DimensionedField.H"
#include "surfPointGeoMesh.H"
#include "surfPointFieldsFwd.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
#ifndef surfPointFieldsFwd_H
#define surfPointFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class surfPointGeoMesh;
template<class Type, class GeoMesh>
class DimensionedField;
typedef DimensionedField<label, surfPointGeoMesh>
surfPointLabelField;
typedef DimensionedField<scalar, surfPointGeoMesh>
surfPointScalarField;
typedef DimensionedField<vector, surfPointGeoMesh>
surfPointVectorField;
typedef DimensionedField<sphericalTensor, surfPointGeoMesh>
surfPointSphericalTensorField;
typedef DimensionedField<symmTensor, surfPointGeoMesh>
surfPointSymmTensorField;
typedef DimensionedField<tensor, surfPointGeoMesh>
surfPointTensorField;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,20 +23,20 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Class
Foam::SurfGeoMesh
Foam::surfPointGeoMesh
Description
Generic mesh wrapper used by surfMesh etc.
The surfMesh GeoMesh (for holding fields).
Similar to Foam::GeoMesh, but for meshes without an underlying
BoundaryMesh.
Similar to surfGeoMesh, but refers to the surface points.
\*---------------------------------------------------------------------------*/
#ifndef SurfGeoMesh_H
#define SurfGeoMesh_H
#ifndef surfPointGeoMesh_H
#define surfPointGeoMesh_H
#include "objectRegistry.H"
#include "GeoMesh.H"
#include "surfMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -44,53 +44,39 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SurfGeoMesh Declaration
Class surfPointGeoMesh Declaration
\*---------------------------------------------------------------------------*/
template<class MESH>
class SurfGeoMesh
class surfPointGeoMesh
:
public GeoMesh<surfMesh>
{
protected:
// Protected data
//- Reference to Mesh
const MESH& mesh_;
public:
// Public typedefs
typedef MESH Mesh;
// typedef typename MESH::BoundaryMesh BoundaryMesh;
// Constructors
//- Construct from MESH reference
explicit SurfGeoMesh(const MESH& mesh)
//- Construct from surfMesh reference
explicit surfPointGeoMesh(const surfMesh& mesh)
:
mesh_(mesh)
GeoMesh<surfMesh>(mesh)
{}
// Member Functions
//- Return the object registry
const objectRegistry& thisDb() const
//- Return size
static label size(const surfMesh& mesh)
{
return mesh_;
return mesh.nPoints();
}
// Member Operators
//- Return reference to underlying mesh
const MESH& operator()() const
//- Return size
label size() const
{
return mesh_;
return size(mesh_);
}
};

View File

@ -282,13 +282,11 @@ template<class Face>
void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
writeHeader(os, zoneLst);
forAll(zoneLst, zoneI)
@ -336,6 +334,17 @@ void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::AC3DsurfaceFormat<Face>::write
(

View File

@ -56,7 +56,7 @@ namespace fileFormats
{
/*---------------------------------------------------------------------------*\
Class AC3DfileFormat Declaration
Class AC3DsurfaceFormat Declaration
\*---------------------------------------------------------------------------*/
template<class Face>
@ -102,6 +102,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -49,7 +49,7 @@ namespace fileFormats
{
/*---------------------------------------------------------------------------*\
Class AC3DfileFormat Declaration
Class AC3DsurfaceFormatCore Declaration
\*---------------------------------------------------------------------------*/
class AC3DsurfaceFormatCore

View File

@ -65,10 +65,10 @@ bool Foam::fileFormats::FTRsurfaceFormat<Face>::read
List<ftrPatch> ftrPatches(is);
// read points directly
// points read directly
is >> this->storedPoints();
// faces read with keys
// triFaces read with attached keys
List< Keyed<triFace> > facesRead(is);
List<Face> faceLst(facesRead.size());
@ -84,6 +84,7 @@ bool Foam::fileFormats::FTRsurfaceFormat<Face>::read
this->storedFaces().transfer(faceLst);
this->storedZoneIds().transfer(zoneIds);
facesRead.clear();
// change ftrPatch into surfZoneIdentifier
List<surfZoneIdentifier> newZones(ftrPatches.size());

View File

@ -26,7 +26,7 @@ Class
Foam::fileFormats::FTRsurfaceFormat
Description
Reading of the (now deprecated) Foam Trisurface Format.
Reading of the (now deprecated and barely used) Foam Trisurface Format.
SourceFiles
FTRsurfaceFormat.C

View File

@ -214,13 +214,12 @@ template<class Face>
void Foam::fileFormats::OBJsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
writeHeader(os, surf.points(), faceLst.size(), zoneLst);
writeHeader(os, pointLst, faceLst.size(), zoneLst);
label faceIndex = 0;
forAll(zoneLst, zoneI)
@ -245,6 +244,17 @@ void Foam::fileFormats::OBJsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::OBJsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::OBJsurfaceFormat<Face>::write
(

View File

@ -98,6 +98,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -151,6 +151,52 @@ bool Foam::fileFormats::OFFsurfaceFormat<Face>::read
}
template<class Face>
void Foam::fileFormats::OFFsurfaceFormat<Face>::write
(
Ostream& os,
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
writeHeader(os, pointLst, faceLst.size(), zoneLst);
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
os << "# <zone name=\"" << zoneLst[zoneI].name() << "\">" << endl;
forAll(zoneLst[zoneI], localFaceI)
{
const Face& f = faceLst[faceIndex++];
os << f.size();
forAll(f, fp)
{
os << ' ' << f[fp];
}
// add optional zone information
os << ' ' << zoneI << endl;
}
os << "# </zone>" << endl;
}
os << "# </faces>" << endl;
}
template<class Face>
void Foam::fileFormats::OFFsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::OFFsurfaceFormat<Face>::write
(
@ -189,39 +235,4 @@ void Foam::fileFormats::OFFsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::OFFsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
writeHeader(os, surf.points(), faceLst.size(), zoneLst);
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
os << "# <zone name=\"" << zoneLst[zoneI].name() << "\">" << endl;
forAll(zoneLst[zoneI], localFaceI)
{
const Face& f = faceLst[faceIndex++];
os << f.size();
forAll(f, fp)
{
os << ' ' << f[fp];
}
// add optional zone information
os << ' ' << zoneI << endl;
}
os << "# </zone>" << endl;
}
os << "# </faces>" << endl;
}
// ************************************************************************* //

View File

@ -104,6 +104,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -42,13 +42,12 @@ template<class Face>
void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
writeHeader(os, surf.points(), faceLst.size());
writeHeader(os, pointLst, faceLst.size());
label faceIndex = 0;
forAll(zoneLst, zoneI)
@ -70,6 +69,17 @@ void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::SMESHsurfaceFormat<Face>::write
(

View File

@ -91,6 +91,15 @@ public:
// Member Functions
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -221,18 +221,17 @@ template<class Face>
void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
(
const fileName& filename,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
fileName baseName = filename.lessExt();
writePoints(OFstream(baseName + ".vrt")(), surf.points());
writePoints(OFstream(baseName + ".vrt")(), pointLst);
OFstream os(baseName + ".cel");
writeHeader(os, "CELL");
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
@ -249,10 +248,22 @@ void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
writeCase
(
OFstream(baseName + ".inp")(),
surf.points(),
surf.size(),
pointLst,
faceLst.size(),
zoneLst
);
}
template<class Face>
void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
(
const fileName& filename,
const MeshedSurface<Face>& surf
)
{
write(filename, surf.points(), surf.faces(), surf.zones());
}
@ -266,7 +277,6 @@ void Foam::fileFormats::STARCDsurfaceFormat<Face>::write
fileName baseName = filename.lessExt();
writePoints(OFstream(baseName + ".vrt")(), surf.points());
OFstream os(baseName + ".cel");
writeHeader(os, "CELL");

View File

@ -66,6 +66,7 @@ class STARCDsurfaceFormat
public STARCDsurfaceFormatCore
{
// Private Data
//- STAR-CD identifier for shell shapes (2d elements)
static const int starcdShellShape_ = 3;
@ -116,6 +117,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components
static void write
(
const fileName&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -38,7 +38,6 @@ SourceFiles
#include "point.H"
#include "Istream.H"
#include "Ostream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -83,7 +82,7 @@ public:
// Member Operators
//- Return point
//- Conversion to point
inline operator point() const
{
return point(x(), y(), z());

View File

@ -26,6 +26,7 @@ License
#include "STLsurfaceFormat.H"
#include "ListOps.H"
#include "triPointRef.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -36,10 +37,18 @@ inline void Foam::fileFormats::STLsurfaceFormat<Face>::writeShell
(
Ostream& os,
const pointField& pointLst,
const Face& f,
const vector& norm
const Face& f
)
{
// calculate the normal ourselves, for flexibility and speed
vector norm = triPointRef
(
pointLst[f[0]],
pointLst[f[1]],
pointLst[f[2]]
).normal();
norm /= mag(norm) + VSMALL;
// simple triangulation about f[0].
// better triangulation should have been done before
const point& p0 = pointLst[f[0]];
@ -69,10 +78,18 @@ inline void Foam::fileFormats::STLsurfaceFormat<Face>::writeShell
ostream& os,
const pointField& pointLst,
const Face& f,
const vector& norm,
const label zoneI
)
{
// calculate the normal ourselves, for flexibility and speed
vector norm = triPointRef
(
pointLst[f[0]],
pointLst[f[1]],
pointLst[f[2]]
).normal();
norm /= mag(norm) + VSMALL;
// simple triangulation about f[0].
// better triangulation should have been done before
const point& p0 = pointLst[f[0]];
@ -94,96 +111,17 @@ inline void Foam::fileFormats::STLsurfaceFormat<Face>::writeShell
}
// write sorted:
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::writeASCII
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
const vectorField& normLst = surf.faceNormals();
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
// Print all faces belonging to this zone
const surfZone& zone = zoneLst[zoneI];
os << "solid " << zone.name() << endl;
forAll(zone, localFaceI)
{
const label faceI = faceIndex++;
writeShell(os, pointLst, faceLst[faceI], normLst[faceI]);
}
os << "endsolid " << zone.name() << endl;
}
}
// write sorted:
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::writeASCII
(
Ostream& os,
const UnsortedMeshedSurface<Face>& surf
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const vectorField& normLst = surf.faceNormals();
if (surf.zoneToc().size() == 1)
{
// a single zone - we can skip sorting
os << "solid " << surf.zoneToc()[0].name() << endl;
forAll(faceLst, faceI)
{
writeShell(os, pointLst, faceLst[faceI], normLst[faceI]);
}
os << "endsolid " << surf.zoneToc()[0].name() << endl;
}
else
{
labelList faceMap;
List<surfZone> zoneLst = surf.sortedZones(faceMap);
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
// Print all faces belonging to this zone
const surfZone& zone = zoneLst[zoneI];
os << "solid " << zone.name() << endl;
forAll(zone, localFaceI)
{
const label faceI = faceMap[faceIndex++];
writeShell(os, pointLst, faceLst[faceI], normLst[faceI]);
}
os << "endsolid " << zone.name() << endl;
}
}
}
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::writeBINARY
(
ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const vectorField& normLst = surf.faceNormals();
const List<surfZone>& zoneLst = surf.zones();
unsigned int nTris = 0;
if (surf.isTri())
if (BasicMeshedSurface<Face>::isTri())
{
nTris = faceLst.size();
}
@ -208,18 +146,14 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBINARY
(
os,
pointLst,
faceLst[faceIndex],
normLst[faceIndex],
faceLst[faceIndex++],
zoneI
);
++faceIndex;
}
}
}
// write unsorted:
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::writeBINARY
(
@ -230,7 +164,6 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBINARY
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<label>& zoneIds = surf.zoneIds();
const vectorField& normLst = surf.faceNormals();
unsigned int nTris = 0;
if (surf.isTri())
@ -257,7 +190,6 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::writeBINARY
os,
pointLst,
faceLst[faceI],
normLst[faceI],
zoneIds[faceI]
);
}
@ -346,10 +278,24 @@ template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::write
(
Ostream& os,
const UnsortedMeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
writeASCII(os, surf);
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
// Print all faces belonging to this zone
const surfZone& zone = zoneLst[zoneI];
os << "solid " << zone.name() << endl;
forAll(zone, localFaceI)
{
writeShell(os, pointLst, faceLst[faceIndex++]);
}
os << "endsolid " << zone.name() << endl;
}
}
@ -360,28 +306,49 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::write
const MeshedSurface<Face>& surf
)
{
writeASCII(os, surf);
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::write
(
const fileName& filename,
Ostream& os,
const UnsortedMeshedSurface<Face>& surf
)
{
word ext = filename.ext();
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
// handle 'stlb' as binary directly
if (ext == "stlb")
if (surf.zoneToc().size() == 1)
{
std::ofstream ofs(filename.c_str(), std::ios::binary);
writeBINARY(ofs, surf);
// a single zone - we can skip sorting
os << "solid " << surf.zoneToc()[0].name() << endl;
forAll(faceLst, faceI)
{
writeShell(os, pointLst, faceLst[faceI]);
}
os << "endsolid " << surf.zoneToc()[0].name() << endl;
}
else
{
writeASCII(OFstream(filename)(), surf);
labelList faceMap;
List<surfZone> zoneLst = surf.sortedZones(faceMap);
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
// Print all faces belonging to this zone
const surfZone& zone = zoneLst[zoneI];
os << "solid " << zone.name() << endl;
forAll(zone, localFaceI)
{
const label faceI = faceMap[faceIndex++];
writeShell(os, pointLst, faceLst[faceI]);
}
os << "endsolid " << zone.name() << endl;
}
}
}
@ -403,8 +370,37 @@ void Foam::fileFormats::STLsurfaceFormat<Face>::write
}
else
{
writeASCII(OFstream(filename)(), surf);
write
(
OFstream(filename)(),
surf.points(),
surf.faces(),
surf.zones()
);
}
}
template<class Face>
void Foam::fileFormats::STLsurfaceFormat<Face>::write
(
const fileName& filename,
const UnsortedMeshedSurface<Face>& surf
)
{
word ext = filename.ext();
// handle 'stlb' as binary directly
if (ext == "stlb")
{
std::ofstream ofs(filename.c_str(), std::ios::binary);
writeBINARY(ofs, surf);
}
else
{
write(OFstream(filename)(), surf);
}
}
// ************************************************************************* //

View File

@ -68,8 +68,7 @@ class STLsurfaceFormat
(
Ostream&,
const pointField&,
const Face&,
const vector& norm
const Face&
);
//- Write Face in BINARY
@ -78,24 +77,22 @@ class STLsurfaceFormat
ostream&,
const pointField&,
const Face&,
const vector&,
const label zoneI
);
//- Write UnsortedMeshedSurface
static void writeASCII(Ostream&, const UnsortedMeshedSurface<Face>&);
//- Write surface mesh components (as BINARY)
static void writeBINARY
(
ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write UnsortedMeshedSurface
static void writeBINARY(ostream&, const UnsortedMeshedSurface<Face>&);
//- Write MeshedSurface
static void writeASCII(Ostream&, const MeshedSurface<Face>&);
//- Write MeshedSurface
static void writeBINARY(ostream&, const MeshedSurface<Face>&);
//- Disallow default bitwise copy construct
STLsurfaceFormat(const STLsurfaceFormat<Face>&);
@ -128,6 +125,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components (as ASCII)
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface (as ASCII)
static void write
(
@ -135,7 +141,7 @@ public:
const MeshedSurface<Face>&
);
//- Write MeshedSurface
//- Write MeshedSurface (ASCII or BINARY, depending on the extension)
static void write
(
const fileName&,

View File

@ -56,8 +56,13 @@ class STLtriangle
//- Attribute is 16-bit
typedef unsigned short STLattrib;
STLpoint normal_, a_, b_, c_;
//- The face normal, many programs write zore or other junk
STLpoint normal_;
//- The three points defining the triangle
STLpoint a_, b_, c_;
//- The attribute information could for colour or solid id, etc
STLattrib attrib_;
public:

View File

@ -132,13 +132,11 @@ template<class Face>
void Foam::fileFormats::TRIsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const pointField& pointLst = surf.points();
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
label faceIndex = 0;
forAll(zoneLst, zoneI)
{
@ -151,6 +149,17 @@ void Foam::fileFormats::TRIsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::TRIsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::TRIsurfaceFormat<Face>::write
(

View File

@ -105,6 +105,15 @@ public:
//- Read from file
virtual bool read(const fileName&);
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -62,13 +62,12 @@ template<class Face>
void Foam::fileFormats::VTKsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
const pointField& pointLst,
const List<Face>& faceLst,
const List<surfZone>& zoneLst
)
{
const List<Face>& faceLst = surf.faces();
const List<surfZone>& zoneLst = surf.zones();
writeHeader(os, surf.points());
writeHeader(os, pointLst);
writeHeaderPolygons(os, faceLst);
label faceIndex = 0;
@ -91,6 +90,17 @@ void Foam::fileFormats::VTKsurfaceFormat<Face>::write
}
template<class Face>
void Foam::fileFormats::VTKsurfaceFormat<Face>::write
(
Ostream& os,
const MeshedSurface<Face>& surf
)
{
write(os, surf.points(), surf.faces(), surf.zones());
}
template<class Face>
void Foam::fileFormats::VTKsurfaceFormat<Face>::write
(

View File

@ -89,6 +89,15 @@ public:
// Write
//- Write surface mesh components
static void write
(
Ostream&,
const pointField&,
const List<Face>&,
const List<surfZone>&
);
//- Write MeshedSurface
static void write
(

View File

@ -797,7 +797,7 @@ void Foam::chemkinReader::read
const fileName& thermoFileName
)
{
if (thermoFileName != fileName::null)
if (thermoFileName.size())
{
std::ifstream thermoStream(thermoFileName.c_str());

View File

@ -43,7 +43,7 @@ geometricSurfacePatch::geometricSurfacePatch()
:
geometricType_("empty"),
name_("patch"),
boundaryIndex_(0)
index_(0)
{}
@ -57,7 +57,7 @@ geometricSurfacePatch::geometricSurfacePatch
:
geometricType_(geometricType),
name_(name),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
@ -72,7 +72,7 @@ geometricSurfacePatch::geometricSurfacePatch(Istream& is, const label index)
:
geometricType_(is),
name_(is),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
{
@ -91,7 +91,7 @@ geometricSurfacePatch::geometricSurfacePatch
:
geometricType_(dict.lookup("geometricType")),
name_(name),
boundaryIndex_(index)
index_(index)
{
if (geometricType_.empty())
{

View File

@ -63,7 +63,7 @@ class geometricSurfacePatch
word name_;
//- Index of patch in boundary
label boundaryIndex_;
label index_;
public:
@ -125,7 +125,7 @@ public:
//- Return the index of this patch in the boundaryMesh
label index() const
{
return boundaryIndex_;
return index_;
}
//- Write

View File

@ -54,7 +54,7 @@ bool triSurface::stitchTriangles
<< " points down to " << newPoints.size() << endl;
}
pointField& ps = const_cast<pointField&>(points());
pointField& ps = storedPoints();
// Set the coordinates to the merged ones
ps = newPoints;

View File

@ -471,8 +471,7 @@ Foam::boolList Foam::triSurface::checkOrientation(const bool verbose)
// Read triangles, points from Istream
bool Foam::triSurface::read(Istream& is)
{
is >> patches_ >> const_cast<pointField&>(points())
>> static_cast<List<labelledTri>&>(*this);
is >> patches_ >> storedPoints() >> storedFaces();
return true;
}
@ -724,7 +723,7 @@ void Foam::triSurface::setDefaultPatches()
Foam::triSurface::triSurface()
:
MeshStorage(List<FaceType>(), pointField()),
ParentType(List<Face>(), pointField()),
patches_(0),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -739,7 +738,7 @@ Foam::triSurface::triSurface
const pointField& points
)
:
MeshStorage(triangles, points),
ParentType(triangles, points),
patches_(patches),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -754,7 +753,7 @@ Foam::triSurface::triSurface
const bool reUse
)
:
MeshStorage(triangles, points, reUse),
ParentType(triangles, points, reUse),
patches_(patches),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -767,7 +766,7 @@ Foam::triSurface::triSurface
const pointField& points
)
:
MeshStorage(triangles, points),
ParentType(triangles, points),
patches_(),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -782,7 +781,7 @@ Foam::triSurface::triSurface
const pointField& points
)
:
MeshStorage(convertToTri(triangles, 0), points),
ParentType(convertToTri(triangles, 0), points),
patches_(),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -793,7 +792,7 @@ Foam::triSurface::triSurface
Foam::triSurface::triSurface(const fileName& name)
:
MeshStorage(List<FaceType>(), pointField()),
ParentType(List<Face>(), pointField()),
patches_(),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -808,7 +807,7 @@ Foam::triSurface::triSurface(const fileName& name)
Foam::triSurface::triSurface(Istream& is)
:
MeshStorage(List<FaceType>(), pointField()),
ParentType(List<Face>(), pointField()),
patches_(),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -821,7 +820,7 @@ Foam::triSurface::triSurface(Istream& is)
Foam::triSurface::triSurface(const Time& d)
:
MeshStorage(List<FaceType>(), pointField()),
ParentType(List<Face>(), pointField()),
patches_(),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -840,7 +839,7 @@ Foam::triSurface::triSurface(const Time& d)
Foam::triSurface::triSurface(const triSurface& ts)
:
MeshStorage(ts, ts.points()),
ParentType(ts, ts.points()),
patches_(ts.patches()),
sortedEdgeFacesPtr_(NULL),
edgeOwnerPtr_(NULL)
@ -859,7 +858,7 @@ Foam::triSurface::~triSurface()
void Foam::triSurface::clearTopology()
{
MeshStorage::clearTopology();
ParentType::clearTopology();
deleteDemandDrivenData(sortedEdgeFacesPtr_);
deleteDemandDrivenData(edgeOwnerPtr_);
}
@ -867,13 +866,13 @@ void Foam::triSurface::clearTopology()
void Foam::triSurface::clearPatchMeshAddr()
{
MeshStorage::clearPatchMeshAddr();
ParentType::clearPatchMeshAddr();
}
void Foam::triSurface::clearOut()
{
MeshStorage::clearOut();
ParentType::clearOut();
clearTopology();
clearPatchMeshAddr();
@ -909,10 +908,10 @@ void Foam::triSurface::movePoints(const pointField& newPoints)
deleteDemandDrivenData(sortedEdgeFacesPtr_);
// Adapt for new point position
MeshStorage::movePoints(newPoints);
ParentType::movePoints(newPoints);
// Copy new points
const_cast<pointField&>(points()) = newPoints;
storedPoints() = newPoints;
}
@ -926,9 +925,9 @@ void Foam::triSurface::scalePoints(const scalar& scaleFactor)
clearTopology();
// Adapt for new point position
MeshStorage::movePoints(pointField());
ParentType::movePoints(pointField());
const_cast<pointField&>(points()) *= scaleFactor;
storedPoints() *= scaleFactor;
}
}
@ -1240,7 +1239,7 @@ void Foam::triSurface::operator=(const triSurface& ts)
{
List<labelledTri>::operator=(ts);
clearOut();
const_cast<pointField&>(points()) = ts.points();
storedPoints() = ts.points();
patches_ = ts.patches();
}

View File

@ -58,27 +58,21 @@ class IFstream;
class triSurface
:
public PrimitivePatch<labelledTri, List, pointField, point>
public PrimitivePatch<labelledTri, ::Foam::List, pointField, point>
{
protected:
// Protected Member Data
//- Typedef for similar code in keyedSurface and meshedSurface
typedef labelledTri FaceType;
private:
// Private typedefs
//- Typedefs for convenience
typedef labelledTri Face;
typedef PrimitivePatch
<
FaceType,
labelledTri,
::Foam::List,
pointField,
point
>
MeshStorage;
ParentType;
// Private data
@ -201,17 +195,39 @@ private:
//- helper function to print triangle info
static void printTriangle
(
Ostream& os,
Ostream&,
const Foam::string& pre,
const labelledTri& f,
const pointField& points
const labelledTri&,
const pointField&
);
//- read non-comment line
static string getLineNoComment(IFstream&);
protected:
// Protected Member Functions
//- Non-const access to global points
pointField& storedPoints()
{
return const_cast<pointField&>(ParentType::points());
}
//- Non-const access to the faces
List<Face>& storedFaces()
{
return static_cast<List<Face>&>(*this);
}
public:
// Public typedefs
//- Placeholder only, but do not remove - it is needed for GeoMesh
typedef bool BoundaryMesh;
//- Runtime type information
ClassName("triSurface");

View File

@ -25,8 +25,6 @@ License
\*---------------------------------------------------------------------------*/
#include "triSurfaceFields.H"
#include "DimensionedField.H"
#include "triSurfaceGeoMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,13 +26,16 @@ Class
Foam::triSurfaceGeoMesh
Description
The triSurface geoMesh
The triSurface GeoMesh (for holding fields).
Similar to the volGeoMesh used for the Finite Volume discretization.
\*---------------------------------------------------------------------------*/
#ifndef triSurfaceGeoMesh_H
#define triSurfaceGeoMesh_H
#include "GeoMesh.H"
#include "triSurface.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -43,52 +46,33 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
class triSurfaceGeoMesh
:
public GeoMesh<triSurface>
{
protected:
// Protected data
//- Reference to Mesh
const triSurface& mesh_;
public:
// Public typedefs
typedef triSurface Mesh;
// Constructors
//- Construct from Mesh
//- Construct from triSurface reference
explicit triSurfaceGeoMesh(const triSurface& mesh)
:
mesh_(mesh)
GeoMesh<triSurface>(mesh)
{}
// Member Functions
//- Return size
label size() const
{
return size(mesh_);
}
//- Return size
static label size(const triSurface& mesh)
{
return mesh.size();
}
// Member Operators
//- Return reference to triSurface
const triSurface& operator()() const
//- Return size
label size() const
{
return mesh_;
return size(mesh_);
}
};