mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
add applications/test/BSpline - it fails!
This commit is contained in:
68
applications/test/BSpline/BSplineTest.C
Normal file
68
applications/test/BSpline/BSplineTest.C
Normal file
@ -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<pointField> 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
3
applications/test/BSpline/Make/files
Normal file
3
applications/test/BSpline/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
BSplineTest.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/BSplineTest
|
||||||
5
applications/test/BSpline/Make/options
Normal file
5
applications/test/BSpline/Make/options
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/mesh/blockMesh/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = -lblockMesh
|
||||||
69
applications/test/BSpline/test-splines
Normal file
69
applications/test/BSpline/test-splines
Normal file
@ -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
|
||||||
|
)
|
||||||
|
);
|
||||||
Reference in New Issue
Block a user