diff --git a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C index d5a21f396f..ccd85d8e5a 100644 --- a/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C +++ b/applications/utilities/surface/surfaceMeshConvertTesting/surfaceMeshConvertTesting.C @@ -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(); } } diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index dc80008633..3174e615e4 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -322,7 +322,7 @@ Foam::Istream* Foam::IOobject::objectStream() { fileName fName = filePath(); - if (fName != fileName::null) + if (fName.size()) { IFstream* isPtr = new IFstream(fName); diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C index f553589d47..6da2cac619 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C +++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C @@ -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 - // ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C index 8d9aed1546..e697ccc20b 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C @@ -105,7 +105,7 @@ void pointPatchField::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; diff --git a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C b/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C index abf4b64c71..c6ea597721 100644 --- a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C +++ b/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.C @@ -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_) {} diff --git a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H b/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H index b862dbd0ee..bea45cc2b1 100644 --- a/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H +++ b/src/OpenFOAM/meshes/patchIdentifier/patchIdentifier.H @@ -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 diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.C index 8ad3e1d95d..53ac14e268 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.C @@ -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 - // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.H index 9701381efb..990ab0de9a 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/derived/global/globalPointPatch.H @@ -47,7 +47,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class globalPointPatch Declaration + Class globalPointPatch Declaration \*---------------------------------------------------------------------------*/ class globalPointPatch @@ -57,11 +57,11 @@ class globalPointPatch { // Private data - ////- Reference to the basic globalMeshData - //const globalMeshData& globalMeshData_; + // //- Reference to the basic globalMeshData + // 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 ); @@ -129,7 +129,7 @@ public: virtual const word& name() const { // There can only be a single patch of this type - therefore - // its name is hard-coded. + // its name is hard-coded. return type(); } @@ -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 diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 637cf8037a..3dd71eae5b 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -236,7 +236,7 @@ void Foam::fvPatchField::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; diff --git a/src/meshTools/searchableSurface/triSurfaceMesh.C b/src/meshTools/searchableSurface/triSurfaceMesh.C index b5e3e0f572..7b9abc1aec 100644 --- a/src/meshTools/searchableSurface/triSurfaceMesh.C +++ b/src/meshTools/searchableSurface/triSurfaceMesh.C @@ -50,7 +50,7 @@ const Foam::fileName& Foam::triSurfaceMesh::checkFile const fileName& objectName ) { - if (fName == fileName::null) + if (fName.empty()) { FatalErrorIn ( diff --git a/src/surfMesh/Make/files b/src/surfMesh/Make/files index d46a2bec0f..2a51d95fbf 100644 --- a/src/surfMesh/Make/files +++ b/src/surfMesh/Make/files @@ -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 diff --git a/src/surfMesh/surfFields/surfFields.C b/src/surfMesh/surfFields/surfFields.C index 06100ee231..57c295c397 100644 --- a/src/surfMesh/surfFields/surfFields.C +++ b/src/surfMesh/surfFields/surfFields.C @@ -51,30 +51,6 @@ const word surfSymmTensorField::typeName("surfSymmTensorField"); template<> const word surfTensorField::typeName("surfTensorField"); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<> -tmp > -DimensionedField::component -( - const direction -) const -{ - return *this; -} - - -template<> -void DimensionedField::replace -( - const direction, - const DimensionedField& sf -) -{ - *this == sf; -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/surfMesh/surfFields/surfFields.H b/src/surfMesh/surfFields/surfFields.H index 756dc4a088..e016bbe04d 100644 --- a/src/surfMesh/surfFields/surfFields.H +++ b/src/surfMesh/surfFields/surfFields.H @@ -42,32 +42,6 @@ SourceFiles // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam -{ - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -template<> -tmp > -DimensionedField::component -( - const direction -) const; - -template<> -void DimensionedField::replace -( - const direction, - const DimensionedField& sf -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/surfMesh/surfFields/surfGeoMesh.H b/src/surfMesh/surfFields/surfGeoMesh.H index 47c06bb381..8ced148e4f 100644 --- a/src/surfMesh/surfFields/surfGeoMesh.H +++ b/src/surfMesh/surfFields/surfGeoMesh.H @@ -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 + public GeoMesh { public: @@ -58,7 +59,7 @@ public: //- Construct from surfMesh reference explicit surfGeoMesh(const surfMesh& mesh) : - SurfGeoMesh(mesh) + GeoMesh(mesh) {} diff --git a/src/surfMesh/surfMesh/surfMesh.H b/src/surfMesh/surfMesh/surfMesh.H index 98a5d171f9..b18080a6f5 100644 --- a/src/surfMesh/surfMesh/surfMesh.H +++ b/src/surfMesh/surfMesh/surfMesh.H @@ -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"); diff --git a/src/surfMesh/surfPointFields/surfPointFields.C b/src/surfMesh/surfPointFields/surfPointFields.C new file mode 100644 index 0000000000..871ecd1524 --- /dev/null +++ b/src/surfMesh/surfPointFields/surfPointFields.C @@ -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 + +// ************************************************************************* // diff --git a/src/surfMesh/surfPointFields/surfPointFields.H b/src/surfMesh/surfPointFields/surfPointFields.H new file mode 100644 index 0000000000..855cc4efca --- /dev/null +++ b/src/surfMesh/surfPointFields/surfPointFields.H @@ -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 + +// ************************************************************************* // diff --git a/src/surfMesh/surfPointFields/surfPointFieldsFwd.H b/src/surfMesh/surfPointFields/surfPointFieldsFwd.H new file mode 100644 index 0000000000..62cc746df4 --- /dev/null +++ b/src/surfMesh/surfPointFields/surfPointFieldsFwd.H @@ -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 DimensionedField; + +typedef DimensionedField + surfPointLabelField; +typedef DimensionedField + surfPointScalarField; +typedef DimensionedField + surfPointVectorField; +typedef DimensionedField + surfPointSphericalTensorField; +typedef DimensionedField + surfPointSymmTensorField; +typedef DimensionedField + surfPointTensorField; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfMesh/SurfGeoMesh/SurfGeoMesh.H b/src/surfMesh/surfPointFields/surfPointGeoMesh.H similarity index 68% rename from src/surfMesh/SurfGeoMesh/SurfGeoMesh.H rename to src/surfMesh/surfPointFields/surfPointGeoMesh.H index f4de6e9380..188b3dd6bd 100644 --- a/src/surfMesh/SurfGeoMesh/SurfGeoMesh.H +++ b/src/surfMesh/surfPointFields/surfPointGeoMesh.H @@ -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 SurfGeoMesh +class surfPointGeoMesh +: + public GeoMesh { -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(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_); } + }; diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C index b5de791846..167a98003b 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C @@ -282,13 +282,11 @@ template void Foam::fileFormats::AC3DsurfaceFormat::write ( Ostream& os, - const MeshedSurface& surf + const pointField& pointLst, + const List& faceLst, + const List& zoneLst ) { - const pointField& pointLst = surf.points(); - const List& faceLst = surf.faces(); - const List& zoneLst = surf.zones(); - writeHeader(os, zoneLst); forAll(zoneLst, zoneI) @@ -336,6 +334,17 @@ void Foam::fileFormats::AC3DsurfaceFormat::write } +template +void Foam::fileFormats::AC3DsurfaceFormat::write +( + Ostream& os, + const MeshedSurface& surf +) +{ + write(os, surf.points(), surf.faces(), surf.zones()); +} + + template void Foam::fileFormats::AC3DsurfaceFormat::write ( diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H index a7b43ac323..24aa25df18 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.H @@ -56,7 +56,7 @@ namespace fileFormats { /*---------------------------------------------------------------------------*\ - Class AC3DfileFormat Declaration + Class AC3DsurfaceFormat Declaration \*---------------------------------------------------------------------------*/ template @@ -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&, + const List& + ); + //- Write MeshedSurface static void write ( diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.H b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.H index 21044417cd..93619e5a9b 100644 --- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.H +++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormatCore.H @@ -49,7 +49,7 @@ namespace fileFormats { /*---------------------------------------------------------------------------*\ - Class AC3DfileFormat Declaration + Class AC3DsurfaceFormatCore Declaration \*---------------------------------------------------------------------------*/ class AC3DsurfaceFormatCore diff --git a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C b/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C index 60f3de0ae4..372427f4ad 100644 --- a/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C +++ b/src/surfMesh/surfaceFormats/ftr/FTRsurfaceFormat.C @@ -65,11 +65,11 @@ bool Foam::fileFormats::FTRsurfaceFormat::read List ftrPatches(is); - // read points directly + // points read directly is >> this->storedPoints(); - // faces read with keys - List > facesRead(is); + // triFaces read with attached keys + List< Keyed > facesRead(is); List faceLst(facesRead.size()); List