diff --git a/applications/test/BSpline/BSplineTest.C b/applications/test/BSpline/BSplineTest.C new file mode 100644 index 0000000000..cb858d5560 --- /dev/null +++ b/applications/test/BSpline/BSplineTest.C @@ -0,0 +1,68 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "argList.H" + +#include "simpleMatrix.H" +#include "vector.H" +#include "IFstream.H" +#include "BSpline.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noParallel(); + argList::validArgs.insert("file .. fileN"); + + argList args(argc, argv, false, true); + + forAll(args.additionalArgs(), argI) + { + const string& srcFile = args.additionalArgs()[argI]; + Info<< nl << "reading " << srcFile << nl; + IFstream ifs(srcFile); + + List splinePointFields(ifs); + + forAll(splinePointFields, splineI) + { + Info<<"convert " << splinePointFields[splineI] << " to bspline" << endl; + + BSpline spl(splinePointFields[splineI], vector::zero, vector::zero); + + Info<< "1/2 = " << spl.position(0.5) << endl; + } + } + + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/BSpline/Make/files b/applications/test/BSpline/Make/files new file mode 100644 index 0000000000..be66810067 --- /dev/null +++ b/applications/test/BSpline/Make/files @@ -0,0 +1,3 @@ +BSplineTest.C + +EXE = $(FOAM_USER_APPBIN)/BSplineTest diff --git a/applications/test/BSpline/Make/options b/applications/test/BSpline/Make/options new file mode 100644 index 0000000000..1a366abf0d --- /dev/null +++ b/applications/test/BSpline/Make/options @@ -0,0 +1,5 @@ +EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/mesh/blockMesh/lnInclude + +EXE_LIBS = -lblockMesh diff --git a/applications/test/BSpline/test-splines b/applications/test/BSpline/test-splines new file mode 100644 index 0000000000..f5c3a46ae4 --- /dev/null +++ b/applications/test/BSpline/test-splines @@ -0,0 +1,69 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +( + // Upper body longitudinal splines. + ( + (-0.22685 -0.01125166 0) // 7 + (-0.21685 -0.01340204 0) + (-0.20685 -0.01529684 0) + (-0.19685 -0.01694748 0) + (-0.18685 -0.01836538 0) + (-0.17685 -0.01956197 0) + (-0.16685 -0.02054868 0) + (-0.15685 -0.02133693 0) + (-0.14685 -0.02193816 0) + (-0.13685 -0.02236377 0) + (-0.12685 -0.02262521 0) + (-0.11685 -0.02273389 0) // 2 + ) + + ( + (-0.22685 0 0.01125166) // 8 + (-0.21685 0 0.01340204) + (-0.20685 0 0.01529684) + (-0.19685 0 0.01694748) + (-0.18685 0 0.01836538) + (-0.17685 0 0.01956197) + (-0.16685 0 0.02054868) + (-0.15685 0 0.02133693) + (-0.14685 0 0.02193816) + (-0.13685 0 0.02236377) + (-0.12685 0 0.02262521) + (-0.11685 0 0.02273389) // 3 + ) + + ( + (-0.22685 0.01125166 0) // 9 + (-0.21685 0.01340204 0) + (-0.20685 0.01529684 0) + (-0.19685 0.01694748 0) + (-0.18685 0.01836538 0) + (-0.17685 0.01956197 0) + (-0.16685 0.02054868 0) + (-0.15685 0.02133693 0) + (-0.14685 0.02193816 0) + (-0.13685 0.02236377 0) + (-0.12685 0.02262521 0) + (-0.11685 0.02273389 0) // 4 + ) + + ( + (-0.22685 0 -0.01125166) // 6 + (-0.21685 0 -0.01340204) + (-0.20685 0 -0.01529684) + (-0.19685 0 -0.01694748) + (-0.18685 0 -0.01836538) + (-0.17685 0 -0.01956197) + (-0.16685 0 -0.02054868) + (-0.15685 0 -0.02133693) + (-0.14685 0 -0.02193816) + (-0.13685 0 -0.02236377) + (-0.12685 0 -0.02262521) + (-0.11685 0 -0.02273389) // 1 + ) +);