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
......@@ -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"