Skip to content
Snippets Groups Projects
Commit c56edc26 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add read/write for labelledTri surfaces (issue #294)

- extends existing surfaceFormats to include surfaces with
  labelledTri as their face representation.
parent d026f908
Branches
Tags
No related merge requests found
Showing
with 310 additions and 57 deletions
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -67,10 +67,10 @@ class AC3DsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
AC3DsurfaceFormat(const AC3DsurfaceFormat<Face>&);
AC3DsurfaceFormat(const AC3DsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const AC3DsurfaceFormat<Face>&);
void operator=(const AC3DsurfaceFormat<Face>&) = delete;
public:
......@@ -101,10 +101,18 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Write UnsortedMeshedSurface, the output is always sorted by zones.
static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
static void write
(
const fileName&,
const UnsortedMeshedSurface<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -52,6 +52,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
ac
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
AC3DsurfaceFormat,
labelledTri,
fileExtension,
ac
);
// write MeshedSurfaceProxy
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -72,6 +80,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
ac
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
AC3DsurfaceFormat,
labelledTri,
write,
fileExtension,
ac
);
// write UnsortedMeshedSurface
......@@ -93,6 +110,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
ac
);
addNamedTemplatedToMemberFunctionSelectionTable
(
UnsortedMeshedSurface,
AC3DsurfaceFormat,
labelledTri,
write,
fileExtension,
ac
);
}
}
......
......@@ -54,6 +54,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
flma
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
FLMAsurfaceFormat,
labelledTri,
write,
fileExtension,
flma
);
// write MeshedSurfaceProxy (comnpressed versions of above)
......@@ -75,6 +84,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
flmaz
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
FLMAZsurfaceFormat,
labelledTri,
write,
fileExtension,
flmaz
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -60,10 +60,10 @@ class GTSsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
GTSsurfaceFormat(const GTSsurfaceFormat<Face>&);
GTSsurfaceFormat(const GTSsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const GTSsurfaceFormat<Face>&);
void operator=(const GTSsurfaceFormat<Face>&) = delete;
public:
......@@ -94,10 +94,18 @@ public:
// Member Functions
//- Write MeshedSurface
static void write(const fileName&, const MeshedSurface<Face>&);
static void write
(
const fileName&,
const MeshedSurface<Face>&
);
//- Write UnsortedMeshedSurface, the output remains unsorted
static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
static void write
(
const fileName&,
const UnsortedMeshedSurface<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -52,6 +52,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
gts
);
addNamedTemplatedToRunTimeSelectionTable
(
UnsortedMeshedSurface,
GTSsurfaceFormat,
labelledTri,
fileExtension,
gts
);
// write MeshedSurface
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -72,6 +80,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
gts
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurface,
GTSsurfaceFormat,
labelledTri,
write,
fileExtension,
gts
);
// write UnsortedMeshedSurface
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -92,6 +109,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
gts
);
addNamedTemplatedToMemberFunctionSelectionTable
(
UnsortedMeshedSurface,
GTSsurfaceFormat,
labelledTri,
write,
fileExtension,
gts
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -68,10 +68,10 @@ class NASsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
NASsurfaceFormat(const NASsurfaceFormat<Face>&);
NASsurfaceFormat(const NASsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const NASsurfaceFormat<Face>&);
void operator=(const NASsurfaceFormat<Face>&) = delete;
public:
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -35,7 +35,7 @@ namespace Foam
namespace fileFormats
{
// read MeshedSurface - .bdf (Bulk Data Format)
// read MeshedSurface - .bdf (Bulk Data Format) and nas (Nastran)
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
......@@ -53,7 +53,6 @@ addNamedTemplatedToRunTimeSelectionTable
nas
);
// read MeshedSurface - .nas (Nastran)
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
......@@ -71,6 +70,23 @@ addNamedTemplatedToRunTimeSelectionTable
nas
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
NASsurfaceFormat,
labelledTri,
fileExtension,
bdf
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
NASsurfaceFormat,
labelledTri,
fileExtension,
nas
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -60,10 +60,10 @@ class OBJsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
OBJsurfaceFormat(const OBJsurfaceFormat<Face>&);
OBJsurfaceFormat(const OBJsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const OBJsurfaceFormat<Face>&);
void operator=(const OBJsurfaceFormat<Face>&) = delete;
public:
......@@ -94,7 +94,11 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -52,6 +52,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
obj
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
OBJsurfaceFormat,
labelledTri,
fileExtension,
obj
);
// write MeshedSurfaceProxy
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -72,6 +80,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
obj
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
OBJsurfaceFormat,
labelledTri,
write,
fileExtension,
obj
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -68,10 +68,10 @@ class OFFsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
OFFsurfaceFormat(const OFFsurfaceFormat&);
OFFsurfaceFormat(const OFFsurfaceFormat&) = delete;
//- Disallow default bitwise assignment
void operator=(const OFFsurfaceFormat&);
void operator=(const OFFsurfaceFormat&) = delete;
public:
......@@ -102,7 +102,11 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -52,6 +52,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
off
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
OFFsurfaceFormat,
labelledTri,
fileExtension,
off
);
// write MeshedSurfaceProxy
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -72,7 +80,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
off
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
OFFsurfaceFormat,
labelledTri,
write,
fileExtension,
off
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -64,10 +64,10 @@ class SMESHsurfaceFormat
// Private Member Functions
//- Disallow default bitwise copy construct
SMESHsurfaceFormat(const SMESHsurfaceFormat<Face>&);
SMESHsurfaceFormat(const SMESHsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const SMESHsurfaceFormat<Face>&);
void operator=(const SMESHsurfaceFormat<Face>&) = delete;
public:
......@@ -86,7 +86,11 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Write object
virtual void write(const fileName& name) const
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -54,6 +54,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
smesh
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
SMESHsurfaceFormat,
labelledTri,
write,
fileExtension,
smesh
);
}
}
......
......@@ -108,7 +108,11 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -52,6 +52,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
inp
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
STARCDsurfaceFormat,
labelledTri,
fileExtension,
inp
);
// write MeshedSurfaceProxy
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -72,7 +80,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
inp
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
STARCDsurfaceFormat,
labelledTri,
write,
fileExtension,
inp
);
}
}
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -83,10 +83,10 @@ class STLsurfaceFormat
//- Disallow default bitwise copy construct
STLsurfaceFormat(const STLsurfaceFormat<Face>&);
STLsurfaceFormat(const STLsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const STLsurfaceFormat<Face>&);
void operator=(const STLsurfaceFormat<Face>&) = delete;
public:
......@@ -132,7 +132,11 @@ public:
//- Write surface mesh components by proxy
// as ASCII or BINARY, depending on the extension
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Write surface mesh components by proxy
// as ASCII or BINARY or dependent on the extension
......@@ -159,7 +163,11 @@ public:
//- Write UnsortedMeshedSurface
// as ASCII or BINARY, depending on the extension
static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
static void write
(
const fileName&,
const UnsortedMeshedSurface<Face>&
);
//- Write UnsortedMeshedSurface
// as ASCII or BINARY or dependent on the extension
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "STLsurfaceFormat.H"
#include "labelledTri.H"
#include "addToRunTimeSelectionTable.H"
#include "addToMemberFunctionSelectionTable.H"
......@@ -52,6 +53,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
stl
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
STLsurfaceFormat,
labelledTri,
fileExtension,
stl
);
// read MeshedSurface (binary)
addNamedTemplatedToRunTimeSelectionTable
......@@ -70,6 +79,14 @@ addNamedTemplatedToRunTimeSelectionTable
fileExtension,
stlb
);
addNamedTemplatedToRunTimeSelectionTable
(
MeshedSurface,
STLsurfaceFormat,
labelledTri,
fileExtension,
stlb
);
// write MeshedSurfaceProxy (ascii)
......@@ -91,6 +108,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
stl
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
STLsurfaceFormat,
labelledTri,
write,
fileExtension,
stl
);
// write MeshedSurfaceProxy (binary)
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -111,6 +137,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
stlb
);
addNamedTemplatedToMemberFunctionSelectionTable
(
MeshedSurfaceProxy,
STLsurfaceFormat,
labelledTri,
write,
fileExtension,
stlb
);
// write UnsortedMeshedSurface (ascii)
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -131,6 +166,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
stl
);
addNamedTemplatedToMemberFunctionSelectionTable
(
UnsortedMeshedSurface,
STLsurfaceFormat,
labelledTri,
write,
fileExtension,
stl
);
// write UnsortedMeshedSurface (binary)
addNamedTemplatedToMemberFunctionSelectionTable
......@@ -151,6 +195,15 @@ addNamedTemplatedToMemberFunctionSelectionTable
fileExtension,
stlb
);
addNamedTemplatedToMemberFunctionSelectionTable
(
UnsortedMeshedSurface,
STLsurfaceFormat,
labelledTri,
write,
fileExtension,
stlb
);
}
}
......
......@@ -99,15 +99,26 @@ public:
//- Return the local file name (within time directory)
// NEEDS FIXING
static fileName localMeshFileName(const word& surfName="");
static fileName localMeshFileName
(
const word& surfName = word::null
);
//- Find instance with surfName
// NEEDS FIXING
static fileName findMeshInstance(const Time&, const word& surfName="");
static fileName findMeshInstance
(
const Time&,
const word& surfName = word::null
);
//- Find mesh file with surfName
// NEEDS FIXING
static fileName findMeshFile(const Time&, const word& surfName="");
static fileName findMeshFile
(
const Time&,
const word& surfName = word::null
);
// Constructors
......@@ -118,6 +129,7 @@ public:
//- Destructor
virtual ~surfaceFormatsCore();
};
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -71,10 +71,10 @@ class TRIsurfaceFormat
);
//- Disallow default bitwise copy construct
TRIsurfaceFormat(const TRIsurfaceFormat<Face>&);
TRIsurfaceFormat(const TRIsurfaceFormat<Face>&) = delete;
//- Disallow default bitwise assignment
void operator=(const TRIsurfaceFormat<Face>&);
void operator=(const TRIsurfaceFormat<Face>&) = delete;
public:
......@@ -105,11 +105,19 @@ public:
// Member Functions
//- Write surface mesh components by proxy
static void write(const fileName&, const MeshedSurfaceProxy<Face>&);
static void write
(
const fileName&,
const MeshedSurfaceProxy<Face>&
);
//- Write UnsortedMeshedSurface,
// by default the output is not sorted by zones
static void write(const fileName&, const UnsortedMeshedSurface<Face>&);
static void write
(
const fileName&,
const UnsortedMeshedSurface<Face>&
);
//- Read from file
virtual bool read(const fileName&);
......
......@@ -38,10 +38,6 @@ SourceFiles
#include "surfaceFormatsCore.H"
#include "triFace.H"
#include "IFstream.H"
#include "Ostream.H"
#include "OFstream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......@@ -74,10 +70,10 @@ class TRIsurfaceFormatCore
// Private Member Functions
//- Disallow default bitwise copy construct
TRIsurfaceFormatCore(const TRIsurfaceFormatCore&);
TRIsurfaceFormatCore(const TRIsurfaceFormatCore&) = delete;
//- Disallow default bitwise assignment
void operator=(const TRIsurfaceFormatCore&);
void operator=(const TRIsurfaceFormatCore&) = delete;
bool read(const fileName&);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment