Commit 899a79d7 authored by Franjo's avatar Franjo

Removed testingInterfaces and maxima

A
A
A
A
A
A
A
parent 419be12c
Atri(x, y) := (p1y - p2y) * x + (p2x - p1x) * y + p1x * p2y - p2x * p1y;
Astab(x, y) := 0.5 * (Atri(x,y) + sqrt(Atri(x,y) * Atri(x, y) + K));
Le0(x, y) := (p1x - x) * (p1x - x) + (p1y - y) * (p1y - y);
Le1(x, y) := (p2x - x) * (p2x - x) + (p2y - y) * (p2y - y);
Le2(x, y) := (p2x - p1x) * (p2x - p1x) + (p2y - p1y) * (p2y - p1y);
Lsq(x, y) := Le0(x, y) + Le1(x, y) + Le2(x, y);
F(x, y) := Lsq(x, y) / Astab(x, y);
gradFx(x, y) := diff(F(x, y), x);
gradFy(x, y) := diff(F(x, y), y);
gradGradFxx(x, y) := diff(gradFx(x, y), x);
gradGradFxy(x, y) := diff(gradFx(x, y), y);
gradGradFyx(x, y) := diff(gradFy(x, y), x);
gradGradFyy(x, y) := diff(gradFy(x, y), y);
\ No newline at end of file
eq1 : a0 *(x1 - x0) + b0 * (y1 - y0) + c0 * (z1 - z0);
eq2 : a1 *(x1 - x0) + b1 * (y1 - y0) + c1 * (z1 - z0);
eq3 : a2 *(x1 - x0) + b2 * (y1 - y0) + c2 * (z1 - z0);
eq4 : a0 *(x2 - x0) + b0 * (y2 - y0) + c0 * (z2 - z0);
eq5 : a1 *(x2 - x0) + b1 * (y2 - y0) + c1 * (z2 - z0);
eq6 : a2 *(x2 - x0) + b2 * (y2 - y0) + c2 * (z2 - z0);
eq7 : a0 *(x3 - x0) + b0 * (y3 - y0) + c0 * (z3 - z0);
eq8 : a1 *(x3 - x0) + b1 * (y3 - y0) + c1 * (z3 - z0);
eq9 : a2 *(x3 - x0) + b2 * (y3 - y0) + c2 * (z3 - z0);
solve( [eq1 = 1, eq4 = 0, eq7 = 0], [a0, b0, c0] );
solve( [eq2 = 0, eq5 = 1, eq8 = 0], [a1, b1, c1] );
solve( [eq3 = 0, eq6 = 0, eq9 = 1], [a2, b2, c2] );
B: matrix( [(x1 - x0), (y1 - y0), (z1 - z0)], [(x2 - x0), (y2 - y0), (z2 - z0)], [(x3 - x0), (y3 - y0), (z3 - z0)] );
\ No newline at end of file
V(x,y,z) := A*x + B*y + C*z + D;
LSq(x, y, z) := 3*(x*x) + 3*(y*y) + 3*(z*z) + E*x + F*y + G*z + H;
F(x, y, z) := LSq(x,y,z) / V(x,y,z);
diff(F(x,y,z), x);
diff(F(x,y,z), y);
diff(F(x,y,z), z);
diff(diff(F(x,y,z), x), x);
diff(diff(F(x,y,z), x), y);
diff(diff(F(x,y,z), x), z);
A: matrix([diff(diff(LSq(x,y,z), x), x), diff(diff(LSq(x,y,z), x), y), diff(diff(LSq(x,y,z), x), z)], [diff(diff(LSq(x,y,z), y), x), diff(diff(LSq(x,y,z), y), y), diff(diff(LSq(x,y,z), y), z)], [diff(diff(LSq(x,y,z), z), x), diff(diff(LSq(x,y,z), z), y), diff(diff(LSq(x,y,z), z), z)]);
V(x,y,z) := A*x + B*y + C*z + D;
VStab(x,y,z) := (V(x,y,z) + ((V(x,y,z))^2 + K)^(1/2)) / 2;
LSq(x, y, z) := 3*(x*x) + 3*(y*y) + 3*(z*z) + E*x + F*y + G*z + H;
F(x, y, z) := LSq(x,y,z) / VStab(x,y,z);
diff(F(x,y,z), x);
diff(F(x,y,z), y);
diff(F(x,y,z), z);
diff(diff(F(x,y,z), x), x);
diff(diff(F(x,y,z), x), y);
diff(diff(F(x,y,z), x), z);
A: matrix([diff(diff(LSq(x,y,z), x), x), diff(diff(LSq(x,y,z), x), y), diff(diff(LSq(x,y,z), x), z)], [diff(diff(LSq(x,y,z), y), x), diff(diff(LSq(x,y,z), y), y), diff(diff(LSq(x,y,z), y), z)], [diff(diff(LSq(x,y,z), z), x), diff(diff(LSq(x,y,z), z), y), diff(diff(LSq(x,y,z), z), z)]);
V(x,y,z) := A*x + B*y + C*z + D;
VStab(x,y,z) := (V(x,y,z) + ((V(x,y,z))^2 + K)^(1/2)) / 2;
LSq(x, y, z) := 3*(x*x) + 3*(y*y) + 3*(z*z) + E*x + F*y + G*z + H;
F(x, y, z) := (LSq(x,y,z)) / VStab(x,y,z)^(2/3);
diff(F(x,y,z), x);
diff(F(x,y,z), y);
diff(F(x,y,z), z);
diff(diff(F(x,y,z), x), x);
diff(diff(F(x,y,z), x), y);
diff(diff(F(x,y,z), x), z);
A: matrix([diff(diff(LSq(x,y,z), x), x), diff(diff(LSq(x,y,z), x), y), diff(diff(LSq(x,y,z), x), z)], [diff(diff(LSq(x,y,z), y), x), diff(diff(LSq(x,y,z), y), y), diff(diff(LSq(x,y,z), y), z)], [diff(diff(LSq(x,y,z), z), x), diff(diff(LSq(x,y,z), z), y), diff(diff(LSq(x,y,z), z), z)]);
V(x,y,z) := A*x + B*y + C*z + D;
VStab(x,y,z) := ((V(x,y,z) + ((V(x,y,z))^2 )^(1/2)) / 2) + K;
LSq(x, y, z) := 3*(x*x) + 3*(y*y) + 3*(z*z) + E*x + F*y + G*z + H;
F(x, y, z) := (LSq(x,y,z)) / VStab(x,y,z)^(2/3);
diff(F(x,y,z), x);
diff(F(x,y,z), y);
diff(F(x,y,z), z);
diff(diff(F(x,y,z), x), x);
diff(diff(F(x,y,z), x), y);
diff(diff(F(x,y,z), x), z);
A: matrix([diff(diff(LSq(x,y,z), x), x), diff(diff(LSq(x,y,z), x), y), diff(diff(LSq(x,y,z), x), z)], [diff(diff(LSq(x,y,z), y), x), diff(diff(LSq(x,y,z), y), y), diff(diff(LSq(x,y,z), y), z)], [diff(diff(LSq(x,y,z), z), x), diff(diff(LSq(x,y,z), z), y), diff(diff(LSq(x,y,z), z), z)]);
testBoundaryLayer.C
EXE = $(FOAM_USER_APPBIN)/testBoundaryLayer
EXE_INC = -I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I../../meshLibrary/lnInclude
EXE_LIBS = -lmeshLibrary -ltriSurface -lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2005-2007 Franjo Juretic
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
Test for boundary layers
Description
-
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "objectRegistry.H"
#include "polyMeshGen.H"
#include "boundaryLayers.H"
#include "refineBoundaryLayers.H"
#include "polyMeshGenChecks.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
polyMeshGen pmg(runTime);
pmg.read();
IOdictionary meshDict
(
IOobject
(
"meshDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
//boundaryLayers bndLayers(pmg);
//bndLayers.addLayerForPatch("inlet");
//bndLayers.addLayerForPatch("symmetryplane");
//bndLayers.createOTopologyLayers();
//bndLayers.addLayerForAllPatches();
Info << "Starting bnd layer refinement "
<< runTime.elapsedClockTime() << endl;
//polyMeshGenChecks::checkMesh(pmg, true);
refineBoundaryLayers refLayers(pmg);
refineBoundaryLayers::readSettings(meshDict, refLayers);
refLayers.refineLayers();
Info << "Finished with bnd layer refinement "
<< runTime.elapsedClockTime() << endl;
polyMeshGenChecks::checkMesh(pmg, true);
return 0;
pmg.write();
//meshOctree* octreePtr = NULL;
//meshOptimizer(*octreePtr, pmg).preOptimize();
//pmg.addressingData().checkMesh(true);
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
testCartesianMeshExtractor.C
EXE = $(FOAM_USER_APPBIN)/testCartesianMeshExtractor
EXE_INC = -I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I../../meshLibrary/lnInclude
EXE_LIBS = -lmeshLibrary -ltriSurface -lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2005-2007 Franjo Juretic
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
Test of the cartesian mesh
Description
- creates an octree and creates cartesian mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "meshOctreeCreator.H"
#include "meshOctreeAutomaticRefinement.H"
#include "Time.H"
#include "polyMesh.H"
#include "polyMeshGen.H"
#include "cartesianMeshExtractor.H"
#include "triSurf.H"
#include <sstream>
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
IOdictionary meshDict
(
IOobject
(
"meshDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fileName surfaceFile = meshDict.lookup("surfaceFile");
if( Pstream::parRun() )
surfaceFile = ".."/surfaceFile;
triSurf surf(runTime.path()/surfaceFile);
// construct the octree
meshOctree mo(surf);
meshOctreeCreator moc(mo, meshDict);
moc.createOctreeBoxes();
//meshOctreeAutomaticRefinement(mo, meshDict, false).automaticRefinement();
Info<< "Execution time for octree creation = "
<< runTime.elapsedCpuTime()
<< " s\n" << endl << endl;
polyMeshGen pmg(runTime);
cartesianMeshExtractor cmg(mo, meshDict, pmg);
//cmg.decomposeSplitHexes();
cmg.createMesh();
const pointFieldPMG& points = pmg.points();
/* forAll(points, pointI)
{
const point p = points[pointI];
for(label pointJ=pointI+1;pointJ<points.size();++pointJ)
if( mag(p - points[pointJ]) < 1e-10 )
Info << "Points " << pointI << " and " << pointJ
<< " are duplicates " << endl;
}
*/
boolList usedPoint(points.size());
const faceListPMG& faces = pmg.faces();
forAll(faces, faceI)
{
const face& f = faces[faceI];
forAll(f, pI)
usedPoint[f[pI]] = true;
}
forAll(usedPoint, pointI)
if( !usedPoint[pointI] )
Info << "Point " << pointI << " is not used !!" << endl;
pmg.write();
/* if( Pstream::parRun() )
{
std::ostringstream ss;
ss << Pstream::myProcNo();
}
*/
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
testCellSurfaceIntersections.C
EXE = $(FOAM_USER_APPBIN)/testCellSurfaceIntersections
EXE_INC = -I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I../../meshLibrary/lnInclude
EXE_LIBS = -lMeshLibrary -ltriSurface -lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2005-2007 Franjo Juretic
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
Test of the cartesian mesh
Description
- creates an octree and creates cartesian mesh
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "meshOctreeCreator.H"
#include "meshOctreeAutomaticRefinement.H"
#include "Time.H"
#include "polyMesh.H"
#include "polyMeshGen.H"
#include "triSurf.H"
#include "findCellsIntersectingSurface.H"
#include <sstream>
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
IOdictionary meshDict
(
IOobject
(
"meshDict",
runTime.system(),
runTime,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fileName surfaceFile = meshDict.lookup("surfaceFile");
if( Pstream::parRun() )
surfaceFile = ".."/surfaceFile;
triSurf surf(runTime.path()/surfaceFile);
/* if( meshDict.found("subsetFileName") )
{
fileName subsetFileName = meshDict.lookup("subsetFileName");
if( Pstream::parRun() )
subsetFileName = ".."/subsetFileName;
surf.readFaceSubsets(runTime.path()/subsetFileName);
}
*/
// construct the octree
meshOctree mo(surf);
meshOctreeCreator(mo, meshDict).createOctreeBoxes();
polyMeshGen pmg(runTime);
pmg.read();
findCellsIntersectingSurface ss(pmg, mo);
ss.addIntersectedCellsToSubset("intersectedCells");
pmg.write();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
testChainFromEdges.C
EXE = $(FOAM_USER_APPBIN)/testChainFromEdges
EXE_INC = -I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I../../meshLibrary/lnInclude
EXE_LIBS = -lMeshLibrary -ltriSurface -lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2005-2007 Franjo Juretic
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application
Test for creation of boundary faces from chains
Description
\*---------------------------------------------------------------------------*/
#include "sortEdgesIntoChains.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
DynList<edge> bEdges;
bEdges.append(edge(33, 34));
bEdges.append(edge(33, 12));
bEdges.append(edge(34, 12));
bEdges.append(edge(12, 35));
bEdges.append(edge(40, 41));
bEdges.append(edge(40, 12));
bEdges.append(edge(41, 36));
bEdges.append(edge(35, 36));
bEdges.append(edge(41, 50));
bEdges.append(edge(48, 57));
bEdges.append(edge(50, 57));
bEdges.append(edge(41, 48));
sortEdgesIntoChains seic(bEdges);
Info << "Sorted chains are " << seic.sortedChains() << endl;
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //
testConcaveCellUnfolder.C
EXE = $(FOAM_USER_APPBIN)/testConcaveCellUnfolder
EXE_INC = -I$(LIB_SRC)/triSurface/lnInclude -I$(LIB_SRC)/meshTools/lnInclude -I../../meshLibrary/lnInclude
EXE_LIBS = -lMeshLibrary -ltriSurface -lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2005-2007 Franjo Juretic
\\/ 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Application