From 4d499d3c20108b01b2030ee549390a5a40d5e66c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Sun, 24 Feb 2019 18:16:17 +0100 Subject: [PATCH] ENH: basic i-j-k Field container (#1216) - this is a simple container for fields with i-j-k addressing. It does not support field operations directly, but is primarily intended to be used when assembling field information with i-j-k logic. After assembly, the field can be transferred to a regular field for normal operations. Eg, IjkField assemble({15, 16, 200}); // .. fill in i-j-k fields Field final(std::move(assemble)); assemble.clear(); // be pedantic ... --- applications/test/IjkField/Make/files | 3 + applications/test/IjkField/Make/options | 4 + applications/test/IjkField/Test-IjkField.C | 138 +++++++++++++ src/OpenFOAM/meshes/ijkMesh/IjkField.C | 145 +++++++++++++ src/OpenFOAM/meshes/ijkMesh/IjkField.H | 180 ++++++++++++++++ src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H | 226 +++++++++++++++++++++ 6 files changed, 696 insertions(+) create mode 100644 applications/test/IjkField/Make/files create mode 100644 applications/test/IjkField/Make/options create mode 100644 applications/test/IjkField/Test-IjkField.C create mode 100644 src/OpenFOAM/meshes/ijkMesh/IjkField.C create mode 100644 src/OpenFOAM/meshes/ijkMesh/IjkField.H create mode 100644 src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H diff --git a/applications/test/IjkField/Make/files b/applications/test/IjkField/Make/files new file mode 100644 index 0000000000..8e1017d41d --- /dev/null +++ b/applications/test/IjkField/Make/files @@ -0,0 +1,3 @@ +Test-IjkField.C + +EXE = $(FOAM_USER_APPBIN)/Test-IjkField diff --git a/applications/test/IjkField/Make/options b/applications/test/IjkField/Make/options new file mode 100644 index 0000000000..2c375bcb61 --- /dev/null +++ b/applications/test/IjkField/Make/options @@ -0,0 +1,4 @@ +EXE_INC = -DFULLDEBUG + +/* EXE_INC = -I$(LIB_SRC)/finiteVolume/lnInclude */ +/* EXE_LIBS = -lfiniteVolume */ diff --git a/applications/test/IjkField/Test-IjkField.C b/applications/test/IjkField/Test-IjkField.C new file mode 100644 index 0000000000..8f093218f0 --- /dev/null +++ b/applications/test/IjkField/Test-IjkField.C @@ -0,0 +1,138 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2019 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 3 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, see . + +Description + Functionality of IjkField + +\*---------------------------------------------------------------------------*/ + +#include "point.H" +#include "IjkField.H" +#include "IOstreams.H" + +using namespace Foam; + +template +Ostream& print(const IjkField& fld) +{ + Info<< static_cast&>(fld).size() + << " " << fld.sizes() << ' ' << flatOutput(fld); + + return Info; +} + + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + // Create with inconsistent sizes + IjkField