diff --git a/applications/test/faces/Make/files b/applications/test/faces/Make/files
new file mode 100644
index 0000000000..8418bb2b93
--- /dev/null
+++ b/applications/test/faces/Make/files
@@ -0,0 +1,3 @@
+Test-faces.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-faces
diff --git a/applications/test/faces/Make/options b/applications/test/faces/Make/options
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/src/conversion/ensight/part/ensightPartsTemplates.C b/applications/test/faces/Test-faces.C
similarity index 55%
rename from src/conversion/ensight/part/ensightPartsTemplates.C
rename to applications/test/faces/Test-faces.C
index fe2f712a0b..823f33e3e1 100644
--- a/src/conversion/ensight/part/ensightPartsTemplates.C
+++ b/applications/test/faces/Test-faces.C
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
- \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
+ \\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@@ -21,54 +21,63 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
+Application
+ Test-faces
+
Description
- Template to write generalized field components
+ Simple tests for various faces
\*---------------------------------------------------------------------------*/
-#include "ensightParts.H"
+#include "argList.H"
+#include "labelledTri.H"
+
+using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
-template
-void Foam::ensightParts::writeField
-(
- ensightFile& os,
- const GeometricField& field
-) const
+int main(int argc, char *argv[])
{
- // find offset to patch parts (ie, the first face data)
- label patchOffset = 0;
- forAll(partsList_, partI)
- {
- if (partsList_[partI].isFaceData())
- {
- patchOffset = partI;
- break;
- }
- }
+ face f1{ 1, 2, 3, 4 };
+ Info<< "face:" << f1 << nl;
- forAll(partsList_, partI)
- {
- label patchi = partI - patchOffset;
+ triFace t1{ 1, 2, 3 };
+ Info<< "triFace:" << t1 << nl;
- if (partsList_[partI].isCellData())
- {
- partsList_[partI].writeField
- (
- os,
- field
- );
- }
- else if (patchi < field.boundaryField().size())
- {
- partsList_[partI].writeField
- (
- os,
- field.boundaryField()[patchi]
- );
- }
+ f1 = t1;
+ Info<< "face:" << f1 << nl;
+
+ f1 = t1.triFaceFace();
+ Info<< "face:" << f1 << nl;
+
+ // expect these to fail
+ FatalError.throwExceptions();
+ try
+ {
+ labelledTri l1{ 1, 2, 3, 10, 24 };
+ Info<< "labelled:" << l1 << nl;
}
+ catch (Foam::error& err)
+ {
+ WarningInFunction
+ << "Caught FatalError " << err << nl << endl;
+ }
+ FatalError.dontThrowExceptions();
+
+ labelledTri l2{ 1, 2, 3 };
+ Info<< "labelled:" << l2 << nl;
+
+ labelledTri l3{ 1, 2, 3, 10 };
+ Info<< "labelled:" << l3 << nl;
+
+ t1.flip();
+ l3.flip();
+
+ Info<< "flip:" << t1 << nl;
+ Info<< "flip:" << l3 << nl;
+
+ return 0;
}
diff --git a/applications/test/xfer/Test-xferList.C b/applications/test/xfer/Test-xferList.C
index 77231e2118..9b800220ca 100644
--- a/applications/test/xfer/Test-xferList.C
+++ b/applications/test/xfer/Test-xferList.C
@@ -34,6 +34,8 @@ Description
#include "labelList.H"
#include "DynamicList.H"
#include "face.H"
+#include "pointField.H"
+#include "DynamicField.H"
using namespace Foam;
@@ -45,7 +47,10 @@ using namespace Foam;
int main(int argc, char *argv[])
{
List