Creation of OpenFOAM-dev repository 15/04/2008

This commit is contained in:
OpenFOAM-admin
2008-04-15 18:56:58 +01:00
commit 3170c7c0c9
9896 changed files with 4016171 additions and 0 deletions

View File

@ -0,0 +1,27 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// autoRefineMesh tool definition
description "Utility to refine cells near to a surface";
autoRefineMeshDict
{
type dictionary;
description "autoRefineMesh control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseTimeArguments;
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
autoRefineMesh.C
EXE = $(FOAM_APPBIN)/autoRefineMesh

View File

@ -0,0 +1,11 @@
EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-lmeshTools \
-ltriSurface \
-llagrangian

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object autoRefineMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Surface to keep to
surface "plexi.ftr";
// What is outside. These points have to be inside a cell (so not on a face!)
outsidePoints ((-0.99001 -0.99001 -0.99001));
//
// Selection of cells to refine
//
// If smallest edge of mesh > maxEdgeLen select all cut cells for refinement.
// If < maxEdgeLen select only those cut cells which are closer than
// curvatureDistance to surface
// and with cos of angle between normals on surface < curvature.
maxEdgeLen 0.1;
curvatureDistance 1.0;
curvature 0.9;
// if > 0: Remove inside cells at every step. Inside is given by number of
// layers separating outside from inside.
// (note that we cannot remove outside
// cells since these contain the outsidePoints)
// Do not use this option if you want mesh to spill through a hole which is
// not visible on the coarsest level but only becomes visible after refinement
nCutLayers 2;
// Refine until smallest edge of mesh < minEdgeLen
minEdgeLen 0.1;
// Or until the number of cells would become more than (stops one level before
// this)
cellLimit 2500000;
//
// Selection of final set
//
// Select based on side of surface. Usually select inside cells and project
// outwards or select outside cells and project inwards.
selectCut false;
selectInside false;
selectOutside true;
// Leave out cell closer than nearDistance to the surface. Usually
// 0.5*minEdgeLen. Set to -1 to disable.
nearDistance -1;
// Some cells on the surface of the selected cells might have all their
// points on the 'outside'. These would get flattened when projecting so
// are either kept and refined (selectHanging) or removed from the set
selectHanging false;
//
// Refinement parameters
//
// Type of coordinate system
coordinateSystem global;
//coordinateSystem patchLocal;
// .. and its coefficients. x,y in this case. (normal = tan1^tan2)
globalCoeffs
{
tan1 (1 0 0);
tan2 (0 1 0);
}
patchLocalCoeffs
{
patch outside; // Normal direction is facenormal of zero'th face of patch
tan1 (1 0 0);
}
// List of directions to refine
directions
(
tan1
tan2
normal
);
// refinement level difference between neighbouring cells. Set to large if
// there is no need for a limit.
splitLevel 2;
// Cut purely geometric (will cut hexes through vertices) or take topology
// into account.
geometricCut false;
// Whether to use hex topology. This will never cut hex through vertices.
useHexTopology yes;
// Write meshes from intermediate steps
writeMesh true;
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// collapseEdges tool definition
description "Collapse short edges and combines edges that are in line";
collapseEdgesDict
{
type dictionary;
description "collapseEdges control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseArguments;
entries
{
include "$FOAMX_CONFIG/entries/arguments/edgeLength.cfg";
include "$FOAMX_CONFIG/entries/arguments/mergeAngle.cfg";
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
collapseEdges.C
EXE = $(FOAM_APPBIN)/collapseEdges

View File

@ -0,0 +1,6 @@
EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-lmeshTools

View File

@ -0,0 +1,596 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Collapse short edges and combines edges that are in line.
- collapse short edges. Length of edges to collapse provided as argument.
- merge two edges if they are in line. Maximum angle provided as argument.
- remove unused points.
Cannot remove cells. Can remove faces and points but does not check
for nonsense resulting topology.
When collapsing an edge with one point on the boundary it will leave
the boundary point intact. When both points inside it chooses random. When
both points on boundary random again. Note: it should in fact use features
where if one point is on a feature it collapses to that one. Alas we don't
have features on a polyMesh.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "edgeCollapser.H"
#include "polyTopoChange.H"
#include "polyTopoChanger.H"
#include "polyMesh.H"
#include "mapPolyMesh.H"
#include "mathematicalConstants.H"
#include "PackedList.H"
#include "SortableList.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Get faceEdges in order of face points, i.e. faceEdges[0] is between
// f[0] and f[1]
labelList getSortedEdges
(
const edgeList& edges,
const labelList& f,
const labelList& edgeLabels
)
{
labelList faceEdges(edgeLabels.size(), -1);
// Find starting pos in f for every edgeLabels
forAll(edgeLabels, i)
{
label edgeI = edgeLabels[i];
const edge& e = edges[edgeI];
label fp = findIndex(f, e[0]);
label fp1 = (fp+1) % f.size();
if (f[fp1] == e[1])
{
// Edgei in fp-fp1 order
faceEdges[fp] = edgeI;
}
else
{
// Edgei between fp-1 and fp
label fpMin1 = (fp == 0 ? f.size()-1 : fp-1);
faceEdges[fpMin1] = edgeI;
}
}
return faceEdges;
}
// Merges edges which are in straight line. I.e. edge split by point.
label mergeEdges
(
const polyMesh& mesh,
const scalar maxCos,
edgeCollapser& collapser
)
{
const pointField& points = mesh.points();
const edgeList& edges = mesh.edges();
const labelListList& pointEdges = mesh.pointEdges();
const labelList& region = collapser.pointRegion();
const labelList& master = collapser.pointRegionMaster();
label nCollapsed = 0;
forAll(pointEdges, pointI)
{
const labelList& pEdges = pointEdges[pointI];
if (pEdges.size() == 2)
{
const edge& leftE = edges[pEdges[0]];
const edge& rightE = edges[pEdges[1]];
// Get the two vertices on both sides of the point
label leftV = leftE.otherVertex(pointI);
label rightV = rightE.otherVertex(pointI);
// Collapse only if none of the points part of merge network
// or all of networks with different masters.
label midMaster = -1;
if (region[pointI] != -1)
{
midMaster = master[region[pointI]];
}
label leftMaster = -2;
if (region[leftV] != -1)
{
leftMaster = master[region[leftV]];
}
label rightMaster = -3;
if (region[rightV] != -1)
{
rightMaster = master[region[rightV]];
}
if
(
midMaster != leftMaster
&& midMaster != rightMaster
&& leftMaster != rightMaster
)
{
// Check if the two edge are in line
vector leftVec = points[pointI] - points[leftV];
leftVec /= mag(leftVec) + VSMALL;
vector rightVec = points[rightV] - points[pointI];
rightVec /= mag(rightVec) + VSMALL;
if ((leftVec & rightVec) > maxCos)
{
// Collapse one (left) side of the edge. Make left vertex
// the master.
//if (collapser.unaffectedEdge(pEdges[0]))
{
collapser.collapseEdge(pEdges[0], leftV);
nCollapsed++;
}
}
}
}
}
return nCollapsed;
}
// Return master point edge needs to be collapsed to (or -1)
label edgeMaster(const PackedList<1>& boundaryPoint, const edge& e)
{
label masterPoint = -1;
// Collapse edge to boundary point.
if (boundaryPoint.get(e[0]))
{
if (boundaryPoint.get(e[1]))
{
// Both points on boundary. Choose one to collapse to.
// Note: should look at feature edges/points!
masterPoint = e[0];
}
else
{
masterPoint = e[0];
}
}
else
{
if (boundaryPoint.get(e[1]))
{
masterPoint = e[1];
}
else
{
// None on boundary. Choose arbitrary.
// Note: should look at geometry?
masterPoint = e[0];
}
}
return masterPoint;
}
label collapseSmallEdges
(
const polyMesh& mesh,
const PackedList<1>& boundaryPoint,
const scalar minLen,
edgeCollapser& collapser
)
{
const pointField& points = mesh.points();
const edgeList& edges = mesh.edges();
// Collapse all edges that are too small. Choose intelligently which
// point to collapse edge to.
label nCollapsed = 0;
forAll(edges, edgeI)
{
const edge& e = edges[edgeI];
if (e.mag(points) < minLen)
{
label master = edgeMaster(boundaryPoint, e);
if (master != -1) // && collapser.unaffectedEdge(edgeI))
{
collapser.collapseEdge(edgeI, master);
nCollapsed++;
}
}
}
return nCollapsed;
}
// Faces which have edges just larger than collapse length but faces which
// are very small. This one tries to collapse them if it can be done with
// edge collapse. For faces where a face gets replace by two edges use
// collapseFaces
label collapseHighAspectFaces
(
const polyMesh& mesh,
const PackedList<1>& boundaryPoint,
const scalar areaFac,
const scalar edgeRatio,
edgeCollapser& collapser
)
{
const pointField& points = mesh.points();
const edgeList& edges = mesh.edges();
const faceList& faces = mesh.faces();
const labelListList& faceEdges = mesh.faceEdges();
scalarField magArea(mag(mesh.faceAreas()));
label maxIndex = findMax(magArea);
scalar minArea = areaFac * magArea[maxIndex];
Info<< "Max face area:" << magArea[maxIndex] << endl
<< "Collapse area factor:" << areaFac << endl
<< "Collapse area:" << minArea << endl;
label nCollapsed = 0;
forAll(faces, faceI)
{
if (magArea[faceI] < minArea)
{
const face& f = faces[faceI];
// Get the edges in face point order
labelList fEdges(getSortedEdges(edges, f, faceEdges[faceI]));
SortableList<scalar> lengths(fEdges.size());
forAll(fEdges, i)
{
lengths[i] = edges[fEdges[i]].mag(points);
}
lengths.sort();
label edgeI = -1;
if (f.size() == 4)
{
// Compare second largest to smallest
if (lengths[2] > edgeRatio*lengths[0])
{
// Collapse smallest only. Triangle should be cleared
// next time around.
edgeI = fEdges[lengths.indices()[0]];
}
}
else if (f.size() == 3)
{
// Compare second largest to smallest
if (lengths[1] > edgeRatio*lengths[0])
{
edgeI = fEdges[lengths.indices()[0]];
}
}
if (edgeI != -1)
{
label master = edgeMaster(boundaryPoint, edges[edgeI]);
if (master != -1)// && collapser.unaffectedEdge(edgeI))
{
collapser.collapseEdge(edgeI, master);
nCollapsed++;
}
}
}
}
return nCollapsed;
}
void set(const labelList& elems, const bool val, boolList& status)
{
forAll(elems, i)
{
status[elems[i]] = val;
}
}
// Tries to simplify polygons to face of minSize (4=quad, 3=triangle)
label simplifyFaces
(
const polyMesh& mesh,
const PackedList<1>& boundaryPoint,
const label minSize,
const scalar lenGap,
edgeCollapser& collapser
)
{
const pointField& points = mesh.points();
const edgeList& edges = mesh.edges();
const faceList& faces = mesh.faces();
const cellList& cells = mesh.cells();
const labelListList& faceEdges = mesh.faceEdges();
const labelList& faceOwner = mesh.faceOwner();
const labelList& faceNeighbour = mesh.faceNeighbour();
const labelListList& pointCells = mesh.pointCells();
const labelListList& cellEdges = mesh.cellEdges();
label nCollapsed = 0;
boolList protectedEdge(mesh.nEdges(), false);
forAll(faces, faceI)
{
const face& f = faces[faceI];
if
(
f.size() > minSize
&& cells[faceOwner[faceI]].size() >= 6
&& (
mesh.isInternalFace(faceI)
&& cells[faceNeighbour[faceI]].size() >= 6
)
)
{
// Get the edges in face point order
labelList fEdges(getSortedEdges(edges, f, faceEdges[faceI]));
SortableList<scalar> lengths(fEdges.size());
forAll(fEdges, i)
{
lengths[i] = edges[fEdges[i]].mag(points);
}
lengths.sort();
// Now find a gap in length between consecutive elements greater
// than lenGap.
label gapPos = -1;
for (label i = f.size()-1-minSize; i >= 0; --i)
{
if (lengths[i+1] > lenGap*lengths[i])
{
gapPos = i;
break;
}
}
if (gapPos != -1)
{
//for (label i = gapPos; i >= 0; --i)
label i = 0; // Hack: collapse smallest edge only.
{
label edgeI = fEdges[lengths.indices()[i]];
if (!protectedEdge[edgeI])
{
const edge& e = edges[edgeI];
label master = edgeMaster(boundaryPoint, e);
if (master != -1)
{
collapser.collapseEdge(edgeI, master);
// Protect all other edges on all cells using edge
// points.
const labelList& pCells0 = pointCells[e[0]];
forAll(pCells0, i)
{
set(cellEdges[pCells0[i]], true, protectedEdge);
}
const labelList& pCells1 = pointCells[e[1]];
forAll(pCells1, i)
{
set(cellEdges[pCells1[i]], true, protectedEdge);
}
nCollapsed++;
}
}
}
}
}
}
return nCollapsed;
}
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("edge length [m]");
argList::validArgs.append("merge angle (degrees)");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
scalar minLen(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
scalar maxCos = Foam::cos(angle*180/mathematicalConstant::pi);
Info<< "Merging:" << nl
<< " edges with length less than " << minLen << " meters" << nl
<< " edges split by a point with edges in line to within " << angle
<< " degrees" << nl
<< endl;
bool meshChanged = false;
while (true)
{
const faceList& faces = mesh.faces();
// Get all points on the boundary
PackedList<1> boundaryPoint(mesh.nPoints(), false);
label nIntFaces = mesh.nInternalFaces();
for (label faceI = nIntFaces; faceI < mesh.nFaces(); faceI++)
{
const face& f = faces[faceI];
forAll(f, fp)
{
boundaryPoint.set(f[fp], 1);
}
}
// Edge collapsing engine
edgeCollapser collapser(mesh);
// Collapse all edges that are too small.
label nCollapsed =
collapseSmallEdges
(
mesh,
boundaryPoint,
minLen,
collapser
);
Info<< "Collapsing " << nCollapsed << " small edges" << endl;
// Remove midpoints on straight edges.
if (nCollapsed == 0)
{
nCollapsed = mergeEdges(mesh, maxCos, collapser);
Info<< "Collapsing " << nCollapsed << " in line edges" << endl;
}
// Remove small sliver faces that can be collapsed to single edge
if (nCollapsed == 0)
{
nCollapsed =
collapseHighAspectFaces
(
mesh,
boundaryPoint,
1E-9, // factor of largest face area
5, // factor between smallest and largest edge on
// face
collapser
);
Info<< "Collapsing " << nCollapsed
<< " small high aspect ratio faces" << endl;
}
// Simplify faces to quads wherever possible
//if (nCollapsed == 0)
//{
// nCollapsed =
// simplifyFaces
// (
// mesh,
// boundaryPoint,
// 4, // minimum size of face
// 0.2, // gap in edge lengths on face
// collapser
// );
// Info<< "Collapsing " << nCollapsed << " polygonal faces" << endl;
//}
if (nCollapsed == 0)
{
break;
}
polyTopoChange meshMod(mesh);
// Insert mesh refinement into polyTopoChange.
collapser.setRefinement(meshMod);
// Do all changes
Info<< "Morphing ..." << endl;
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
collapser.updateMesh(morphMap());
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
meshChanged = true;
}
if (meshChanged)
{
// Write resulting mesh
runTime++;
Info << "Writing collapsed mesh to time " << runTime.value() << endl;
mesh.write();
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// combinePatchFaces tool definition
description "Checks for neighbouring patch faces on same cell and combines them";
combinePatchFacesDict
{
type dictionary;
description "combinePatchFaces control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseArguments;
entries
{
include "$FOAMX_CONFIG/entries/arguments/featureAngle.cfg";
include "$FOAMX_CONFIG/entries/arguments/allowConcaveFaces.cfg";
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
combinePatchFaces.C
EXE = $(FOAM_APPBIN)/combinePatchFaces

View File

@ -0,0 +1,8 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
EXE_LIBS = \
-lmeshTools \
-ldynamicMesh

View File

@ -0,0 +1,514 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Checks for multiple patch faces on same cell and combines them. These
result from e.g. refined neighbouring cells getting removed, leaving 4
exposed faces with same owner.
Rules for merging:
- only boundary faces (since multiple internal faces between two cells
not allowed anyway)
- faces have to have same owner
- faces have to be connected via edge which are not features (so angle
between them < feature angle)
- outside of faces has to be single loop
- outside of face should not be (or just slightly) concave (so angle
between consecutive edges < concaveangle
E.g. to allow all faces on same patch to be merged:
combinePatchFaces .. cavity 180 -concaveAngle 90
\*---------------------------------------------------------------------------*/
#include "PstreamReduceOps.H"
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "polyAddFace.H"
#include "combineFaces.H"
#include "removePoints.H"
#include "polyMesh.H"
#include "mapPolyMesh.H"
#include "mathematicalConstants.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Sin of angle between two consecutive edges on a face. If sin(angle) larger
// than this the face will be considered concave.
const scalar defaultConcaveAngle = 30;
// Same check as snapMesh
void checkSnapMesh
(
const Time& runTime,
const polyMesh& mesh,
labelHashSet& wrongFaces
)
{
IOdictionary snapDict
(
IOobject
(
"snapMeshDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
// Max nonorthogonality allowed
scalar maxNonOrtho(readScalar(snapDict.lookup("maxNonOrtho")));
// Max concaveness allowed.
scalar maxConcave(readScalar(snapDict.lookup("maxConcave")));
// Min volume allowed (factor of minimum cellVolume)
scalar relMinVol(readScalar(snapDict.lookup("minVol")));
const scalar minCellVol = min(mesh.cellVolumes());
const scalar minPyrVol = relMinVol*minCellVol;
// Min area
scalar minArea(readScalar(snapDict.lookup("minArea")));
if (maxNonOrtho < 180.0-SMALL)
{
Pout<< "Checking non orthogonality" << endl;
label nOldSize = wrongFaces.size();
mesh.setNonOrthThreshold(maxNonOrtho);
mesh.checkFaceOrthogonality(false, &wrongFaces);
Pout<< "Detected " << wrongFaces.size() - nOldSize
<< " faces with non-orthogonality > " << maxNonOrtho << " degrees"
<< endl;
}
if (minPyrVol > -GREAT)
{
Pout<< "Checking face pyramids" << endl;
label nOldSize = wrongFaces.size();
mesh.checkFacePyramids(false, minPyrVol, &wrongFaces);
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with illegal face pyramids" << endl;
}
if (maxConcave < 180.0-SMALL)
{
Pout<< "Checking face angles" << endl;
label nOldSize = wrongFaces.size();
mesh.checkFaceAngles(false, maxConcave, &wrongFaces);
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with concavity > " << maxConcave << " degrees"
<< endl;
}
if (minArea > -SMALL)
{
Pout<< "Checking face areas" << endl;
label nOldSize = wrongFaces.size();
const scalarField magFaceAreas = mag(mesh.faceAreas());
forAll(magFaceAreas, faceI)
{
if (magFaceAreas[faceI] < minArea)
{
wrongFaces.insert(faceI);
}
}
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with area < " << minArea << " m^2" << endl;
}
}
// Merge faces on the same patch (usually from exposing refinement)
// Can undo merges if these cause problems.
label mergePatchFaces
(
const scalar minCos,
const scalar concaveSin,
const bool snapMeshDict,
const Time& runTime,
polyMesh& mesh
)
{
// Patch face merging engine
combineFaces faceCombiner(mesh);
// Get all sets of faces that can be merged
labelListList allFaceSets(faceCombiner.getMergeSets(minCos, concaveSin));
label nFaceSets = returnReduce(allFaceSets.size(), sumOp<label>());
Info<< "Merging " << nFaceSets << " sets of faces." << endl;
if (nFaceSets > 0)
{
// Store the faces of the face sets
List<faceList> allFaceSetsFaces(allFaceSets.size());
forAll(allFaceSets, setI)
{
allFaceSetsFaces[setI] = IndirectList<face>
(
mesh.faces(),
allFaceSets[setI]
);
}
autoPtr<mapPolyMesh> map;
{
// Topology changes container
polyTopoChange meshMod(mesh);
// Merge all faces of a set into the first face of the set.
faceCombiner.setRefinement(allFaceSets, meshMod);
// Change the mesh (no inflation)
map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes. No other way to do this?
mesh.clearOut();
}
}
// Check for errors and undo
// ~~~~~~~~~~~~~~~~~~~~~~~~~
// Faces in error.
labelHashSet errorFaces;
if (snapMeshDict)
{
checkSnapMesh(runTime, mesh, errorFaces);
}
else
{
mesh.checkFacePyramids(false, -SMALL, &errorFaces);
}
// Sets where the master is in error
labelHashSet errorSets;
forAll(allFaceSets, setI)
{
label newMasterI = map().reverseFaceMap()[allFaceSets[setI][0]];
if (errorFaces.found(newMasterI))
{
errorSets.insert(setI);
}
}
label nErrorSets = returnReduce(errorSets.size(), sumOp<label>());
Info<< "Detected " << nErrorSets
<< " error faces on boundaries that have been merged."
<< " These will be restored to their original faces."
<< endl;
if (nErrorSets > 0)
{
// Renumber stored faces to new vertex numbering.
forAllConstIter(labelHashSet, errorSets, iter)
{
label setI = iter.key();
faceList& setFaceVerts = allFaceSetsFaces[setI];
forAll(setFaceVerts, i)
{
inplaceRenumber(map().reversePointMap(), setFaceVerts[i]);
// Debug: check that all points are still there.
forAll(setFaceVerts[i], j)
{
label newVertI = setFaceVerts[i][j];
if (newVertI < 0)
{
FatalErrorIn("mergePatchFaces")
<< "In set:" << setI << " old face labels:"
<< allFaceSets[setI] << " new face vertices:"
<< setFaceVerts[i] << " are unmapped vertices!"
<< abort(FatalError);
}
}
}
}
// Topology changes container
polyTopoChange meshMod(mesh);
// Restore faces
forAllConstIter(labelHashSet, errorSets, iter)
{
label setI = iter.key();
const labelList& setFaces = allFaceSets[setI];
const faceList& setFaceVerts = allFaceSetsFaces[setI];
label newMasterI = map().reverseFaceMap()[setFaces[0]];
// Restore. Get face properties.
label own = mesh.faceOwner()[newMasterI];
label zoneID = mesh.faceZones().whichZone(newMasterI);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = mesh.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(newMasterI)];
}
label patchI = mesh.boundaryMesh().whichPatch(newMasterI);
Pout<< "Restoring new master face " << newMasterI
<< " to vertices " << setFaceVerts[0] << endl;
// Modify the master face.
meshMod.setAction
(
polyModifyFace
(
setFaceVerts[0], // original face
newMasterI, // label of face
own, // owner
-1, // neighbour
false, // face flip
patchI, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
// Add the previously removed faces
for (label i = 1; i < setFaces.size(); i++)
{
Pout<< "Restoring removed face " << setFaces[i]
<< " with vertices " << setFaceVerts[i] << endl;
meshMod.setAction
(
polyAddFace
(
setFaceVerts[i], // vertices
own, // owner,
-1, // neighbour,
-1, // masterPointID,
-1, // masterEdgeID,
newMasterI, // masterFaceID,
false, // flipFaceFlux,
patchI, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
)
);
}
}
// Change the mesh (no inflation)
map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes. No other way to do this?
mesh.clearOut();
}
}
}
else
{
Info<< "No faces merged ..." << endl;
}
return nFaceSets;
}
// Remove points not used by any face or points used by only two faces where
// the edges are in line
label mergeEdges(const scalar minCos, polyMesh& mesh)
{
Info<< "Merging all points on surface that" << nl
<< "- are used by only two boundary faces and" << nl
<< "- make an angle with a cosine of more than " << minCos
<< "." << nl << endl;
// Point removal analysis engine
removePoints pointRemover(mesh);
// Count usage of points
boolList pointCanBeDeleted;
label nRemove = pointRemover.countPointUsage(minCos, pointCanBeDeleted);
if (nRemove > 0)
{
Info<< "Removing " << nRemove
<< " straight edge points ..." << endl;
// Topology changes container
polyTopoChange meshMod(mesh);
pointRemover.setRefinement(pointCanBeDeleted, meshMod);
// Change the mesh (no inflation)
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, false, true);
// Update fields
mesh.updateMesh(map);
// Move mesh (since morphing does not do this)
if (map().hasMotionPoints())
{
mesh.movePoints(map().preMotionPoints());
}
else
{
// Delete mesh volumes. No other way to do this?
mesh.clearOut();
}
}
else
{
Info<< "No straight edges simplified and no points removed ..." << endl;
}
return nRemove;
}
// Main program:
int main(int argc, char *argv[])
{
argList::validArgs.append("feature angle [0..180]");
argList::validOptions.insert("concaveAngle", "[0..180]");
argList::validOptions.insert("snapMesh", "");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar minCos = Foam::cos(featureAngle*mathematicalConstant::pi/180.0);
scalar concaveAngle = defaultConcaveAngle;
if (args.options().found("concaveAngle"))
{
concaveAngle = readScalar
(
IStringStream(args.options()["concaveAngle"])()
);
}
scalar concaveSin = Foam::sin(concaveAngle*mathematicalConstant::pi/180.0);
bool snapMeshDict = args.options().found("snapMesh");
Info<< "Merging all faces of a cell" << nl
<< " - which are on the same patch" << nl
<< " - which make an angle < " << featureAngle << " degrees"
<< nl
<< " (cos:" << minCos << ')' << nl
<< " - even when resulting face becomes concave by more than "
<< concaveAngle << " degrees" << nl
<< " (sin:" << concaveSin << ')' << nl
<< endl;
runTime++;
// Merge faces on same patch
label nChanged = mergePatchFaces
(
minCos,
concaveSin,
snapMeshDict,
runTime,
mesh
);
// Merge points on straight edges and remove unused points
if (snapMeshDict)
{
Info<< "Merging all 'loose' points on surface edges"
<< ", regardless of the angle they make." << endl;
// Surface bnound to be used to extrude. Merge all loose points.
nChanged += mergeEdges(-1, mesh);
}
else
{
nChanged += mergeEdges(minCos, mesh);
}
if (nChanged > 0)
{
Info<< "Writing morphed mesh to time " << runTime.timeName() << endl;
mesh.write();
}
else
{
Info<< "Mesh unchanged." << endl;
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
cellSplitter.C
modifyMesh.C
EXE = $(FOAM_APPBIN)/modifyMesh

View File

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-ltriSurface \
-lmeshTools \
-ldynamicMesh

View File

@ -0,0 +1,215 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
Foam::Tuple
Description
A 2 Tuple. Differs from Tuple in that the two elements can be different
type.
\*---------------------------------------------------------------------------*/
#ifndef Tuple_H
#define Tuple_H
#include "Istream.H"
#include "Ostream.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Type1, class Type2>
class Tuple;
template<class Type1, class Type2>
Istream& operator>>(Istream&, Tuple<Type1, Type2>&);
template<class Type1, class Type2>
Ostream& operator<<(Ostream&, const Tuple<Type1, Type2>&);
/*---------------------------------------------------------------------------*\
Class Tuple Declaration
\*---------------------------------------------------------------------------*/
template<class Type1, class Type2>
class Tuple
{
// Private data
Type1 first_;
Type2 second_;
public:
// Constructors
//- Null constructor for lists
inline Tuple()
{}
//- Construct from components
inline Tuple(const Type1& first, const Type2& second)
:
first_(first),
second_(second)
{}
//- Construct from Istream
inline Tuple(Istream& is)
{
// Read beginning of pair
is.readBegin("pair");
is >> first_ >> second_;
// Read end of pair
is.readEnd("pair");
// Check state of Istream
is.check("Tuple::Tuple(Istream&)");
}
// Member Functions
//- Return first
inline Type1 first() const
{
return first_;
}
//- Return first
inline Type1& first()
{
return first_;
}
//- Return second
inline Type2 second() const
{
return second_;
}
//- Return second
inline Type2& second()
{
return second_;
}
//- Return reverse pair
inline Tuple<Type1, Type2> reverseTuple() const
{
return Tuple<Type1, Type2>(second_, first_);
}
// Friend Operators
inline friend bool operator==
(
const Tuple<Type1, Type2>& a,
const Tuple<Type1, Type2>& b
)
{
return
(
(a.first_ == b.first_) && (a.second_ == b.second_)
);
}
inline friend bool operator!=
(
const Tuple<Type1, Type2>& a,
const Tuple<Type1, Type2>& b
)
{
return (!(a == b));
}
// IOstream Operators
friend Istream& operator>> <Type1, Type2>
(
Istream& is,
Tuple<Type1, Type2>& p
);
friend Ostream& operator<< <Type1, Type2>
(
Ostream& os,
const Tuple<Type1, Type2>& p
);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type1, class Type2>
Istream& operator>>(Istream& is, Tuple<Type1, Type2>& p)
{
// Read beginning of Tuple<Type, Type>
is.readBegin("Tuple<Type, Type>");
is >> p.first_ >> p.second_;
// Read end of Tuple<Type, Type>
is.readEnd("Tuple<Type, Type>");
// Check state of Ostream
is.check("Istream& operator>>(Istream&, Tuple<Type, Type>&)");
return is;
}
template<class Type1, class Type2>
Ostream& operator<<(Ostream& os, const Tuple<Type1, Type2>& p)
{
os << token::BEGIN_LIST
<< p.first_ << token::SPACE
<< p.second_
<< token::END_LIST;
// Check state of Ostream
os.check("Ostream& operator<<(Ostream&, const Tuple<Type, Type>&)");
return os;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,495 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
\*---------------------------------------------------------------------------*/
#include "cellSplitter.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "polyAddCell.H"
#include "polyAddFace.H"
#include "polyAddPoint.H"
#include "polyModifyFace.H"
#include "mapPolyMesh.H"
#include "meshTools.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cellSplitter, 0);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::cellSplitter::getFaceInfo
(
const label faceI,
label& patchID,
label& zoneID,
label& zoneFlip
) const
{
patchID = -1;
if (!mesh_.isInternalFace(faceI))
{
patchID = mesh_.boundaryMesh().whichPatch(faceI);
}
zoneID = mesh_.faceZones().whichZone(faceI);
zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
}
}
// Find the new owner of faceI (since the original cell has been split into
// newCells
Foam::label Foam::cellSplitter::newOwner
(
const label faceI,
const Map<labelList>& cellToCells
) const
{
label oldOwn = mesh_.faceOwner()[faceI];
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
if (fnd == cellToCells.end())
{
// Unsplit cell
return oldOwn;
}
else
{
// Look up index of face in the cells' faces.
const labelList& newCells = fnd();
const cell& cFaces = mesh_.cells()[oldOwn];
return newCells[findIndex(cFaces, faceI)];
}
}
Foam::label Foam::cellSplitter::newNeighbour
(
const label faceI,
const Map<labelList>& cellToCells
) const
{
label oldNbr = mesh_.faceNeighbour()[faceI];
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
if (fnd == cellToCells.end())
{
// Unsplit cell
return oldNbr;
}
else
{
// Look up index of face in the cells' faces.
const labelList& newCells = fnd();
const cell& cFaces = mesh_.cells()[oldNbr];
return newCells[findIndex(cFaces, faceI)];
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from components
Foam::cellSplitter::cellSplitter(const polyMesh& mesh)
:
mesh_(mesh),
addedPoints_()
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSplitter::~cellSplitter()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::cellSplitter::setRefinement
(
const Map<point>& cellToMidPoint,
polyTopoChange& meshMod
)
{
addedPoints_.clear();
addedPoints_.resize(cellToMidPoint.size());
//
// Introduce cellToMidPoints.
//
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label anchorPoint = mesh_.cellPoints()[cellI][0];
label addedPointI =
meshMod.setAction
(
polyAddPoint
(
iter(), // point
anchorPoint, // master point
-1, // zone for point
true // supports a cell
)
);
addedPoints_.insert(cellI, addedPointI);
//Pout<< "Added point " << addedPointI
// << iter() << " in cell " << cellI << " with centre "
// << mesh_.cellCentres()[cellI] << endl;
}
//
// Add cells (first one is modified original cell)
//
Map<labelList> cellToCells(cellToMidPoint.size());
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
// Cells created for this cell.
labelList newCells(cFaces.size());
// First pyramid is the original cell
newCells[0] = cellI;
// Add other pyramids
for (label i = 1; i < cFaces.size(); i++)
{
label addedCellI =
meshMod.setAction
(
polyAddCell
(
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
-1 // zone
)
);
newCells[i] = addedCellI;
}
cellToCells.insert(cellI, newCells);
//Pout<< "Split cell " << cellI
// << " with centre " << mesh_.cellCentres()[cellI] << nl
// << " faces:" << cFaces << nl
// << " into :" << newCells << endl;
}
//
// Introduce internal faces. These go from edges of the cell to the mid
// point.
//
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label midPointI = addedPoints_[cellI];
const cell& cFaces = mesh_.cells()[cellI];
const labelList& cEdges = mesh_.cellEdges()[cellI];
forAll(cEdges, i)
{
label edgeI = cEdges[i];
const edge& e = mesh_.edges()[edgeI];
// Get the faces on the cell using the edge
label face0, face1;
meshTools::getEdgeFaces(mesh_, cellI, edgeI, face0, face1);
// Get the cells on both sides of the face by indexing into cFaces.
// (since newly created cells are stored in cFaces order)
const labelList& newCells = cellToCells[cellI];
label cell0 = newCells[findIndex(cFaces, face0)];
label cell1 = newCells[findIndex(cFaces, face1)];
if (cell0 < cell1)
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
const face& f0 = mesh_.faces()[face0];
label index = findIndex(f0, e[0]);
bool edgeInFaceOrder = (f0[(index+1) % f0.size()] == e[1]);
// Check if cellI is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == cellI))
{
// edge used in face order.
newF[0] = e[1];
newF[1] = e[0];
newF[2] = midPointI;
}
else
{
newF[0] = e[0];
newF[1] = e[1];
newF[2] = midPointI;
}
// Now newF points away from cell0
meshMod.setAction
(
polyAddFace
(
newF, // face
cell0, // owner
cell1, // neighbour
-1, // master point
-1, // master edge
face0, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
)
);
}
else
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
const face& f1 = mesh_.faces()[face1];
label index = findIndex(f1, e[0]);
bool edgeInFaceOrder = (f1[(index+1) % f1.size()] == e[1]);
// Check if cellI is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == cellI))
{
// edge used in face order.
newF[0] = e[1];
newF[1] = e[0];
newF[2] = midPointI;
}
else
{
newF[0] = e[0];
newF[1] = e[1];
newF[2] = midPointI;
}
// Now newF points away from cell1
meshMod.setAction
(
polyAddFace
(
newF, // face
cell1, // owner
cell0, // neighbour
-1, // master point
-1, // master edge
face0, // master face for addition
false, // flux flip
-1, // patch for face
-1, // zone for face
false // face zone flip
)
);
}
}
}
//
// Update all existing faces for split owner or neighbour.
//
// Mark off affected face.
boolList faceUpToDate(mesh_.nFaces(), true);
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
faceUpToDate[faceI] = false;
}
}
forAll(faceUpToDate, faceI)
{
if (!faceUpToDate[faceI])
{
const face& f = mesh_.faces()[faceI];
if (mesh_.isInternalFace(faceI))
{
label newOwn = newOwner(faceI, cellToCells);
label newNbr = newNeighbour(faceI, cellToCells);
if (newOwn < newNbr)
{
meshMod.setAction
(
polyModifyFace
(
f,
faceI,
newOwn, // owner
newNbr, // neighbour
false, // flux flip
-1, // patch for face
false, // remove from zone
-1, // zone for face
false // face zone flip
)
);
}
else
{
meshMod.setAction
(
polyModifyFace
(
f.reverseFace(),
faceI,
newNbr, // owner
newOwn, // neighbour
false, // flux flip
-1, // patch for face
false, // remove from zone
-1, // zone for face
false // face zone flip
)
);
}
}
else
{
label newOwn = newOwner(faceI, cellToCells);
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
meshMod.setAction
(
polyModifyFace
(
mesh_.faces()[faceI],
faceI,
newOwn, // owner
-1, // neighbour
false, // flux flip
patchID, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face zone flip
)
);
}
faceUpToDate[faceI] = true;
}
}
}
void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
{
// Create copy since we're deleting entries. Only if both cell and added
// point get mapped do they get inserted.
Map<label> newAddedPoints(addedPoints_.size());
forAllConstIter(Map<label>, addedPoints_, iter)
{
label oldCellI = iter.key();
label newCellI = morphMap.reverseCellMap()[oldCellI];
label oldPointI = iter();
label newPointI = morphMap.reversePointMap()[oldPointI];
if (newCellI >= 0 && newPointI >= 0)
{
newAddedPoints.insert(newCellI, newPointI);
}
}
// Copy
addedPoints_.transfer(newAddedPoints);
}
// ************************************************************************* //

View File

@ -0,0 +1,151 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
Foam::cellSplitter
Description
Does pyramidal decomposition of selected cells. So all faces will become
base of pyramid with as top a user-supplied point (usually the cell centre)
SourceFiles
cellSplitter.C
\*---------------------------------------------------------------------------*/
#ifndef cellSplitter_H
#define cellSplitter_H
#include "Map.H"
#include "edge.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyTopoChange;
class mapPolyMesh;
class polyMesh;
/*---------------------------------------------------------------------------*\
Class cellSplitter Declaration
\*---------------------------------------------------------------------------*/
class cellSplitter
{
// Private data
//- Reference to mesh
const polyMesh& mesh_;
//- Per cell the mid point added.
Map<label> addedPoints_;
// Private Member Functions
//- Get patch and zone info for face
void getFaceInfo
(
const label faceI,
label& patchID,
label& zoneID,
label& zoneFlip
) const;
//- Find the new owner (if any) of the face.
label newOwner
(
const label faceI,
const Map<labelList>& cellToCells
) const;
//- Find the new neighbour (if any) of the face.
label newNeighbour
(
const label faceI,
const Map<labelList>& cellToCells
) const;
//- Disallow default bitwise copy construct
cellSplitter(const cellSplitter&);
//- Disallow default bitwise assignment
void operator=(const cellSplitter&);
public:
//- Runtime type information
ClassName("cellSplitter");
// Constructors
//- Construct from mesh
cellSplitter(const polyMesh& mesh);
// Destructor
~cellSplitter();
// Member Functions
// Edit
//- Insert mesh changes into meshMod.
// cellToMidPoint : cell to cut and position of its new midpoint
void setRefinement
(
const Map<point>& cellToMidPoint,
polyTopoChange& meshMod
);
//- Force recalculation of locally stored data on topological change
void updateMesh(const mapPolyMesh&);
// Access
//- Per cell the mid point added.
const Map<label>& addedPoints() const
{
return addedPoints_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,640 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Manipulates mesh elements.
Actions are:
(boundary)points:
- move
(boundary)edges:
- split and move introduced point
(boundary)faces:
- split(triangulate) and move introduced point
edges:
- collapse
cells:
- split into polygonal base pyramids around newly introduced mid
point
Is a bit of a loose collection of mesh change drivers.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "polyTopoChange.H"
#include "mapPolyMesh.H"
#include "boundaryCutter.H"
#include "cellSplitter.H"
#include "edgeCollapser.H"
#include "meshTools.H"
#include "Pair.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Locate point on patch. Returns (mesh) point label.
label findPoint(const primitivePatch& pp, const point& nearPoint)
{
const pointField& points = pp.points();
const labelList& meshPoints = pp.meshPoints();
// Find nearest and next nearest
scalar minDistSqr = GREAT;
label minI = -1;
scalar almostMinDistSqr = GREAT;
label almostMinI = -1;
forAll(meshPoints, i)
{
label pointI = meshPoints[i];
scalar distSqr = magSqr(nearPoint - points[pointI]);
if (distSqr < minDistSqr)
{
almostMinDistSqr = minDistSqr;
almostMinI = minI;
minDistSqr = distSqr;
minI = pointI;
}
else if (distSqr < almostMinDistSqr)
{
almostMinDistSqr = distSqr;
almostMinI = pointI;
}
}
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest point : " << minI
<< " distance " << Foam::sqrt(minDistSqr)
<< " at " << points[minI] << nl
<< " next nearest point : " << almostMinI
<< " distance " << Foam::sqrt(almostMinDistSqr)
<< " at " << points[almostMinI] << endl;
if (almostMinDistSqr < 4*minDistSqr)
{
Info<< "Next nearest too close to nearest. Aborting" << endl;
return -1;
}
else
{
return minI;
}
}
// Locate edge on patch. Return mesh edge label.
label findEdge
(
const primitiveMesh& mesh,
const primitivePatch& pp,
const point& nearPoint
)
{
const pointField& localPoints = pp.localPoints();
const pointField& points = pp.points();
const labelList& meshPoints = pp.meshPoints();
const edgeList& edges = pp.edges();
// Find nearest and next nearest
scalar minDist = GREAT;
label minI = -1;
scalar almostMinDist = GREAT;
label almostMinI = -1;
forAll(edges, edgeI)
{
const edge& e = edges[edgeI];
pointHit pHit(e.line(localPoints).nearestDist(nearPoint));
if (pHit.hit())
{
if (pHit.distance() < minDist)
{
almostMinDist = minDist;
almostMinI = minI;
minDist = pHit.distance();
minI = meshTools::findEdge
(
mesh,
meshPoints[e[0]],
meshPoints[e[1]]
);
}
else if (pHit.distance() < almostMinDist)
{
almostMinDist = pHit.distance();
almostMinI = meshTools::findEdge
(
mesh,
meshPoints[e[0]],
meshPoints[e[1]]
);
}
}
}
if (minI == -1)
{
Info<< "Did not find edge close to point " << nearPoint << endl;
return -1;
}
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest edge : " << minI
<< " distance " << minDist << " endpoints "
<< mesh.edges()[minI].line(points) << nl
<< " next nearest edge : " << almostMinI
<< " distance " << almostMinDist << " endpoints "
<< mesh.edges()[almostMinI].line(points) << nl
<< endl;
if (almostMinDist < 2*minDist)
{
Info<< "Next nearest too close to nearest. Aborting" << endl;
return -1;
}
else
{
return minI;
}
}
// Find face on patch. Return mesh face label.
label findFace
(
const primitiveMesh& mesh,
const primitivePatch& pp,
const point& nearPoint
)
{
const pointField& points = pp.points();
// Find nearest and next nearest
scalar minDist = GREAT;
label minI = -1;
scalar almostMinDist = GREAT;
label almostMinI = -1;
forAll(pp, patchFaceI)
{
pointHit pHit(pp[patchFaceI].nearestPoint(nearPoint, points));
if (pHit.hit())
{
if (pHit.distance() < minDist)
{
almostMinDist = minDist;
almostMinI = minI;
minDist = pHit.distance();
minI = patchFaceI + mesh.nInternalFaces();
}
else if (pHit.distance() < almostMinDist)
{
almostMinDist = pHit.distance();
almostMinI = patchFaceI + mesh.nInternalFaces();
}
}
}
if (minI == -1)
{
Info<< "Did not find face close to point " << nearPoint << endl;
return -1;
}
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest face : " << minI
<< " distance " << minDist
<< " to face centre " << mesh.faceCentres()[minI] << nl
<< " next nearest face : " << almostMinI
<< " distance " << almostMinDist
<< " to face centre " << mesh.faceCentres()[almostMinI] << nl
<< endl;
if (almostMinDist < 2*minDist)
{
Info<< "Next nearest too close to nearest. Aborting" << endl;
return -1;
}
else
{
return minI;
}
}
// Find cell with cell centre close to given point.
label findCell(const primitiveMesh& mesh, const point& nearPoint)
{
label cellI = mesh.findCell(nearPoint);
if (cellI != -1)
{
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[cellI]);
const labelList& cPoints = mesh.cellPoints()[cellI];
label minI = -1;
scalar minDistSqr = GREAT;
forAll(cPoints, i)
{
label pointI = cPoints[i];
scalar distSqr = magSqr(nearPoint - mesh.points()[pointI]);
if (distSqr < minDistSqr)
{
minDistSqr = distSqr;
minI = pointI;
}
}
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest cell : " << cellI
<< " distance " << Foam::sqrt(distToCcSqr)
<< " to cell centre " << mesh.cellCentres()[cellI] << nl
<< " nearest mesh point : " << minI
<< " distance " << Foam::sqrt(minDistSqr)
<< " to " << mesh.points()[minI] << nl
<< endl;
if (minDistSqr < 4*distToCcSqr)
{
Info<< "Mesh point too close to nearest cell centre. Aborting"
<< endl;
cellI = -1;
}
}
return cellI;
}
// Main program:
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
Info<< "Reading modifyMeshDict\n" << endl;
IOdictionary dict
(
IOobject
(
"modifyMeshDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
// Read all from the dictionary.
List<Pair<point> > pointsToMove(dict.lookup("pointsToMove"));
List<Pair<point> > edgesToSplit(dict.lookup("edgesToSplit"));
List<Pair<point> > facesToTriangulate
(
dict.lookup("facesToTriangulate")
);
bool cutBoundary =
pointsToMove.size() > 0
|| edgesToSplit.size() > 0
|| facesToTriangulate.size() > 0;
List<Pair<point> > edgesToCollapse(dict.lookup("edgesToCollapse"));
bool collapseEdge = edgesToCollapse.size() > 0;
List<Pair<point> > cellsToPyramidise(dict.lookup("cellsToSplit"));
bool cellsToSplit = cellsToPyramidise.size() > 0;
//List<Tuple<pointField,point> >
// cellsToCreate(dict.lookup("cellsToCreate"));
Info<< "Read from " << dict.name() << nl
<< " Boundary cutting module:" << nl
<< " points to move :" << pointsToMove.size() << nl
<< " edges to split :" << edgesToSplit.size() << nl
<< " faces to triangulate:" << facesToTriangulate.size() << nl
<< " Cell splitting module:" << nl
<< " cells to split :" << cellsToPyramidise.size() << nl
<< " Edge collapsing module:" << nl
<< " edges to collapse :" << edgesToCollapse.size() << nl
//<< " cells to create :" << cellsToCreate.size() << nl
<< endl;
if
(
(cutBoundary && collapseEdge)
|| (cutBoundary && cellsToSplit)
|| (collapseEdge && cellsToSplit)
)
{
FatalErrorIn(args.executable())
<< "Used more than one mesh modifying module "
<< "(boundary cutting, cell splitting, edge collapsing)" << nl
<< "Please do them in separate passes." << exit(FatalError);
}
// Get calculating engine for all of outside
const SubList<face> outsideFaces
(
mesh.faces(),
mesh.nFaces() - mesh.nInternalFaces(),
mesh.nInternalFaces()
);
primitivePatch allBoundary(outsideFaces, mesh.points());
// Look up mesh labels and convert to input for boundaryCutter.
bool validInputs = true;
Info<< nl << "Looking up points to move ..." << nl << endl;
Map<point> pointToPos(pointsToMove.size());
forAll(pointsToMove, i)
{
const Pair<point>& pts = pointsToMove[i];
label pointI = findPoint(allBoundary, pts.first());
if (pointI == -1 || !pointToPos.insert(pointI, pts.second()))
{
Info<< "Could not insert mesh point " << pointI
<< " for input point " << pts.first() << nl
<< "Perhaps the point is already marked for moving?" << endl;
validInputs = false;
}
}
Info<< nl << "Looking up edges to split ..." << nl << endl;
Map<List<point> > edgeToCuts(edgesToSplit.size());
forAll(edgesToSplit, i)
{
const Pair<point>& pts = edgesToSplit[i];
label edgeI = findEdge(mesh, allBoundary, pts.first());
if
(
edgeI == -1
|| !edgeToCuts.insert(edgeI, List<point>(1, pts.second()))
)
{
Info<< "Could not insert mesh edge " << edgeI
<< " for input point " << pts.first() << nl
<< "Perhaps the edge is already marked for cutting?" << endl;
validInputs = false;
}
}
Info<< nl << "Looking up faces to triangulate ..." << nl << endl;
Map<point> faceToDecompose(facesToTriangulate.size());
forAll(facesToTriangulate, i)
{
const Pair<point>& pts = facesToTriangulate[i];
label faceI = findFace(mesh, allBoundary, pts.first());
if (faceI == -1 || !faceToDecompose.insert(faceI, pts.second()))
{
Info<< "Could not insert mesh face " << faceI
<< " for input point " << pts.first() << nl
<< "Perhaps the face is already marked for splitting?" << endl;
validInputs = false;
}
}
Info<< nl << "Looking up cells to convert to pyramids around"
<< " cell centre ..." << nl << endl;
Map<point> cellToPyrCentre(cellsToPyramidise.size());
forAll(cellsToPyramidise, i)
{
const Pair<point>& pts = cellsToPyramidise[i];
label cellI = findCell(mesh, pts.first());
if (cellI == -1 || !cellToPyrCentre.insert(cellI, pts.second()))
{
Info<< "Could not insert mesh cell " << cellI
<< " for input point " << pts.first() << nl
<< "Perhaps the cell is already marked for splitting?" << endl;
validInputs = false;
}
}
Info<< nl << "Looking up edges to collapse ..." << nl << endl;
Map<point> edgeToPos(edgesToCollapse.size());
forAll(edgesToCollapse, i)
{
const Pair<point>& pts = edgesToCollapse[i];
label edgeI = findEdge(mesh, allBoundary, pts.first());
if (edgeI == -1 || !edgeToPos.insert(edgeI, pts.second()))
{
Info<< "Could not insert mesh edge " << edgeI
<< " for input point " << pts.first() << nl
<< "Perhaps the edge is already marked for collaping?" << endl;
validInputs = false;
}
}
if (!validInputs)
{
Info<< nl << "There was a problem in one of the inputs in the"
<< " dictionary. Not modifying mesh." << endl;
}
else if (cellToPyrCentre.size() > 0)
{
Info<< nl << "All input cells located. Modifying mesh." << endl;
// Mesh change engine
cellSplitter cutter(mesh);
// Topo change container
polyTopoChange meshMod(mesh);
// Insert commands into meshMod
cutter.setRefinement(cellToPyrCentre, meshMod);
// Do changes
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
cutter.updateMesh(morphMap());
runTime++;
// Write resulting mesh
Info << "Writing modified mesh to time " << runTime.value() << endl;
mesh.write();
}
else if (edgeToPos.size() > 0)
{
Info<< nl << "All input edges located. Modifying mesh." << endl;
// Mesh change engine
edgeCollapser cutter(mesh);
pointField newPoints(mesh.points());
// Get new positions and construct collapse network
forAllConstIter(Map<point>, edgeToPos, iter)
{
label edgeI = iter.key();
const edge& e = mesh.edges()[edgeI];
cutter.collapseEdge(edgeI, e[0]);
newPoints[e[0]] = iter();
}
// Move master point to destination.
mesh.movePoints(newPoints);
// Topo change container
polyTopoChange meshMod(mesh);
// Insert
cutter.setRefinement(meshMod);
// Do changes
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
// Not implemented yet:
//cutter.updateMesh(morphMap());
runTime++;
// Write resulting mesh
Info << "Writing modified mesh to time " << runTime.value() << endl;
mesh.write();
}
else
{
Info<< nl << "All input points located. Modifying mesh." << endl;
// Mesh change engine
boundaryCutter cutter(mesh);
// Topo change container
polyTopoChange meshMod(mesh);
// Insert commands into meshMod
cutter.setRefinement
(
pointToPos,
edgeToCuts,
Map<labelPair>(0), // Faces to split diagonally
faceToDecompose, // Faces to triangulate
meshMod
);
// Do changes
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
cutter.updateMesh(morphMap());
runTime++;
// Write resulting mesh
Info << "Writing modified mesh to time " << runTime.value() << endl;
mesh.write();
}
Info << nl << "End" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,93 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.2/run/icoFoam";
case "cavityTut";
instance "system";
local "";
class dictionary;
object modifyMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Move points:
// Every entry is two coordinates. First one is location of the point to move,
// the second is the position to move to.
pointsToMove
(
(( -0.17861 -0.45073 0.75276)( -0.18 -0.45073 0.75276))
);
// Split edge in two:
// First coord is a point on the edge to cut, second is the position of the
// newly introduced point
edgesToSplit
(
(( -0.17692 -0.45312 0.74516)( -0.18 -0.45 0.742))
);
// Triangulate a face:
// First coord is a point on the face to triangulate. It will introduce a
// point on the face, triangulate and move the point to the second coordinate.
facesToTriangulate
(
(( -0.039123 -0.45045 0.74083) (-0.03844 -0.45049 0.73572))
);
// Edges to collapse. First coord is point on the edge, second is coordinate
// to collapse to.
edgesToCollapse
(
((0.054975 0.099987 0.0044074)(0.054975 0.099987 0.0044074))
);
// Split cells:
// First coord is a point inside the cell to split. A point inside the cell will
// be introduced and the cell will get decomposed into polygonal base pyramids
// with this new point as top. (so the original faces will not get split)
cellsToSplit
(
(( -0.039123 -0.45045 0.74083) (-0.03844 -0.45049 0.73572))
);
// Change patch:
// Changes patchID of faces. Coord selects the face, label is the patch index.
facesToRepatch
(
(( -0.039123 -0.45045 0.74083) 1)
);
//// Create cell:
//// Creates a cell on the boundary given a face covering a cavity. Gets
//// the vertices of the face (outwards pointing normal) and a point internal
//// to the new cell. (used to check the orientation of the face). Walks all
//// boundary faces reachable from any edge on the face and constructs cell
//// from it.
//cellsToCreate
//(
// (
// ((0 0 0) (1 0 0) (1 1 0) (0 1 0)) // vertices of face
// (0.5 0.5 0.1) // cell centre
// )
//);
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
refineWallLayer.C
EXE = $(FOAM_APPBIN)/refineWallLayer

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-lmeshTools

View File

@ -0,0 +1,238 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Utility to refine cells next to patches. Takes a patchName
and number of layers to refine. Works out cells within these layers
and refines those in the wall-normal direction.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "polyTopoChanger.H"
#include "mapPolyMesh.H"
#include "polyMesh.H"
#include "cellCuts.H"
#include "cellSet.H"
#include "meshCutter.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Foam::argList::noParallel();
Foam::argList::validArgs.append("patchName");
Foam::argList::validArgs.append("edgeWeight");
Foam::argList::validOptions.insert("useSet", "cellSet");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
word patchName(args.additionalArgs()[0]);
scalar weight(readScalar(IStringStream(args.additionalArgs()[1])()));
label patchID = mesh.boundaryMesh().findPatchID(patchName);
if (patchID == -1)
{
FatalErrorIn(args.executable())
<< "Cannot find patch " << patchName << endl
<< "Valid patches are " << mesh.boundaryMesh().names()
<< exit(FatalError);
}
const polyPatch& pp = mesh.boundaryMesh()[patchID];
// Cells cut
labelHashSet cutCells(4*pp.size());
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, pointI)
{
label meshPointI = meshPoints[pointI];
const labelList& pCells = mesh.pointCells()[meshPointI];
forAll(pCells, pCellI)
{
cutCells.insert(pCells[pCellI]);
}
}
Info<< "Selected " << cutCells.size()
<< " cells connected to patch " << pp.name() << endl << endl;
//
// List of cells to refine
//
bool useSet = args.options().found("useSet");
if (useSet)
{
word setName(args.options()["useSet"]);
Info<< "Subsetting cells to cut based on cellSet" << setName << endl
<< endl;
cellSet cells(mesh, setName);
Info<< "Read " << cells.size() << " cells from cellSet "
<< cells.instance()/cells.local()/cells.name()
<< endl << endl;
for
(
cellSet::const_iterator iter = cells.begin();
iter != cells.end();
++iter
)
{
cutCells.erase(iter.key());
}
Info<< "Removed from cells to cut all the ones not in set " << setName
<< endl << endl;
}
// Mark all meshpoints on patch
boolList vertOnPatch(mesh.nPoints(), false);
forAll(meshPoints, pointI)
{
label meshPointI = meshPoints[pointI];
vertOnPatch[meshPointI] = true;
}
// Mark cut edges.
DynamicList<label> allCutEdges(pp.nEdges());
DynamicList<scalar> allCutEdgeWeights(pp.nEdges());
forAll(meshPoints, pointI)
{
label meshPointI = meshPoints[pointI];
const labelList& pEdges = mesh.pointEdges()[meshPointI];
forAll(pEdges, pEdgeI)
{
label edgeI = pEdges[pEdgeI];
const edge& e = mesh.edges()[edgeI];
label otherPointI = e.otherVertex(meshPointI);
if (!vertOnPatch[otherPointI])
{
allCutEdges.append(edgeI);
if (e.start() == meshPointI)
{
allCutEdgeWeights.append(weight);
}
else
{
allCutEdgeWeights.append(1 - weight);
}
}
}
}
allCutEdges.shrink();
allCutEdgeWeights.shrink();
Info<< "Cutting:" << endl
<< " cells:" << cutCells.size() << endl
<< " edges:" << allCutEdges.size() << endl
<< endl;
// Transfer DynamicLists to straight ones.
labelList cutEdges;
cutEdges.transfer(allCutEdges);
allCutEdges.clear();
scalarField cutEdgeWeights;
cutEdgeWeights.transfer(allCutEdgeWeights);
allCutEdgeWeights.clear();
// Gets cuts across cells from cuts through edges.
cellCuts cuts
(
mesh,
cutCells.toc(), // cells candidate for cutting
labelList(0), // cut vertices
cutEdges, // cut edges
cutEdgeWeights // weight on cut edges
);
polyTopoChange meshMod(mesh);
// Cutting engine
meshCutter cutter(mesh);
// Insert mesh refinement into polyTopoChange.
cutter.setRefinement(cuts, meshMod);
// Do all changes
Info<< "Morphing ..." << endl;
runTime++;
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
// Update stored labels on meshCutter.
cutter.updateMesh(morphMap());
// Write resulting mesh
Info << "Writing refined morphMesh to time " << runTime.value() << endl;
mesh.write();
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// refinementLevel tool definition
description "Estimates the refinement level on refined cartesian meshes";
refinementLevelDict
{
type dictionary;
description "refinementLevel control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseArguments;
entries
{
include "$FOAMX_CONFIG/entries/arguments/readLevel";
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
refinementLevel.C
EXE = $(FOAM_APPBIN)/refinementLevel

View File

@ -0,0 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools

View File

@ -0,0 +1,363 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Tries to figure out what the refinement level is on refined cartesian
meshes. Run BEFORE snapping.
Writes
- volScalarField 'refinementLevel' with current refinement level.
- cellSet 'refCells' which are the cells that need to be refined to satisfy
2:1 refinement.
Works by dividing cells into volume bins.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "cellSet.H"
#include "SortableList.H"
#include "labelIOList.H"
#include "fvMesh.H"
#include "volFields.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Return true if any cells had to be split to keep a difference between
// neighbouring refinement levels < limitDiff. Puts cells into refCells and
// update refLevel to account for refinement.
bool limitRefinementLevel
(
const primitiveMesh& mesh,
labelList& refLevel,
cellSet& refCells
)
{
const labelListList& cellCells = mesh.cellCells();
label oldNCells = refCells.size();
forAll(cellCells, cellI)
{
const labelList& cCells = cellCells[cellI];
forAll(cCells, i)
{
if (refLevel[cCells[i]] > (refLevel[cellI]+1))
{
// Found neighbour with >=2 difference in refLevel.
refCells.insert(cellI);
refLevel[cellI]++;
break;
}
}
}
if (refCells.size() > oldNCells)
{
Info<< "Added an additional " << refCells.size() - oldNCells
<< " cells to satisfy 1:2 refinement level"
<< endl;
return true;
}
else
{
return false;
}
}
// Main program:
int main(int argc, char *argv[])
{
argList::validOptions.insert("readLevel", "");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
Info<< "Dividing cells into bins depending on cell volume.\nThis will"
<< " correspond to refinement levels for a mesh with only 2x2x2"
<< " refinement\n"
<< "The upper range for every bin is always 1.1 times the lower range"
<< " to allow for some truncation error."
<< nl << endl;
bool readLevel = args.options().found("readLevel");
const scalarField& vols = mesh.cellVolumes();
SortableList<scalar> sortedVols(vols);
// All cell labels, sorted per bin.
DynamicList<DynamicList<label> > bins;
// Lower/upper limits
DynamicList<scalar> lowerLimits;
DynamicList<scalar> upperLimits;
// Create bin0. Have upperlimit as factor times lowerlimit.
bins.append(DynamicList<label>());
lowerLimits.append(sortedVols[0]);
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
forAll(sortedVols, i)
{
if (sortedVols[i] > upperLimits[upperLimits.size()-1])
{
// New value outside of current bin
// Shrink old bin.
DynamicList<label>& bin = bins[bins.size()-1];
bin.shrink();
Info<< "Collected " << bin.size() << " elements in bin "
<< lowerLimits[lowerLimits.size()-1] << " .. "
<< upperLimits[upperLimits.size()-1] << endl;
// Create new bin.
bins.append(DynamicList<label>());
lowerLimits.append(sortedVols[i]);
upperLimits.append(1.1*lowerLimits[lowerLimits.size()-1]);
Info<< "Creating new bin " << lowerLimits[lowerLimits.size()-1]
<< " .. " << upperLimits[upperLimits.size()-1]
<< endl;
}
// Append to current bin.
DynamicList<label>& bin = bins[bins.size()-1];
bin.append(sortedVols.indices()[i]);
}
Info<< endl;
bins[bins.size()-1].shrink();
bins.shrink();
lowerLimits.shrink();
upperLimits.shrink();
//
// Write to cellSets.
//
Info<< "Volume bins:" << nl;
forAll(bins, binI)
{
const DynamicList<label>& bin = bins[binI];
cellSet cells(mesh, "vol" + name(binI), bin.size());
forAll(bin, i)
{
cells.insert(bin[i]);
}
Info<< " " << lowerLimits[binI] << " .. " << upperLimits[binI]
<< " : writing " << bin.size() << " cells to cellSet "
<< cells.name() << endl;
cells.write();
}
//
// Convert bins into refinement level.
//
// Construct fvMesh to be able to construct volScalarField
fvMesh fMesh
(
IOobject
(
fvMesh::defaultRegion,
runTime.timeName(),
runTime
),
mesh.points(),
mesh.faces(),
mesh.cells()
);
// Add the boundary patches
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> p(patches.size());
forAll (p, patchI)
{
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
}
fMesh.addFvPatches(p);
// Refinement level
IOobject refHeader
(
"refinementLevel",
runTime.timeName(),
polyMesh::defaultRegion,
runTime
);
if (!readLevel && refHeader.headerOk())
{
WarningIn(args.executable())
<< "Detected " << refHeader.name() << " file in "
<< polyMesh::defaultRegion << " directory. Please remove to"
<< " recreate it or use the -readLevel option to use it"
<< endl;
return 1;
}
labelIOList refLevel
(
IOobject
(
"refinementLevel",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
labelList(mesh.nCells(), 0)
);
if (readLevel)
{
refLevel = labelIOList(refHeader);
}
// Construct volScalarField with same info for post processing
volScalarField postRefLevel
(
IOobject
(
"refinementLevel",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
fMesh,
dimensionedScalar("zero", dimless/dimTime, 0)
);
// Set cell values
forAll(bins, binI)
{
const DynamicList<label>& bin = bins[binI];
forAll(bin, i)
{
refLevel[bin[i]] = bins.size() - binI - 1;
postRefLevel[bin[i]] = refLevel[bin[i]];
}
}
// For volScalarField: set boundary values to same as cell.
// Note: could also put
// zeroGradient b.c. on postRefLevel and do evaluate.
forAll(postRefLevel.boundaryField(), patchI)
{
const polyPatch& pp = patches[patchI];
fvPatchScalarField& bField = postRefLevel.boundaryField()[patchI];
Info<< "Setting field for patch "<< endl;
forAll(bField, faceI)
{
label own = mesh.faceOwner()[pp.start() + faceI];
bField[faceI] = postRefLevel[own];
}
}
Info<< "Determined current refinement level and writing to "
<< postRefLevel.name() << " (as volScalarField; for post processing)"
<< nl
<< polyMesh::defaultRegion/refLevel.name()
<< " (as labelIOList; for meshing)" << nl
<< endl;
refLevel.write();
postRefLevel.write();
// Find out cells to refine to keep to 2:1 refinement level restriction
// Cells to refine
cellSet refCells(mesh, "refCells", 100);
while
(
limitRefinementLevel
(
mesh,
refLevel, // current refinement level
refCells // cells to refine
)
);
if (refCells.size() > 0)
{
Info<< "Collected " << refCells.size() << " cells that need to be"
<< " refined to get closer to overall 2:1 refinement level limit"
<< nl
<< "Written cells to be refined to cellSet " << refCells.name()
<< nl << endl;
refCells.write();
Info<< "After refinement this tool can be run again to see if the 2:1"
<< " limit is observed all over the mesh" << nl << endl;
}
else
{
Info<< "All cells in the mesh observe the 2:1 refinement level limit"
<< nl << endl;
}
Info << nl << "End" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
removeFaces.C
EXE = $(FOAM_APPBIN)/removeFaces

View File

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lmeshTools \
-ldynamicMesh \
-lfiniteVolume

View File

@ -0,0 +1,174 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Utility to remove faces (combines cells on both sides).
Takes faceSet of candidates for removal and writes faceSet with faces that
will actually be removed. (because e.g. would cause two faces between the
same cells). See removeFaces in dynamicMesh library for constraints.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "faceSet.H"
#include "removeFaces.H"
#include "ReadFields.H"
#include "volFields.H"
#include "surfaceFields.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
int main(int argc, char *argv[])
{
Foam::argList::validArgs.append("faceSet");
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
word setName(args.additionalArgs()[0]);
// Read faces
faceSet candidateSet(mesh, setName);
Pout<< "Read " << candidateSet.size() << " faces to remove" << nl
<< endl;
labelList candidates(candidateSet.toc());
// Face removal engine. No checking for not merging boundary faces.
removeFaces faceRemover(mesh, 2);
// Get compatible set of faces and connected sets of cells.
labelList cellRegion;
labelList cellRegionMaster;
labelList facesToRemove;
faceRemover.compatibleRemoves
(
candidates,
cellRegion,
cellRegionMaster,
facesToRemove
);
{
faceSet compatibleRemoves(mesh, "compatibleRemoves", facesToRemove);
Pout<< "Original faces to be removed:" << candidateSet.size() << nl
<< "New faces to be removed:" << compatibleRemoves.size() << nl
<< endl;
Pout<< "Writing new faces to be removed to faceSet "
<< compatibleRemoves.instance()
/compatibleRemoves.local()
/compatibleRemoves.name()
<< endl;
compatibleRemoves.write();
}
// Read objects in time directory
IOobjectList objects(mesh, runTime.timeName());
// Read vol fields.
PtrList<volScalarField> vsFlds;
ReadFields(mesh, objects, vsFlds);
PtrList<volVectorField> vvFlds;
ReadFields(mesh, objects, vvFlds);
PtrList<volSphericalTensorField> vstFlds;
ReadFields(mesh, objects, vstFlds);
PtrList<volSymmTensorField> vsymtFlds;
ReadFields(mesh, objects, vsymtFlds);
PtrList<volTensorField> vtFlds;
ReadFields(mesh, objects, vtFlds);
// Read surface fields.
PtrList<surfaceScalarField> ssFlds;
ReadFields(mesh, objects, ssFlds);
PtrList<surfaceVectorField> svFlds;
ReadFields(mesh, objects, svFlds);
PtrList<surfaceSphericalTensorField> sstFlds;
ReadFields(mesh, objects, sstFlds);
PtrList<surfaceSymmTensorField> ssymtFlds;
ReadFields(mesh, objects, ssymtFlds);
PtrList<surfaceTensorField> stFlds;
ReadFields(mesh, objects, stFlds);
// Topo changes container
polyTopoChange meshMod(mesh);
// Insert mesh refinement into polyTopoChange.
faceRemover.setRefinement
(
facesToRemove,
cellRegion,
cellRegionMaster,
meshMod
);
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
mesh.updateMesh(morphMap);
// Move mesh (since morphing does not do this)
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
// Update numbering of cells/vertices.
faceRemover.updateMesh(morphMap);
runTime++;
// Take over refinement levels and write to new time directory.
Pout<< "Writing mesh to time " << runTime.timeName() << endl;
mesh.write();
Pout<< "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,5 @@
edgeStats.C
selectCells.C
EXE = $(FOAM_APPBIN)/selectCells

View File

@ -0,0 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-lmeshTools \
-ltriSurface \
-llagrangian

View File

@ -0,0 +1,222 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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 "edgeStats.H"
#include "Time.H"
#include "polyMesh.H"
#include "Ostream.H"
#include "twoDPointCorrector.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::edgeStats::edgeTol_ = 1E-3;
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
Foam::direction Foam::edgeStats::getNormalDir
(
const twoDPointCorrector* correct2DPtr
) const
{
direction dir = 3;
if (correct2DPtr)
{
const vector& normal = correct2DPtr->planeNormal();
if (mag(normal & vector(1, 0, 0)) > 1-edgeTol_)
{
dir = 0;
}
else if (mag(normal & vector(0, 1, 0)) > 1-edgeTol_)
{
dir = 1;
}
else if (mag(normal & vector(0, 0, 1)) > 1-edgeTol_)
{
dir = 2;
}
}
return dir;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from mesh
Foam::edgeStats::edgeStats(const polyMesh& mesh)
:
mesh_(mesh),
normalDir_(3)
{
IOobject motionObj
(
"motionProperties",
mesh.time().constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
);
if (motionObj.headerOk())
{
Info<< "Reading " << mesh.time().constant() / "motionProperties"
<< endl << endl;
IOdictionary motionProperties(motionObj);
Switch twoDMotion(motionProperties.lookup("twoDMotion"));
if (twoDMotion)
{
Info<< "Correcting for 2D motion" << endl << endl;
autoPtr<twoDPointCorrector> correct2DPtr
(
new twoDPointCorrector(mesh)
);
normalDir_ = getNormalDir(&correct2DPtr());
}
}
}
// Construct from components
Foam::edgeStats::edgeStats
(
const polyMesh& mesh,
const twoDPointCorrector* correct2DPtr
)
:
mesh_(mesh),
normalDir_(getNormalDir(correct2DPtr))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::scalar Foam::edgeStats::minLen(Ostream& os) const
{
label nX = 0;
label nY = 0;
label nZ = 0;
scalar minX = GREAT;
scalar maxX = -GREAT;
vector x(1, 0, 0);
scalar minY = GREAT;
scalar maxY = -GREAT;
vector y(0, 1, 0);
scalar minZ = GREAT;
scalar maxZ = -GREAT;
vector z(0, 0, 1);
scalar minOther = GREAT;
scalar maxOther = -GREAT;
const edgeList& edges = mesh_.edges();
forAll(edges, edgeI)
{
const edge& e = edges[edgeI];
vector eVec(e.vec(mesh_.points()));
scalar eMag = mag(eVec);
eVec /= eMag;
if (mag(eVec & x) > 1-edgeTol_)
{
minX = min(minX, eMag);
maxX = max(maxX, eMag);
nX++;
}
else if (mag(eVec & y) > 1-edgeTol_)
{
minY = min(minY, eMag);
maxY = max(maxY, eMag);
nY++;
}
else if (mag(eVec & z) > 1-edgeTol_)
{
minZ = min(minZ, eMag);
maxZ = max(maxZ, eMag);
nZ++;
}
else
{
minOther = min(minOther, eMag);
maxOther = max(maxOther, eMag);
}
}
os << "Mesh bounding box:" << boundBox(mesh_.points()) << nl << nl
<< "Mesh edge statistics:" << nl
<< " x aligned : number:" << nX << "\tminLen:" << minX
<< "\tmaxLen:" << maxX << nl
<< " y aligned : number:" << nY << "\tminLen:" << minY
<< "\tmaxLen:" << maxY << nl
<< " z aligned : number:" << nZ << "\tminLen:" << minZ
<< "\tmaxLen:" << maxZ << nl
<< " other : number:" << mesh_.nEdges() - nX - nY - nZ
<< "\tminLen:" << minOther
<< "\tmaxLen:" << maxOther << nl << endl;
if (normalDir_ == 0)
{
return min(minY, min(minZ, minOther));
}
else if (normalDir_ == 1)
{
return min(minX, min(minZ, minOther));
}
else if (normalDir_ == 2)
{
return min(minX, min(minY, minOther));
}
else
{
return min(minX, min(minY, min(minZ, minOther)));
}
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Class
Foam::edgeStats
Description
Helper class to calculate minimum edge length on mesh.
SourceFiles
edgeStats.C
\*---------------------------------------------------------------------------*/
#ifndef edgeStats_H
#define edgeStats_H
#include "direction.H"
#include "scalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of classes
class polyMesh;
class Ostream;
class twoDPointCorrector;
/*---------------------------------------------------------------------------*\
Class edgeStats Declaration
\*---------------------------------------------------------------------------*/
class edgeStats
{
// Private data
//- Reference to mesh.
const polyMesh& mesh_;
//- Component (0,1,2) of normal direction or 3 if 3D case.
direction normalDir_;
// Private Member Functions
//- If 2d get component of normal dir.
direction getNormalDir(const twoDPointCorrector*) const;
//- Disallow default bitwise copy construct
edgeStats(const edgeStats&);
//- Disallow default bitwise assignment
void operator=(const edgeStats&);
public:
// Static data members
// Max (cos of) angle for edges to be considered aligned with axis.
static const scalar edgeTol_;
// Constructors
//- Construct from mesh
edgeStats(const polyMesh& mesh);
//- Construct from mesh and corrector
edgeStats(const polyMesh& mesh, const twoDPointCorrector* );
// Member Functions
//- Calculate minimum edge length and print
scalar minLen(Ostream& os) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,527 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Select cells in relation to surface.
Divides cells into three sets:
- cutCells : cells cut by surface or close to surface.
- outside : cells not in cutCells and reachable from set of
user-defined points (outsidePoints)
- inside : same but not reachable.
Finally the wanted sets are combined into a cellSet 'selected'. Apart
from straightforward adding the contents there are a few extra rules to
make sure that the surface of the 'outside' of the mesh is singly
connected.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "IOdictionary.H"
#include "twoDPointCorrector.H"
#include "OFstream.H"
#include "meshTools.H"
#include "triSurface.H"
#include "triSurfaceSearch.H"
#include "meshSearch.H"
#include "cellClassification.H"
#include "cellSet.H"
#include "cellInfo.H"
#include "MeshWave.H"
#include "edgeStats.H"
#include "octreeDataTriSurface.H"
#include "octree.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// cellType for cells included/not included in mesh.
static const label MESH = cellClassification::INSIDE;
static const label NONMESH = cellClassification::OUTSIDE;
void writeSet(const cellSet& cells, const string& msg)
{
Info<< "Writing " << msg << " (" << cells.size() << ") to cellSet "
<< cells.instance()/cells.local()/cells.name()
<< endl << endl;
cells.write();
}
void getType(const labelList& elems, const label type, labelHashSet& set)
{
forAll(elems, i)
{
if (elems[i] == type)
{
set.insert(i);
}
}
}
void cutBySurface
(
const polyMesh& mesh,
const meshSearch& queryMesh,
const triSurfaceSearch& querySurf,
const pointField& outsidePts,
const bool selectCut,
const bool selectInside,
const bool selectOutside,
const scalar nearDist,
cellClassification& cellType
)
{
// Cut with surface and classify as inside/outside/cut
cellType =
cellClassification
(
mesh,
queryMesh,
querySurf,
outsidePts
);
// Get inside/outside/cutCells cellSets.
cellSet inside(mesh, "inside", mesh.nCells()/10);
getType(cellType, cellClassification::INSIDE, inside);
writeSet(inside, "inside cells");
cellSet outside(mesh, "outside", mesh.nCells()/10);
getType(cellType, cellClassification::OUTSIDE, outside);
writeSet(outside, "outside cells");
cellSet cutCells(mesh, "cutCells", mesh.nCells()/10);
getType(cellType, cellClassification::CUT, cutCells);
writeSet(cutCells, "cells cut by surface");
// Change cellType to reflect selected part of mesh. Use
// MESH to denote selected part, NONMESH for all
// other cells.
// Is a bit of a hack but allows us to reuse all the functionality
// in cellClassification.
forAll(cellType, cellI)
{
label cType = cellType[cellI];
if (cType == cellClassification::CUT)
{
if (selectCut)
{
cellType[cellI] = MESH;
}
else
{
cellType[cellI] = NONMESH;
}
}
else if (cType == cellClassification::INSIDE)
{
if (selectInside)
{
cellType[cellI] = MESH;
}
else
{
cellType[cellI] = NONMESH;
}
}
else if (cType == cellClassification::OUTSIDE)
{
if (selectOutside)
{
cellType[cellI] = MESH;
}
else
{
cellType[cellI] = NONMESH;
}
}
else
{
FatalErrorIn("cutBySurface")
<< "Multiple mesh regions in original mesh" << endl
<< "Please use splitMeshRegions to separate these"
<< exit(FatalError);
}
}
if (nearDist > 0)
{
Info<< "Removing cells with points closer than " << nearDist
<< " to the surface ..." << nl << endl;
const pointField& pts = mesh.points();
const octree<octreeDataTriSurface>& tree = querySurf.tree();
label nRemoved = 0;
forAll(pts, pointI)
{
const point& pt = pts[pointI];
// Search in tight bounding box around pt.
treeBoundBox tightest
(
pt - vector(nearDist, nearDist, nearDist),
pt + vector(nearDist, nearDist, nearDist)
);
scalar tightestDist = mag(tightest.max() - tightest.min());
label triI = tree.findNearest(pt, tightest, tightestDist);
if (triI != -1 && tightestDist < nearDist)
{
const labelList& pCells = mesh.pointCells()[pointI];
forAll(pCells, i)
{
if (cellType[pCells[i]] != NONMESH)
{
cellType[pCells[i]] = NONMESH;
nRemoved++;
}
}
}
}
// tmp<pointField> tnearest = querySurf.calcNearest(pts);
// const pointField& nearest = tnearest();
//
// label nRemoved = 0;
//
// forAll(nearest, pointI)
// {
// if (mag(nearest[pointI] - pts[pointI]) < nearDist)
// {
// const labelList& pCells = mesh.pointCells()[pointI];
//
// forAll(pCells, i)
// {
// if (cellType[pCells[i]] != NONMESH)
// {
// cellType[pCells[i]] = NONMESH;
// nRemoved++;
// }
// }
// }
// }
Info<< "Removed " << nRemoved << " cells since too close to surface"
<< nl << endl;
}
}
// We're meshing the outside. Subset the currently selected mesh cells with the
// ones reachable from the outsidepoints.
label selectOutsideCells
(
const polyMesh& mesh,
const meshSearch& queryMesh,
const pointField& outsidePts,
cellClassification& cellType
)
{
//
// Check all outsidePts and for all of them inside a mesh cell
// collect the faces to start walking from
//
// Outside faces
labelHashSet outsideFacesMap(outsidePts.size() * 6 * 2);
DynamicList<label> outsideFaces(outsideFacesMap.size());
// CellInfo on outside faces
DynamicList<cellInfo> outsideFacesInfo(outsideFacesMap.size());
// cellInfo for mesh cell
const cellInfo meshInfo(MESH);
forAll(outsidePts, outsidePtI)
{
// Find cell containing point. Linear search.
label cellI = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
if (cellType[cellI] == MESH)
{
Info<< "Marking cell " << cellI << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[cellI]
<< " ..." << endl;
//
// Mark this cell and its faces to start walking from
//
// Mark faces of cellI
const labelList& cFaces = mesh.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
if (outsideFacesMap.insert(faceI))
{
outsideFaces.append(faceI);
outsideFacesInfo.append(meshInfo);
}
}
}
}
// Floodfill starting from outsideFaces (of type meshInfo)
MeshWave<cellInfo> regionCalc
(
mesh,
outsideFaces.shrink(),
outsideFacesInfo.shrink(),
mesh.nCells() // max iterations
);
// Now regionCalc should hold info on cells that are reachable from
// changedFaces. Use these to subset cellType
const List<cellInfo>& allCellInfo = regionCalc.allCellInfo();
label nChanged = 0;
forAll(allCellInfo, cellI)
{
if (cellType[cellI] == MESH)
{
// Original cell was selected for meshing. Check if cell was
// reached from outsidePoints
if (allCellInfo[cellI].type() != MESH)
{
cellType[cellI] = NONMESH;
nChanged++;
}
}
}
return nChanged;
}
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
// Mesh edge statistics calculator
edgeStats edgeCalc(mesh);
IOdictionary refineDict
(
IOobject
(
"selectCellsDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
fileName surfName(refineDict.lookup("surface"));
pointField outsidePts(refineDict.lookup("outsidePoints"));
bool useSurface(readBool(refineDict.lookup("useSurface")));
bool selectCut(readBool(refineDict.lookup("selectCut")));
bool selectInside(readBool(refineDict.lookup("selectInside")));
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
scalar nearDist(readScalar(refineDict.lookup("nearDistance")));
if (useSurface)
{
Info<< "Cells to be used for meshing (0=false, 1=true):" << nl
<< " cells cut by surface : " << selectCut << nl
<< " cells inside of surface : " << selectInside << nl
<< " cells outside of surface : " << selectOutside << nl
<< " cells with points further than : " << nearDist << nl
<< endl;
}
else
{
Info<< "Cells to be used for meshing (0=false, 1=true):" << nl
<< " cells reachable from outsidePoints:" << selectOutside << nl
<< endl;
}
// Print edge stats on original mesh.
(void)edgeCalc.minLen(Info);
// Search engine on mesh. Face decomposition since faces might be warped.
meshSearch queryMesh(mesh, true);
// Check all 'outside' points
forAll(outsidePts, outsideI)
{
const point& outsidePoint = outsidePts[outsideI];
if (queryMesh.findCell(outsidePoint, -1, false) == -1)
{
FatalErrorIn(args.executable())
<< "outsidePoint " << outsidePoint
<< " is not inside any cell"
<< exit(FatalError);
}
}
// Cell status (compared to surface if provided): inside/outside/cut.
// Start off from everything selected and cut later.
cellClassification cellType
(
mesh,
labelList
(
mesh.nCells(),
cellClassification::MESH
)
);
// Surface
autoPtr<triSurface> surf(NULL);
// Search engine on surface.
autoPtr<triSurfaceSearch> querySurf(NULL);
if (useSurface)
{
surf.reset(new triSurface(surfName));
// Dump some stats
surf().writeStats(Info);
// Search engine on surface.
querySurf.reset(new triSurfaceSearch(surf));
// Set cellType[cellI] according to relation to surface
cutBySurface
(
mesh,
queryMesh,
querySurf,
outsidePts,
selectCut,
selectInside,
selectOutside,
nearDist,
cellType
);
}
// Now 'trim' all the corners from the mesh so meshing/surface extraction
// becomes easier.
label nHanging, nRegionEdges, nRegionPoints, nOutside;
do
{
Info<< "Removing cells which after subsetting would have all points"
<< " on outside ..." << nl << endl;
nHanging = cellType.fillHangingCells
(
MESH, // meshType
NONMESH, // fill type
mesh.nCells()
);
Info<< "Removing edges connecting cells unconnected by faces ..."
<< nl << endl;
nRegionEdges = cellType.fillRegionEdges
(
MESH, // meshType
NONMESH, // fill type
mesh.nCells()
);
Info<< "Removing points connecting cells unconnected by faces ..."
<< nl << endl;
nRegionPoints = cellType.fillRegionPoints
(
MESH, // meshType
NONMESH, // fill type
mesh.nCells()
);
nOutside = 0;
if (selectOutside)
{
// Since we're selecting the cells reachable from outsidePoints
// and the set might have changed, redo the outsideCells
// calculation
nOutside = selectOutsideCells
(
mesh,
queryMesh,
outsidePts,
cellType
);
}
} while
(
nHanging != 0
|| nRegionEdges != 0
|| nRegionPoints != 0
|| nOutside != 0
);
cellSet selectedCells(mesh, "selected", mesh.nCells()/10);
getType(cellType, MESH, selectedCells);
writeSet(selectedCells, "cells selected for meshing");
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,50 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
case "cavity";
instance "system";
local "";
class dictionary;
object selectCellsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Whether to use surface. If false no surface will be read and only
// outsidePoints/selectOutside will be used to determine cells to keep.
useSurface false;
// Surface to keep to
surface "plexi.ftr";
// What is outside
outsidePoints ((-1 -1 -1));
//
// Selection of final set
//
// Select based on side of surface. Usually select inside cells and project
// outwards or select outside cells and project inwards.
selectCut false;
selectInside false;
selectOutside true;
// Leave out cell closer than nearDistance to the surface. Usually
// 0.5*of the cell size. Set to <0 to disable.
nearDistance -1;
// ************************************************************************* //

View File

@ -0,0 +1,4 @@
splitCells.C
EXE = $(FOAM_APPBIN)/splitCells

View File

@ -0,0 +1,9 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \
-ldynamicMesh \
-ltriSurface \
-lmeshTools

View File

@ -0,0 +1,701 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Description
Utility to split cells with flat faces. Uses a geometric cut with a plane
dividing the edge angle into two so might produce funny cells. For hexes
it will use by default a cut from edge onto opposite edge (i.e. purely
topological).
Options:
- split cells from cellSet only
- use geometric cut for hexes as well
The angle is the angle between two faces sharing an edge as seen from
inside each cell. So a cube will have all angles 90. If you want
to split cells with cell centre outside use e.g. angle 200
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyTopoChange.H"
#include "polyTopoChanger.H"
#include "mapPolyMesh.H"
#include "polyMesh.H"
#include "cellCuts.H"
#include "cellSet.H"
#include "cellModeller.H"
#include "meshCutter.H"
#include "mathematicalConstants.H"
#include "geomCellLooper.H"
#include "plane.H"
#include "edgeVertex.H"
#include "meshTools.H"
#include "ListOps.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
labelList pack(const boolList& lst)
{
labelList packedLst(lst.size());
label packedI = 0;
forAll(lst, i)
{
if (lst[i])
{
packedLst[packedI++] = i;
}
}
packedLst.setSize(packedI);
return packedLst;
}
scalarField pack(const boolList& lst, const scalarField& elems)
{
scalarField packedElems(lst.size());
label packedI = 0;
forAll(lst, i)
{
if (lst[i])
{
packedElems[packedI++] = elems[i];
}
}
packedElems.setSize(packedI);
return packedElems;
}
// Given sin and cos of max angle between normals calculate whether f0 and f1
// on cellI make larger angle. Uses sinAngle only for quadrant detection.
bool largerAngle
(
const primitiveMesh& mesh,
const scalar cosAngle,
const scalar sinAngle,
const label cellI,
const label f0, // face label
const label f1,
const vector& n0, // normal at f0
const vector& n1
)
{
const labelList& own = mesh.faceOwner();
bool sameFaceOrder = !((own[f0] == cellI) ^ (own[f1] == cellI));
// Get cos between faceArea vectors. Correct so flat angle (180 degrees)
// gives -1.
scalar normalCosAngle = n0 & n1;
if (sameFaceOrder)
{
normalCosAngle = -normalCosAngle;
}
// Get cos between faceCentre and normal vector to determine in
// which quadrant angle is. (Is correct for unwarped faces only!)
// Correct for non-outwards pointing normal.
vector c1c0(mesh.faceCentres()[f1] - mesh.faceCentres()[f0]);
c1c0 /= mag(c1c0) + VSMALL;
scalar fcCosAngle = n0 & c1c0;
if (own[f0] != cellI)
{
fcCosAngle = -fcCosAngle;
}
if (sinAngle < 0.0)
{
// Looking for concave angles (quadrant 3 or 4)
if (fcCosAngle <= 0)
{
// Angle is convex so smaller.
return false;
}
else
{
if (normalCosAngle < cosAngle)
{
return false;
}
else
{
return true;
}
}
}
else
{
// Looking for convex angles (quadrant 1 or 2)
if (fcCosAngle > 0)
{
// Concave angle
return true;
}
else
{
// Convex. Check cos of normal vectors.
if (normalCosAngle > cosAngle)
{
return false;
}
else
{
return true;
}
}
}
}
// Split hex (and hex only) along edgeI creating two prisms
bool splitHex
(
const polyMesh& mesh,
const label cellI,
const label edgeI,
DynamicList<label>& cutCells,
DynamicList<labelList>& cellLoops,
DynamicList<scalarField>& cellEdgeWeights
)
{
// cut handling functions
edgeVertex ev(mesh);
const edgeList& edges = mesh.edges();
const faceList& faces = mesh.faces();
const edge& e = edges[edgeI];
// Get faces on the side, i.e. faces not using edge but still using one of
// the edge endpoints.
label leftI = -1;
label rightI = -1;
label leftFp = -1;
label rightFp = -1;
const cell& cFaces = mesh.cells()[cellI];
forAll(cFaces, i)
{
label faceI = cFaces[i];
const face& f = faces[faceI];
label fp0 = findIndex(f, e[0]);
label fp1 = findIndex(f, e[1]);
if (fp0 == -1)
{
if (fp1 != -1)
{
// Face uses e[1] but not e[0]
rightI = faceI;
rightFp = fp1;
if (leftI != -1)
{
// Have both faces so exit
break;
}
}
}
else
{
if (fp1 != -1)
{
// Face uses both e[1] and e[0]
}
else
{
leftI = faceI;
leftFp = fp0;
if (rightI != -1)
{
break;
}
}
}
}
if (leftI == -1 || rightI == -1)
{
FatalErrorIn("splitHex") << "Problem : leftI:" << leftI
<< " rightI:" << rightI << abort(FatalError);
}
// Walk two vertices further on faces.
const face& leftF = faces[leftI];
label leftV = leftF[(leftFp + 2) % leftF.size()];
const face& rightF = faces[rightI];
label rightV = rightF[(rightFp + 2) % rightF.size()];
labelList loop(4);
loop[0] = ev.vertToEVert(e[0]);
loop[1] = ev.vertToEVert(leftV);
loop[2] = ev.vertToEVert(rightV);
loop[3] = ev.vertToEVert(e[1]);
scalarField loopWeights(4);
loopWeights[0] = -GREAT;
loopWeights[1] = -GREAT;
loopWeights[2] = -GREAT;
loopWeights[3] = -GREAT;
cutCells.append(cellI);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
return true;
}
// Split cellI along edgeI with a plane along halfNorm direction.
bool splitCell
(
const polyMesh& mesh,
const geomCellLooper& cellCutter,
const label cellI,
const label edgeI,
const vector& halfNorm,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
DynamicList<label>& cutCells,
DynamicList<labelList>& cellLoops,
DynamicList<scalarField>& cellEdgeWeights
)
{
const edge& e = mesh.edges()[edgeI];
vector eVec = e.vec(mesh.points());
eVec /= mag(eVec);
vector planeN = eVec ^ halfNorm;
// Slightly tilt plane to make it not cut edges exactly
// halfway on fully regular meshes (since we want cuts
// to be snapped to vertices)
planeN += 0.01*halfNorm;
planeN /= mag(planeN);
// Define plane through edge
plane cutPlane(mesh.points()[e.start()], planeN);
labelList loop;
scalarField loopWeights;
if
(
cellCutter.cut
(
cutPlane,
cellI,
vertIsCut,
edgeIsCut,
edgeWeight,
loop,
loopWeights
)
)
{
// Did manage to cut cell. Copy into overall list.
cutCells.append(cellI);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
return true;
}
else
{
return false;
}
}
// Collects cuts for all cells in cellSet
void collectCuts
(
const polyMesh& mesh,
const geomCellLooper& cellCutter,
const bool geometry,
const scalar minCos,
const scalar minSin,
const cellSet& cellsToCut,
DynamicList<label>& cutCells,
DynamicList<labelList>& cellLoops,
DynamicList<scalarField>& cellEdgeWeights
)
{
// Get data from mesh
const cellShapeList& cellShapes = mesh.cellShapes();
const labelList& own = mesh.faceOwner();
const labelListList& cellEdges = mesh.cellEdges();
const vectorField& faceAreas = mesh.faceAreas();
// Hex shape
const cellModel& hex = *(cellModeller::lookup("hex"));
// cut handling functions
edgeVertex ev(mesh);
// Cut information per mesh entity
boolList vertIsCut(mesh.nPoints(), false);
boolList edgeIsCut(mesh.nEdges(), false);
scalarField edgeWeight(mesh.nEdges(), -GREAT);
for
(
cellSet::const_iterator iter = cellsToCut.begin();
iter != cellsToCut.end();
++iter
)
{
label cellI = iter.key();
const labelList& cEdges = cellEdges[cellI];
forAll(cEdges, i)
{
label edgeI = cEdges[i];
label f0, f1;
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
vector n0 = faceAreas[f0];
n0 /= mag(n0);
vector n1 = faceAreas[f1];
n1 /= mag(n1);
if
(
largerAngle
(
mesh,
minCos,
minSin,
cellI,
f0,
f1,
n0,
n1
)
)
{
bool splitOk = false;
if (!geometry && cellShapes[cellI].model() == hex)
{
splitOk =
splitHex
(
mesh,
cellI,
edgeI,
cutCells,
cellLoops,
cellEdgeWeights
);
}
else
{
vector halfNorm;
if ((own[f0] == cellI) ^ (own[f1] == cellI))
{
// Opposite owner orientation
halfNorm = 0.5*(n0 - n1);
}
else
{
// Faces have same owner or same neighbour so
// normals point in same direction
halfNorm = 0.5*(n0 + n1);
}
splitOk =
splitCell
(
mesh,
cellCutter,
cellI,
edgeI,
halfNorm,
vertIsCut,
edgeIsCut,
edgeWeight,
cutCells,
cellLoops,
cellEdgeWeights
);
}
if (splitOk)
{
// Update cell/edge/vertex wise info.
label index = cellLoops.size() - 1;
const labelList& loop = cellLoops[index];
const scalarField& loopWeights = cellEdgeWeights[index];
forAll(loop, i)
{
label cut = loop[i];
if (ev.isEdge(cut))
{
edgeIsCut[ev.getEdge(cut)] = true;
edgeWeight[ev.getEdge(cut)] = loopWeights[i];
}
else
{
vertIsCut[ev.getVertex(cut)] = true;
}
}
// Stop checking edges for this cell.
break;
}
}
}
}
cutCells.shrink();
cellLoops.shrink();
cellEdgeWeights.shrink();
}
// Main program:
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validOptions.insert("set", "cellSet name");
argList::validOptions.insert("geometry", "");
argList::validOptions.insert("tol", "edge snap tolerance");
argList::validArgs.append("edge angle [0..360]");
# include "setRootCase.H"
# include "createTime.H"
# include "createPolyMesh.H"
scalar featureAngle(readScalar(IStringStream(args.additionalArgs()[0])()));
scalar radAngle = featureAngle * mathematicalConstant::pi/180.0;
scalar minCos = Foam::cos(radAngle);
scalar minSin = Foam::sin(radAngle);
bool readSet = args.options().found("set");
bool geometry = args.options().found("geometry");
scalar edgeTol = 0.2;
if (args.options().found("tol"))
{
edgeTol = readScalar(IStringStream(args.options()["tol"])());
}
Info<< "Trying to split cells with internal angles > feature angle\n" << nl
<< "featureAngle : " << featureAngle << nl
<< "edge snapping tol : " << edgeTol << nl;
if (readSet)
{
Info<< "candidate cells : cellSet " << args.options()["set"] << nl;
}
else
{
Info<< "candidate cells : all cells" << nl;
}
if (geometry)
{
Info<< "hex cuts : geometric; using edge tolerance" << nl;
}
else
{
Info<< "hex cuts : topological; cut to opposite edge" << nl;
}
Info<< endl;
// Cell circumference cutter
geomCellLooper cellCutter(mesh);
// Snap all edge cuts close to endpoints to vertices.
geomCellLooper::setSnapTol(edgeTol);
// Candidate cells to cut
cellSet cellsToCut(mesh, "cellsToCut", mesh.nCells()/100);
if (readSet)
{
// Read cells to cut from cellSet
cellSet cells(mesh, args.options()["set"]);
cellsToCut = cells;
}
while (true)
{
if (!readSet)
{
// Try all cells for cutting
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{
cellsToCut.insert(cellI);
}
}
// Cut information per cut cell
DynamicList<label> cutCells(mesh.nCells()/10 + 10);
DynamicList<labelList> cellLoops(mesh.nCells()/10 + 10);
DynamicList<scalarField> cellEdgeWeights(mesh.nCells()/10 + 10);
collectCuts
(
mesh,
cellCutter,
geometry,
minCos,
minSin,
cellsToCut,
cutCells,
cellLoops,
cellEdgeWeights
);
cellSet cutSet(mesh, "cutSet", cutCells.size());
forAll(cutCells, i)
{
cutSet.insert(cutCells[i]);
}
// Gets cuts across cells from cuts through edges.
Info<< "Writing " << cutSet.size() << " cells to cut to cellSet "
<< cutSet.instance()/cutSet.local()/cutSet.name()
<< endl << endl;
cutSet.write();
// Analyze cuts for clashes.
cellCuts cuts
(
mesh,
cutCells, // cells candidate for cutting
cellLoops,
cellEdgeWeights
);
Info<< "Actually cut cells:" << cuts.nLoops() << nl << endl;
if (cuts.nLoops() == 0)
{
break;
}
// Remove cut cells from cellsToCut (Note:only relevant if -readSet)
forAll(cuts.cellLoops(), cellI)
{
if (cuts.cellLoops()[cellI].size() > 0)
{
//Info<< "Removing cut cell " << cellI << " from wishlist"
// << endl;
cellsToCut.erase(cellI);
}
}
// At least some cells are cut.
polyTopoChange meshMod(mesh);
// Cutting engine
meshCutter cutter(mesh);
// Insert mesh refinement into polyTopoChange.
cutter.setRefinement(cuts, meshMod);
// Do all changes
Info<< "Morphing ..." << endl;
runTime++;
autoPtr<mapPolyMesh> morphMap = meshMod.changeMesh(mesh, false);
if (morphMap().hasMotionPoints())
{
mesh.movePoints(morphMap().preMotionPoints());
}
// Update stored labels on meshCutter
cutter.updateMesh(morphMap());
// Update cellSet
cellsToCut.updateMesh(morphMap());
Info<< "Remaining:" << cellsToCut.size() << endl;
// Write resulting mesh
Info << "Writing refined morphMesh to time " << runTime.value() << endl;
mesh.write();
}
Info << "End\n" << endl;
return 0;
}
// ************************************************************************* //

View File

@ -0,0 +1,32 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// ansysToFoam tool definition
description "ANSYS to OpenFOAM mesh converter";
ansysToFoamDict
{
type dictionary;
description "ansysToFoam control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseArguments;
entries
{
include "$FOAMX_CONFIG/entries/arguments/meshFile.cfg";
include "$FOAMX_CONFIG/entries/arguments/scale.cfg";
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,3 @@
ansysToFoam.L
EXE = $(FOAM_APPBIN)/ansysToFoam

View File

@ -0,0 +1,500 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
ansysToFoam
Description
Converts an ANSYS input mesh file, exported from I-DEAS, to FOAM format.
\*---------------------------------------------------------------------------*/
%{
#undef yyFlexLexer
/* ------------------------------------------------------------------------- *\
------ local definitions
\* ------------------------------------------------------------------------- */
#include <sstream>
#include "scalar.H"
#include "IStringStream.H"
using namespace Foam;
#include "argList.H"
#include "Time.H"
#include "polyMesh.H"
#include "emptyPolyPatch.H"
#include "preservePatchTypes.H"
#include "cellShape.H"
#include "cellModeller.H"
#include "SLList.H"
#include "SLPtrList.H"
SLList<point> slPoints;
SLList<label> slPointMap;
label maxNodei = 0;
SLPtrList<labelList> slCellLabels;
SLList<label> slCellMap;
label maxCelli = 0;
PtrList<SLList<label> > slPatchCells;
PtrList<SLList<label> > slPatchCellFaces;
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
extern "C" int yywrap()
{
return 1;
}
%}
one_space [ \t\f\r]
space {one_space}*
some_space {one_space}+
cspace ","{space}
alpha [_A-Za-z]
digit [0-9]
dec_digit [0-9]
octal_digit [0-7]
hex_digit [0-9a-fA-F]
identifier {alpha}({alpha}|{digit})*
integer {dec_digit}+
label [1-9]{dec_digit}*
exponent_part [eE][-+]?{digit}+
fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+"."?))
double (({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))
x {double}
y {double}
z {double}
value {double}
node ^{space}"N"{cspace}
element ^{space}"EN"{cspace}
bface ^{space}"SFE"{cspace}
%%
%{
labelList labels(8);
%}
/* ------------------------------------------------------------------------- *\
------ Start Lexing ------
\* ------------------------------------------------------------------------- */
{node}{label}{cspace}{x}{cspace}{y}{cspace}{z}{space}\n {
IStringStream nodeStream(YYText());
char tag, c;
label nodei;
point node;
nodeStream
>> tag
>> c >> nodei
>> c >> node.x()
>> c >> node.y()
>> c >> node.z();
if (nodei > maxNodei) maxNodei = nodei;
slPointMap.append(nodei);
slPoints.append(node);
}
{element}{label}{cspace}{label}{cspace}{label}{cspace}{label}{cspace}{label}{cspace}{label}{cspace}{label}{cspace}{label}{cspace}{label}{space}\n {
IStringStream elementStream(YYText());
char tag, c;
label celli;
elementStream
>> tag >> tag
>> c >> celli
>> c >> labels[0]
>> c >> labels[1]
>> c >> labels[2]
>> c >> labels[3]
>> c >> labels[4]
>> c >> labels[5]
>> c >> labels[6]
>> c >> labels[7];
if (celli > maxCelli) maxCelli = celli;
slCellMap.append(celli);
slCellLabels.append(new labelList(labels));
}
{bface}{label}{cspace}{label}{cspace}{identifier}{cspace}{integer}{cspace}{value}{space}\n {
IStringStream bfaceStream(YYText());
char tag, c;
label elementi;
label facei;
scalar indexValue, unknown;
bfaceStream
>> tag >> tag >> tag
>> c >> elementi
>> c >> facei
>> c >> tag >> tag >> tag >> tag
>> c >> unknown
>> c >> indexValue;
label patchi = label(indexValue);
if (patchi > slPatchCells.size())
{
slPatchCells.setSize(patchi);
forAll(slPatchCells, i)
{
if (!slPatchCells(i))
{
slPatchCells.set(i, new SLList<label>);
}
}
}
if (patchi > slPatchCellFaces.size())
{
slPatchCellFaces.setSize(patchi);
forAll(slPatchCells, i)
{
if (!slPatchCellFaces(i))
{
slPatchCellFaces.set(i, new SLList<label>);
}
}
}
slPatchCells[patchi-1].append(elementi);
slPatchCellFaces[patchi-1].append(facei);
}
/* ------------------------------------------------------------------------- *\
------ Ignore remaining space and \n s. Any other characters are errors.
\* ------------------------------------------------------------------------- */
.|\n {}
/* ------------------------------------------------------------------------- *\
------ On EOF return to previous file, if none exists terminate.
\* ------------------------------------------------------------------------- */
<<EOF>> {
yyterminate();
}
%%
#include "fileName.H"
#include <fstream>
using std::ifstream;
int main(int argc, char *argv[])
{
argList::noParallel();
argList::validArgs.append("ANSYS input file");
argList::validOptions.insert("scale", "scale factor");
argList args(argc, argv);
if (!args.check())
{
FatalError.exit();
}
scalar scaleFactor = 1.0;
if (args.options().found("scale"))
{
scaleFactor = atof(args.options()["scale"].c_str());
}
# include "createTime.H"
fileName ansysFile(args.additionalArgs()[0]);
ifstream ansysStream(ansysFile.c_str());
if (!ansysStream)
{
FatalErrorIn("ansysToFoam::main(int argc, char *argv[])")
<< args.executable()
<< ": file " << ansysFile << " not found"
<< exit(FatalError);
}
yyFlexLexer lexer(&ansysStream);
while(lexer.yylex() != 0);
Info << "Creating points" << endl;
pointField points(slPoints.size());
label i=0;
for
(
SLList<point>::iterator pointIter = slPoints.begin();
pointIter != slPoints.end();
++pointIter
)
{
// Scale points for the given scale factor
points[i++] = scaleFactor*pointIter();
}
labelList pointMap(maxNodei+1);
i=0;
for
(
SLList<label>::iterator pointMapIter = slPointMap.begin();
pointMapIter != slPointMap.end();
++pointMapIter
)
{
pointMap[pointMapIter()] = i++;
}
Info << "Creating cells" << endl;
labelList cellMap(maxCelli+1);
i=0;
for
(
SLList<label>::iterator cellMapIter = slCellMap.begin();
cellMapIter != slCellMap.end();
++cellMapIter
)
{
cellMap[cellMapIter()] = i++;
}
const cellModel& hex = *(cellModeller::lookup("hex"));
const cellModel& prism = *(cellModeller::lookup("prism"));
const cellModel& pyr = *(cellModeller::lookup("pyr"));
const cellModel& tet = *(cellModeller::lookup("tet"));
labelList labelsHex(8);
labelList labelsPrism(6);
labelList labelsPyramid(5);
labelList labelsTet(4);
cellShapeList cellShapes(slCellLabels.size());
label nCells = 0;
for
(
SLPtrList<labelList>::iterator cellIter = slCellLabels.begin();
cellIter != slCellLabels.end();
++cellIter
)
{
if // Tetrahedron
(
cellIter()[2] == cellIter()[3]
&& cellIter()[4] == cellIter()[5]
&& cellIter()[5] == cellIter()[6]
&& cellIter()[6] == cellIter()[7]
)
{
labelsTet[0] = pointMap[cellIter()[0] ];
labelsTet[1] = pointMap[cellIter()[1] ];
labelsTet[2] = pointMap[cellIter()[2] ];
labelsTet[3] = pointMap[cellIter()[4] ];
cellShapes[nCells++] = cellShape(tet, labelsTet);
}
else if // Square-based pyramid
(
cellIter()[4] == cellIter()[5]
&& cellIter()[5] == cellIter()[6]
&& cellIter()[6] == cellIter()[7]
)
{
labelsPyramid[0] = pointMap[cellIter()[0] ];
labelsPyramid[1] = pointMap[cellIter()[1] ];
labelsPyramid[2] = pointMap[cellIter()[2] ];
labelsPyramid[3] = pointMap[cellIter()[3] ];
labelsPyramid[4] = pointMap[cellIter()[4] ];
cellShapes[nCells++] = cellShape(pyr, labelsPyramid);
}
else if // Triangular prism
(
cellIter()[2] == cellIter()[3]
&& cellIter()[6] == cellIter()[7]
)
{
labelsPrism[0] = pointMap[cellIter()[0] ];
labelsPrism[1] = pointMap[cellIter()[1] ];
labelsPrism[2] = pointMap[cellIter()[2] ];
labelsPrism[3] = pointMap[cellIter()[4] ];
labelsPrism[4] = pointMap[cellIter()[5] ];
labelsPrism[5] = pointMap[cellIter()[6] ];
cellShapes[nCells++] = cellShape(prism, labelsPrism);
}
else // Hex
{
labelsHex[0] = pointMap[cellIter()[0] ];
labelsHex[1] = pointMap[cellIter()[1] ];
labelsHex[2] = pointMap[cellIter()[2] ];
labelsHex[3] = pointMap[cellIter()[3] ];
labelsHex[4] = pointMap[cellIter()[4] ];
labelsHex[5] = pointMap[cellIter()[5] ];
labelsHex[6] = pointMap[cellIter()[6] ];
labelsHex[7] = pointMap[cellIter()[7] ];
cellShapes[nCells++] = cellShape(hex, labelsHex);
}
}
// Warning: tet face order has changed between version 1.9.6 and 2.0
//
label faceIndex[7][6] =
{
{-1, -1, -1, -1, -1, -1}, // 0
{-1, -1, -1, -1, -1, -1}, // 1
{-1, -1, -1, -1, -1, -1}, // 2
{-1, -1, -1, -1, -1, -1}, // 3
{-1, 2, 0, 3, 1, -1}, // tet (version 2.0)
{ 0, 4, 3, -1, 2, 1}, // prism
{ 4, 2, 1, 3, 0, 5}, // hex
};
Info << "Creating boundary patches" << endl;
faceListList boundary(slPatchCells.size());
wordList patchNames(slPatchCells.size());
forAll(slPatchCells, patchI)
{
SLList<face> patchFaces;
SLList<label>::iterator cellIter(slPatchCells[patchI].begin());
SLList<label>::iterator faceIter(slPatchCellFaces[patchI].begin());
for
(
;
cellIter != slPatchCells[patchI].end()
&& faceIter != slPatchCellFaces[patchI].end();
++cellIter, ++faceIter
)
{
patchFaces.append
(
cellShapes[cellMap[cellIter()] ].faces()
[
faceIndex
[cellShapes[cellMap[cellIter()] ].nFaces()]
[faceIter()-1]
]
);
}
boundary[patchI] = patchFaces;
patchNames[patchI] = word("patch") + name(patchI + 1);
Info << "Patch " << patchI << " named " << patchNames[patchI]
<< ": " << boundary[patchI].size() << " faces" << endl;
}
Info << "ansysToFoam: " << endl
<< "Ansys file format does not provide information about the type of "
<< "the patch (eg. wall, symmetry plane, cyclic etc)." << endl
<< "All the patches have been created "
<< "as type patch. Please reset after mesh conversion as necessary."
<< endl;
wordList patchTypes(boundary.size(), polyPatch::typeName);
word defaultFacesName = "defaultFaces";
word defaultFacesType = emptyPolyPatch::typeName;
wordList patchPhysicalTypes(boundary.size());
preservePatchTypes
(
runTime,
runTime.constant(),
polyMesh::defaultRegion,
patchNames,
patchTypes,
defaultFacesName,
defaultFacesType,
patchPhysicalTypes
);
polyMesh pShapeMesh
(
IOobject
(
polyMesh::defaultRegion,
runTime.constant(),
runTime
),
points,
cellShapes,
boundary,
patchNames,
patchTypes,
defaultFacesName,
defaultFacesType,
patchPhysicalTypes
);
// Set the precision of the points data to 10
IOstream::defaultPrecision(10);
Info << "Writing polyMesh" << endl;
pShapeMesh.write();
Info<< nl << "end" << endl;
return 0;
}
/* ------------------------------------------------------------------------- *\
------ End of ansysToFoam.L
\* ------------------------------------------------------------------------- */

View File

@ -0,0 +1,9 @@
#!/bin/sh
set -x
# Some fun: prostar uses ccmio2.3, Star-ccm+ uses ccmio2.4
(cd libccmio; wmake libso libadf)
(cd libccmio; wmake libso libccmio)
(cd libccmio; wmake libso libcgns)
(cd ccm26ToFoam; wmake)

View File

@ -0,0 +1,31 @@
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.0 |
| \\ / A nd | Web: http://www.openfoam.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
// ccm24ToFoam tool definition
description "Converts CCM/NGeom files written by Prostar/ccm to OpenFOAM";
ccm24ToFoamDict
{
type dictionary;
description "ccm24ToFoam control dictionary";
dictionaryPath "system";
entries
{
arguments
{
type rootCaseArguments;
entries
{
include "$FOAMX_CONFIG/entries/arguments/meshFile.cfg";
}
}
}
}
// ************************************************************************* //

View File

@ -0,0 +1,36 @@
1. how to write mesh from prostar
Type ngeom,[name].ngeom,star in the command line. This will create a
.ngeom file of your Prostar model.
If you have boundaries defined, these will be kept in the .ngeom file so
you won't have to rename and redefine the boundaries in ccm+. However,
the values (properties) are not exported.
If you don't have boundaries you'll get a single wall patch in ccm+ that
you'll have to split accordingly.
2. how to load it into star-ccm+
In ccm+ create a new simulation and do File>Import...
Browse to the location where you have your .ngeom file, select it, press
OK and that's it.
3. how to do merging (or is automatic?)
If you had couples in your Prostar model, your meshes will all be
"fused" together automatically in ccm+ when you import the .ngeom file.
Keep a look on the output window in Prostar when you run the ngeom
command to make sure the couples are exported OK.
Alternatively, you can "fuse" the different fluid regions in ccm+. To do
this select all the fluid regions you want to merge together from the
command tree on the left of your screen, under Regions. Press control
and click on top of each one, once you've selected all, click the
right-hand buttom of your mouse and select Fuse...
4. how to save it from star-ccm+
Once your model is ready in ccm+ (i.e. all regions and boundary patches
defined), go to File>Export... and select .ccm format.

View File

@ -0,0 +1,3 @@
ccm26ToFoam.C
EXE = $(FOAM_APPBIN)/ccm26ToFoam

View File

@ -0,0 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I../libccmio/libadf \
-I../libccmio \
-I../libccmio/libccmio
EXE_LIBS = \
-lfiniteVolume \
-lmeshTools \
-ladf \
-lccmio

View File

@ -0,0 +1,36 @@
#include "Vector.h"
using namespace std;
float Vector::distanceToSegment(const Vector& p1, const Vector& p2) const
{
// vector from p1 to p2
Vector p1p2(p1,p2);
float length = p1p2.mag();
if (length <= 1.0e-9)
return Vector::distance(*this, p1);
p1p2.normalize();
// vector from p1 to this
Vector p1point(p1, *this);
// u is distance along segment from point 1
float u = Vector::dot(p1point, p1p2);
if (u <= 0.0) // closest to point 1
return p1point.mag();
else if (u >= length) // closest to point 2
return Vector::distance(*this, p2);
else // use pythagorean theorem to compute projected distance
return sqrt(p1point.mag_squared() - u*u);
return 0.0;
}
ostream& operator<< (ostream& s, const Vector& v)
{
s << "(" << v.x() << ", " << v.y() << ", " << v.z() << ")";
return s;
}

View File

@ -0,0 +1,158 @@
#ifndef _CCMVECTOR_H
#define _CCMVECTOR_H
#include <math.h>
#include <iostream>
class Vector
{
public:
Vector() {
_xyz[0] = 0.0;
_xyz[1] = 0.0;
_xyz[2] = 0.0;
}
Vector(float x, float y, float z) {
_xyz[0] = x;
_xyz[1] = y;
_xyz[2] = z;
}
Vector(const Vector& p1, const Vector& p2) {
_xyz[0] = p2._xyz[0] - p1._xyz[0];
_xyz[1] = p2._xyz[1] - p1._xyz[1];
_xyz[2] = p2._xyz[2] - p1._xyz[2];
}
Vector(const float *xyz) {
_xyz[0] = xyz[0];
_xyz[1] = xyz[1];
_xyz[2] = xyz[2];
}
void set(int i, float val) {
_xyz[i] = val;
}
void setXYZ(const float *xyz) {
_xyz[0] = xyz[0];
_xyz[1] = xyz[1];
_xyz[2] = xyz[2];
}
void setXYZ(float x, float y, float z) {
_xyz[0] = x;
_xyz[1] = y;
_xyz[2] = z;
}
void axpy(float a, const Vector& x, const Vector& y) {
_xyz[0] = a*x._xyz[0] + y._xyz[0];
_xyz[1] = a*x._xyz[1] + y._xyz[1];
_xyz[2] = a*x._xyz[2] + y._xyz[2];
}
float x() const {return _xyz[0];}
float y() const {return _xyz[1];}
float z() const {return _xyz[2];}
const float *xyz() const {return _xyz;}
float& operator[](unsigned int i) { return _xyz[i]; }
float mag() const {
return sqrt(_xyz[0]*_xyz[0] +
_xyz[1]*_xyz[1] +
_xyz[2]*_xyz[2]);
}
float mag_squared() const {
return _xyz[0]*_xyz[0] +
_xyz[1]*_xyz[1] +
_xyz[2]*_xyz[2];
}
int normalize() {
float mag = this->mag();
if (mag < 1.0e-9)
return 1;
float scale = 1.0f / mag;
for(int i=0; i<3; i++)
_xyz[i] *= scale;
return 0;
}
Vector& operator+=(const Vector& v1) {
_xyz[0] += v1._xyz[0];
_xyz[1] += v1._xyz[1];
_xyz[2] += v1._xyz[2];
return *this;
}
Vector& operator-=(const Vector& v1) {
_xyz[0] -= v1._xyz[0];
_xyz[1] -= v1._xyz[1];
_xyz[2] -= v1._xyz[2];
return *this;
}
Vector& operator*=(const float scale) {
_xyz[0] *= scale;
_xyz[1] *= scale;
_xyz[2] *= scale;
return *this;
}
Vector operator-(const Vector &v) const {
return Vector(
this->_xyz[0] - v._xyz[0],
this->_xyz[1] - v._xyz[1],
this->_xyz[2] - v._xyz[2]);
}
Vector operator+(const Vector &v) const {
return Vector(
this->_xyz[0] + v._xyz[0],
this->_xyz[1] + v._xyz[1],
this->_xyz[2] + v._xyz[2]);
}
static float distance(const Vector& v1, const Vector& v2) {
return sqrt((v1._xyz[0]-v2._xyz[0])*(v1._xyz[0]-v2._xyz[0])+
(v1._xyz[1]-v2._xyz[1])*(v1._xyz[1]-v2._xyz[1])+
(v1._xyz[2]-v2._xyz[2])*(v1._xyz[2]-v2._xyz[2]));
}
static float distance_squared(const Vector& v1, const Vector& v2) {
return (v1._xyz[0]-v2._xyz[0])*(v1._xyz[0]-v2._xyz[0])+
(v1._xyz[1]-v2._xyz[1])*(v1._xyz[1]-v2._xyz[1])+
(v1._xyz[2]-v2._xyz[2])*(v1._xyz[2]-v2._xyz[2]);
}
static Vector cross(const Vector& v1, const Vector& v2) {
return Vector(
v1._xyz[1] * v2._xyz[2] - v1._xyz[2] * v2._xyz[1],
v1._xyz[2] * v2._xyz[0] - v1._xyz[0] * v2._xyz[2],
v1._xyz[0] * v2._xyz[1] - v1._xyz[1] * v2._xyz[0]);
}
static Vector subtract_component(const Vector& v, const Vector& dir) {
float dot = Vector::dot(v, dir);
return Vector(v._xyz[0] - dot*dir._xyz[0],
v._xyz[1] - dot*dir._xyz[1],
v._xyz[2] - dot*dir._xyz[2]);
}
static float dot(const Vector& v1, const Vector& v2) {
return v1._xyz[0]*v2._xyz[0] +
v1._xyz[1]*v2._xyz[1] +
v1._xyz[2]*v2._xyz[2];
}
float distanceToSegment(const Vector& p1, const Vector& p2) const;
private:
float _xyz[3];
};
std::ostream& operator<< (std::ostream& s, const Vector& v);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,120 @@
2.6.1
- Fixed a 1 byte buffer overrun if reading a node involves converting to a different data type than is stored.
2.6.0
- Altered CCM format to allow entries that are up to 2^64 bytes. This involves
a number of changes to the core API:
- CCMIOGetDimensions and CCMIO*SetDataType* now take a CCMIOIndex.
- All CCMIORead(1|2|3)* and CCMIOWrite(1|2|3)* functions take a CCMIOIndex
for start and end, and x, y, z (as applicable).
- CCMIOSetDataType() requires all arguments in the variable-length argument
to be a CCMIOIndex.
- Removed CCMIOWriteData, CCMIOWriteDataPoint, CCMIOReadData, CCMIOReadDataPoint
- Removed CCMIOBuffer interface.
2.5.12
- Fixed failure in CCMIOGetDimensions on AIX.
2.5.11
- Fixed corruption problem on Solaris.
2.5.10
- Fixed problem reading old (pre-2.3.0) files with index != 0.
2.5.9
- Changed CCMIOCompress() to use mktemp() instead of tempnam(); this
eliminates any effects of the TMPDIR environment variable.
2.5.8
- Changed CCMIOWriteState() to no longer clear the problem state; this
ensures that the .ccm file can be exactly overwritten in place. (Otherwise
CCMIOWriteState() deletes stuff, and then ADF loses disk space)
- Added CCMIOInvalidateEntity(), which guarantees that an entity is invalid.
- Fixed a rare data corruption problem with fwrite caching.
2.5.7
- Added the adfdump program to help in debugging. It makes an ascii file out
of the adf file.
2.5.6
- Changed code to allow the interface node to be either under cells or
topology. This will be changed to just topology in a month. 2005-Sept-02
- Also contains a fix to a crash caused by fwrite caching.
2.5.5
- Added fwrite/fread caching to the ADF library. This improves NFS performance
on Linux 2.4 by an order of magnitude.
- Fixed ADF library to properly handle the same file open multiple times.
2.5.4
- Added CCMIONewProstarSet() and CCMIOGetProstarSet() to store Prostar-type
cell sets, vertex sets, etc.
2.5.3
- Changed all Write functions to only write the dimension information when
start == kCCMIOStart, so buffered writing must now start from 0.
This significantly speeds up buffered writes.
- Fixed a few bugs in the caching that was introduced in 2.5.0
2.5.2
- Changed ADF to only write the modification time when the file is closed.
This helps performance over Linux 2.4 NFS by 10 - 20%.
2.5.1
- ADF library updated from CGNS.
2.5.0
- Normalized sizes to be unsigned ints in function prototypes.
- Fixed n^2 bug when writing large numbers of nodes.
- Added processor nodes to allowed nodes for CCMIOGetEntityIndex().
- Removed CCMIOWriteTop(): Use CCMIOWriteOpt1i() instead
2.4.4
- Added CCMIOWriteTop() (WRO).
2.4.3
2.4.2
- Changes to the Makefiles and installation structure. Also Wayne's private
functions.
2.4.1
- Fixed crash while reading old files and translating to a different data type
than stored on disk.
2.4.0
- Added solver restart node (kCCMIORestart), solver-specific restart data
(kCCMIORestartData), reference data node (kCCMIOReferenceData), and
physical constants (kCCMIOModelConstants).
- Modified the ADF library to now write binary information at the beginning
of the file so that email clients and WinZip detect the file as binary.
- Changed the format of multidimensional post data (e.g. vectors and tensors)
to be stored by component.
- Added CCMIOWriteConstantFieldData*() to write a set of data that is all
the same value. Reading this field will expand it back into copies of
that value in the resulting array.
2.3.0
- Added start and end parameters to all read and write functions for
buffered I/O.
- All arrays must now be in C order (and dimensions in C dimensions) so
that buffering works properly.
- CCMIOWriteFaces() has been split into CCMIOWriteFaces() and
CCMIOWriteFaceCells() (likewise for the read functions) in order to
properly buffer the face stream and the cells.
2.2.0
- Added kCCMIOFieldPhase node as a parent of the field data.
- Added short names for prostar.
- Tied file version node to library version.
2.1.1
- Added CCMIOGetOptInfo().
- Added kCCMIOInterfaces as a node type.
2.1.0
- Changed name to CCM.
- Added integer field data.
- Added Lagrangian support.
- State node now has a description.
2.0.0
- New SFF API requiring arrays to be written directly.

View File

@ -0,0 +1,41 @@
all copy clean qmake test:
if [ -d libadf ]; then cd libadf; ${MAKE} -f Makefile.qmake $@; fi
if [ -d libccmio ]; then cd libccmio; ${MAKE} -f Makefile.qmake $@; fi
if [ -d libcgns ]; then cd libcgns; ${MAKE} -f Makefile.qmake $@; fi
install:
@if [ -z "$(MK_BUILDNAME)" ]; then \
echo "MK_BUILDNAME must be set to the computer type you are installing."; \
else \
set -x; \
echo "MK_BUILDNAME=$${MK_BUILDNAME}"; \
./Makefile.install.sc $${MK_BUILDNAME}; \
fi
docs:
if [ -d docs ]; then cd docs; ${MAKE} all; fi
# Internal target suitable for batch building
batch: all
if [ -d libadf ]; then cd libadf; RELEASE=1 ${MAKE} -f Makefile.qmake all; fi
if [ -d libccmio ]; then cd libccmio; RELEASE=1 ${MAKE} -f Makefile.qmake all; fi
if [ -d libcgns ]; then cd libcgns; RELEASE=1 ${MAKE} -f Makefile.qmake all; fi
if [ -d libadf ]; then cd libadf; RELEASE=1 STATIC=1 ${MAKE} -f Makefile.qmake all; fi
if [ -d libccmio ]; then cd libccmio; RELEASE=1 STATIC=1 ${MAKE} -f Makefile.qmake all; fi
if [ -d libcgns ]; then cd libcgns; RELEASE=1 STATIC=1 ${MAKE} -f Makefile.qmake all; fi
rm -f *.a
rm -f *.so
-# Copy all the .a and .so from each directory in lib. This should
-# only be one directory, but cp lib/*/release-shared/lib*.so doesn't
-# work on AIX and HPUX. Also copy the static libraries first, because
-# they are always named .a, but the shared objects may fail on AIX
libdirs=`ls lib`; for dir in $$libdirs; do cp lib/$${dir}/release-static/lib*.a .; cp lib/$${dir}/release-shared/lib*.s* .; done
dist: docs
./makedist
#
# Automatic setting of emacs local variables.
# Local Variables:
# tab-width: 2
# End:

View File

@ -0,0 +1,69 @@
This is the CD-adapco CCM file I/O library, libccmio.
The library is built with qmake (www.trolltech.com), which is included in
this distribution. The following platforms are supported, although other
platforms can likely be made to work with tweaks to the
config/<platform>/qmake.conf file:
aix64_4.3-pwr3
aix64_5.1-pwr4
aix_4.3-com
hpux64_11.00-pa8000
hpux64_11.22-itanium2
hpux_11.00-pa8000
irix64_6.5-mips4
irix_6.5-mips3
linux64_2.4-itanium-glibc_2.2.4
linux64_2.4-x86-glibc_2.2.5
linux64_2.6-pwr4-glibc_2.3.3
linux_2.2-x86-glibc_2.2.0
linux_2.4-x86-glibc_2.3.2
osf1_5.1-com
sunos64_5.8-ultra
sunos_5.8-ultra
windows-x86-gcc
windows-vc.net
The library can be built on Windows with either the Cygwin Unix emulation layer
(www.cygwin.com), MinGW (www.mingw.org), Win32 gcc using the
windows-x86-gcc profile, or with Visual Studio .NET using windows-vc.net.
Directions for VS .NET are given at the end of this file.
By default static libraries in release mode of the library will be compiled.
Other versions can be compiled with the following commands:
`make` static, release
`make shared` shared, release
`make debug-static` static, debug
`make debug-shared` shared, debug
Binaries will be located in
lib/<platform>/<debug-shared|debug-static|release-shared|release-static>/
Only release-static is available on Windows.
Documentation is located in docs/html/index.html and can be regenerated
with `make docs`, assuming that doxygen >= 1.3.6 is in your path.
The file format itself is documented in docs/CCMFileFormat.pdf.
Sample CCM files are located in the data/ directory, including files from
older versions of the library that require special-case code to read with
newer versions (please see the "Backwards Compatibility" section of the
documentation for more details). Note that .sff files are old CCM files.
ADF library:
This distribution includes a copy of the ADF library that has been modified
from the original code to greatly increase performance over NFS. It should be
completely interchangeable with the official ADF library (available at
http://sourceforge.net/projects/cgns/). If you wish to use the standard
distribution, simply copy the appropriate ADF files into the libadf/ directory
before building.
Compiling with VC.NET:
In order to compile with VC.NET, the VC.NET command line environment must
be properly set up (Microsoft includes a batch script for precisely this
purpose). Specifically, nmake and devenv must be in your path. Once your
environment is correctly set up, execute the following:
cd libccmio-x.y.z
set QTDIR=%CD%\config\windows-vc.net
set QMAKESPEC=%QTDIR%
set PATH=%QTDIR%;%PATH%
nmake /f Makefile.win32

View File

@ -0,0 +1,130 @@
#!/bin/sh
set -x
CWD=`pwd`
if expr ${CWD} : /tmp_mnt 1>/dev/null 2>&1; then
CWD=`expr ${CWD} : "/tmp_mnt\(.*\)"`;
fi
# What version of MeshKernel are we going to compile?
DATE=`date "+%F"`
VERS=V`awk '/^#define kCCMIOMajorVersion/ { major = $3; } /^#define kCCMIOMinorVersion/ { minor = $3; } /^#define kCCMIORevision/ { revision = $3 } END { printf "%d-%02d-%03d\n", major, minor, revision; }' libccmio/ccmioversion.h`
DELT=`cvs status -v README.make | awk "/${VERS}/ { print \\\$1; }"`
VERS="${VERS}_${DATE}"
if [ "${DELT}" ]; then
cvs tag -d "${DELT}"
fi
cvs tag "${VERS}"
# Compile aix64_5.1-pwr4
echo Job submitted `date` > make.ibm36.list.batch
REMDIR=/u/xeon25/ibm36/starusers/wayne/libs/libccmio
rsh ibm36 "\
cd ${CWD}; \
/usr/local/bin/qclient -q 4 -t 2 \
-s \"${REMDIR}/compile.ibm36 ${REMDIR} ${CWD} ${VERS}\" \
-f make.ibm36.list.qlogerr -F make.ibm36.list.qlogerr \
"
# Compile hpux_11.00-pa8000
# Compile hpux64_11.00-pa8000
echo Job submitted `date` > make.hp9.list.batch
REMDIR=/u1/hp9/starusers/wayne/libs/libccmio
rsh hp9 "\
cd ${CWD}; \
/usr/local/bin/qclient -s \"${REMDIR}/compile.hp9 ${REMDIR} ${CWD} ${VERS}\" \
-f make.hp9.list.qlogerr -F make.hp9.list.qlogerr \
"
# Compile hpux64_11.22-itanium2
echo Job submitted `date` > make.hp10.list.batch
REMDIR=/u1/hp10/starusers/wayne/libs/libccmio
rsh hp10 "\
cd ${CWD}; \
/usr/local/bin/qclient -q 0 -s \"${REMDIR}/compile.hp10 ${REMDIR} ${CWD} ${VERS}\" \
-f make.hp10.list.qlogerr -F make.hp10.list.qlogerr \
"
# Compile irix_6.5-mips3
# Compile irix64_6.5-mips4
echo Job submitted `date` > make.sg3.list.batch
REMDIR=/u/xeon25/sg3/starusers/wayne/libs/libccmio
rsh sg3 "\
cd ${CWD}; \
/usr/local/bin/qclient -q 1 -s \"${REMDIR}/compile.sg3 ${REMDIR} ${CWD} ${VERS}\" \
-f make.sg3.list.qlogerr -F make.sg3.list.qlogerr \
"
# Compile linux_2.2-x86-glibc_2.2.0
echo Job submitted `date` > make.linux1.list.batch
REMDIR=/u/linux1/wayne/libs/libccmio
rsh linux1 "\
cd ${CWD}; \
/usr/local/bin/qclient -q 1 -s \"${REMDIR}/compile.linux1 ${REMDIR} ${CWD} ${VERS}\" \
-f make.linux1.list.qlogerr -F make.linux1.list.qlogerr \
"
# Compile linux_2.4-x86-glibc_2.3.2
echo Job submitted `date` > make.linux17.list.batch
REMDIR=/u1/linux17/starusers/wayne/libs/libccmio
rsh linux17 "\
cd ${CWD}; \
/usr/local/bin/qclient -q 1 -s \"${REMDIR}/compile.linux17 ${REMDIR} ${CWD} ${VERS}\" \
-f make.linux17.list.qlogerr -F make.linux17.list.qlogerr \
"
# Compile linux64_2.4-itanium-glibc_2.2.4
echo Job submitted `date` > make.itanium.list.batch
REMDIR=/u/itanium/starusers/wayne/libs/libccmio
rsh itanium "\
cd ${CWD}; \
/usr/local/bin/qclient -q 0 -s \"${REMDIR}/compile.itanium ${REMDIR} ${CWD} ${VERS}\" \
-f make.itanium.list.qlogerr -F make.itanium.list.qlogerr \
"
# Compile linux64_2.4-x86-glibc_2.2.5
echo Job submitted `date` > make.hammer.list.batch
REMDIR=/u/hammer/wayne/libs/libccmio
rsh hammer "\
cd ${CWD}; \
/usr/local/bin/qclient -s \"${REMDIR}/compile.hammer ${REMDIR} ${CWD} ${VERS}\" \
-f make.hammer.list.qlogerr -F make.hammer.list.qlogerr \
"
# Compile osf1_5.1-com
echo Job submitted `date` > make.alpha24.list.batch
REMDIR=/u/alpha24/starusers/wayne/libs/libccmio
rsh alpha24 "\
cd ${CWD}; \
/usr/local/bin/qclient -s \"${REMDIR}/compile.alpha24 ${REMDIR} ${CWD} ${VERS}\" \
-f make.alpha24.list.qlogerr -F make.alpha24.list.qlogerr \
"
# Compile sunos64_5.8-ultra
echo Job submitted `date` > make.sun7.list.batch
REMDIR=/u3/sun7/starusers/wayne/libs/libccmio
rsh sun7 "\
cd ${CWD}; \
/usr/local/bin/qclient -s \"${REMDIR}/compile.sun7 ${REMDIR} ${CWD} ${VERS}\" \
-f make.sun7.list.qlogerr -F make.sun7.list.qlogerr \
"

View File

@ -0,0 +1,46 @@
#!/bin/sh
set -x
# Compile aix64_5.1-pwr4
cd /u2/regatta1/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile hpux_11.00-pa8000
# Compile hpux64_11.00-pa8000
cd /u1/hp9/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile hpux64_11.22-itanium2
cd /u1/hp10/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile irix_6.5-mips3
# Compile irix64_6.5-mips4
cd /usr1/sg14/wayne/libs/libccmio
'rm' -r include lib obj
# Compile linux_2.2-x86-glibc_2.2.0
cd /u/linux1/wayne/libs/libccmio
'rm' -r include lib obj
# Compile linux_2.4-x86-glibc_2.3.2
cd /u1/linux17/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile linux64_2.4-itanium-glibc_2.2.4
cd /u/itanium/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile linux64_2.4-x86-glibc_2.2.5
cd /u/hammer/wayne/libs/libccmio
'rm' -r include lib obj
# Compile osf1_5.1-com
cd /u/alpha24/starusers/wayne/libs/libccmio
'rm' -r include lib obj
# Compile sunos_5.8-ultra
# Compile sunos64_5.8-ultra
cd /u/sun5/wayne/libs/libccmio
'rm' -r include lib obj

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile osf1_5.1-com
MK_BUILDNAME=osf1_5.1-com; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.alpha24.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.alpha24.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile linux64_2.4-x86-glibc_2.2.5
MK_BUILDNAME=linux64_2.4-x86-glibc_2.2.5; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.hammer.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.hammer.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile hpux64_11.22-itanium2
MK_BUILDNAME=hpux64_11.22-itanium2; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.hp10.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.hp10.list.batch

View File

@ -0,0 +1,49 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.hp9.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
# Compile hpux_11.00-pa8000
MK_BUILDNAME=hpux_11.00-pa8000; export MK_BUILDNAME;
make -k -f Makefile.qmake RELEASE=1 STATIC=1 MACH_MOD=32 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 MACH_MOD=32 all
separator
make -f Makefile.qmake install
separator
# Compile hpux64_11.00-pa8000
MK_BUILDNAME=hpux64_11.00-pa8000; export MK_BUILDNAME;
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.hp9.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:/usr/vacpp/bin:$PATH:/lnxsrv/prog; export PATH
# Compile aix64_5.1-pwr4
MK_BUILDNAME=aix64_5.1-pwr4; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.ibm36.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.ibm36.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile linux64_2.4-itanium-glibc_2.2.4
MK_BUILDNAME=linux64_2.4-itanium-glibc_2.2.4; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.itanium.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.itanium.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile linux_2.2-x86-glibc_2.2.0
MK_BUILDNAME=linux_2.2-x86-glibc_2.2.0; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.linux1.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.linux1.list.batch

View File

@ -0,0 +1,35 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
# Compile linux_2.4-x86-glibc_2.3.2
MK_BUILDNAME=linux_2.4-x86-glibc_2.3.2; export MK_BUILDNAME;
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.linux17.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.linux17.list.batch

View File

@ -0,0 +1,49 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:$PATH:/lnxsrv/prog; export PATH
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.sg3.list 2>&1
cd $1
cvs update -r $3 -d -P
separator
# Compile irix_6.5-mips3
MK_BUILDNAME=irix_6.5-mips3; export MK_BUILDNAME;
make -k -f Makefile.qmake RELEASE=1 STATIC=1 MACH_MOD=32 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 MACH_MOD=32 all
separator
make -f Makefile.qmake install
separator
# Compile irix64_6.5-mips4
MK_BUILDNAME=irix64_6.5-mips4; export MK_BUILDNAME;
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.sg3.list.batch

View File

@ -0,0 +1,49 @@
#!/bin/sh -x
PATH=/adapco/prog/bin:/opt/SUNWspro/bin:$PATH:/lnxsrv/prog; export PATH
separator()
{
set +x
echo
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<< separator >>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
echo
set -x
}
exec > make.sun7.list 2>&1
cd $1
cvs update -r $3 -d -P
#separator
## Compile sunos_5.8-ultra
#MK_BUILDNAME=sunos_5.8-ultra; export MK_BUILDNAME;
#make -k -f Makefile.qmake RELEASE=1 STATIC=1 MACH_MOD=32 all
#
#separator
#make -k -f Makefile.qmake RELEASE=1 STATIC=0 MACH_MOD=32 all
#
#separator
#make install
separator
# Compile sunos64_5.8-ultra
MK_BUILDNAME=sunos64_5.8-ultra; export MK_BUILDNAME;
make -k -f Makefile.qmake RELEASE=1 STATIC=1 all
separator
make -k -f Makefile.qmake RELEASE=1 STATIC=0 all
separator
make -f Makefile.qmake install
echo Job "finished " `date` >> $2/make.sun7.list.batch

View File

@ -0,0 +1,73 @@
all: qmake copy
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT)
copy: qmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
#$${MAKE} -f Makefile.$(PROJECT) install_headers
qmake:
$(PATHTOSRC)/config/runqmake $(PATHTOSRC) \
-o Makefile.$(PROJECT) $(PROJECT).pro 2>&1 | tee qmake.vars
test: tqmake tcopy
# We need to make sure the main portion is build before we build the test.
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT); \
if [ -d test ]; then cd test; $(MAKE) $@; fi
tcopy: tqmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
#$${MAKE} -f Makefile.$(PROJECT) install_headers
tqmake:
TEST=1; export TEST; \
$(PATHTOSRC)/config/runqmake $(PATHTOSRC) \
-o Makefile.$(PROJECT) $(PROJECT).pro 2>&1 | tee qmake.vars
clean: qmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT) distclean; \
if [ -d test ]; then cd test; $(MAKE) $@; fi
tags:
etags *.h *.cpp
FORCE:

View File

@ -0,0 +1,58 @@
all: qmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT); \
if [ -x ./run.test ]; then \
./run.test "$${TEST}" "$${test}" "$(PATHTOSRC)"; \
else \
exit 0; \
fi
qmake:
$(PATHTOSRC)/config/runqmake $(PATHTOSRC) \
-o Makefile.$(PROJECT) $(PROJECT).pro 2>&1 | tee qmake.vars
test: tqmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT); \
TEST=1; export TEST; \
if [ -x ./run.test ]; then \
./run.test "$${TEST}" "$${test}" "$(PATHTOSRC)"; \
else \
exit 0; \
fi
tqmake:
TEST=1; export TEST; \
$(PATHTOSRC)/config/runqmake $(PATHTOSRC) \
-o Makefile.$(PROJECT) $(PROJECT).pro 2>&1 | tee qmake.vars
clean: qmake
@eval `grep export qmake.vars | awk '{ $$1=""; $$2=""; print; }'`; \
if [ x$$MK_BUILDNAME = xwindows-x86 ]; then \
MAKE="nmake -nologo"; \
MAKEFLAGS=; \
else \
MAKE=$(MAKE); \
fi; \
$${MAKE} -f Makefile.$(PROJECT) distclean
tags:
etags *.h *.cpp
copy:

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,97 @@
#
# $Id: qmake.conf,v 1.3 2004/08/24 14:06:52 wayne Exp $
#
# qmake configuration for aix-xlc
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = xlc
QMAKE_CC_THREAD = xlc_r
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -q64 -ma -qrndsngl -qnomaf -qstrict -DLARGE_FILES
# -qwarn64 turns on too many bogus warnings and shadows real warnings
#QMAKE_CFLAGS_WARN_ON = -qwarn64
QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF =
QMAKE_CFLAGS_RELEASE = -O3
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB =
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -qthreaded
QMAKE_CXX = xlC
QMAKE_CXX_THREAD = xlC_r
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -qrtti=all -qnotempinc
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL =
QMAKE_LIBDIR_OPENGL =
QMAKE_LINK = xlC
QMAKE_LINK_THREAD = xlC_r
QMAKE_LINK_SHLIB = ld
QMAKE_LINK_SHLIB_CMD = makeC++SharedLib -p 0 -X64 \
-o $(TARGETD) \
$(LFLAGS) $(OBJECTS) $(OBJMOC) $(LIBS); \
$(AR) lib$(QMAKE_TARGET).a $(TARGETD); \
$(RANLIB) lib$(QMAKE_TARGET).a; \
mv lib$(QMAKE_TARGET).a $(DESTDIR)
QMAKE_LFLAGS = -q64 -qnotempinc
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB =
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS_THREAD = -L/usr/lib/threads
QMAKE_AIX_SHLIB = 1
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm -lbind
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu
QMAKE_LIBS_THREAD = -lpthreads
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar -X64 cq
QMAKE_RANLIB = ranlib -X64
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += AIX64_5_1_PWR4
MK_BUILDNAME = aix64_5.1-pwr4
MK_LIBS_STLPORT = -lstlport_xlC50
MK_LIBS_STLPORT_DEBUG = -lstlport_xlC50

View File

@ -0,0 +1,96 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dlfcn.h>
#include <strings.h> // AIX X11 headers define FD_ZERO using bzero()
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// On AIX header files <netinet/in.h> and <arpa/nameser.h> are not
// included by <resolv.h>. Note that <arpa/nameser.h> must be included
// before <resolv.h>.
#include <netinet/in.h>
#define class nsrr_class // AIX 4.3.1.0
#include <arpa/nameser.h>
#undef class
#include <resolv.h>
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
// Only AIX 4.3 and better supports 64-bit.
// The AIX 4.3 online documentation says 'size_t' but a user asked IBM
// and they told him the documentation is wrong. Indeed 'size_t' is
// obviously wrong for 64-bit programming. And anyway 'socklen_t'
// reportedly works for all AIX 4.3 users.
#define QT_SOCKLEN_T socklen_t
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
// Only AIX 4.3 and better supports 64-bit.
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,97 @@
#
# $Id: qmake.conf,v 1.1 2005/09/29 22:19:19 geoffp Exp $
#
# qmake configuration for aix-xlc
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = xlc
QMAKE_CC_THREAD = xlc_r
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -q32 -ma -qrndsngl -qnomaf -qstrict -DLARGE_FILES
# -qwarn64 turns on too many bogus warnings and shadows real warnings
#QMAKE_CFLAGS_WARN_ON = -qwarn64
QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF =
QMAKE_CFLAGS_RELEASE = -O3
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB =
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -qthreaded
QMAKE_CXX = xlC
QMAKE_CXX_THREAD = xlC_r
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS -qrtti=all -qnotempinc
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL =
QMAKE_LIBDIR_OPENGL =
QMAKE_LINK = xlC
QMAKE_LINK_THREAD = xlC_r
QMAKE_LINK_SHLIB = ld
QMAKE_LINK_SHLIB_CMD = makeC++SharedLib -p 0 -X32 \
-o $(TARGETD) \
$(LFLAGS) $(OBJECTS) $(OBJMOC) $(LIBS); \
$(AR) lib$(QMAKE_TARGET).a $(TARGETD); \
$(RANLIB) lib$(QMAKE_TARGET).a; \
mv lib$(QMAKE_TARGET).a $(DESTDIR)
QMAKE_LFLAGS = -q32 -qnotempinc
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB =
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME =
QMAKE_LFLAGS_THREAD = -L/usr/lib/threads
QMAKE_AIX_SHLIB = 1
QMAKE_LIBS =
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11 -lm -lbind
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu
QMAKE_LIBS_THREAD = -lpthreads
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar -X32 cq
QMAKE_RANLIB = ranlib -X32
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += AIX_5_1_PWR4
MK_BUILDNAME = aix_5.1-pwr4
MK_LIBS_STLPORT = -lstlport_xlC50
MK_LIBS_STLPORT_DEBUG = -lstlport_xlC50

View File

@ -0,0 +1,96 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dlfcn.h>
#include <strings.h> // AIX X11 headers define FD_ZERO using bzero()
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/select.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// On AIX header files <netinet/in.h> and <arpa/nameser.h> are not
// included by <resolv.h>. Note that <arpa/nameser.h> must be included
// before <resolv.h>.
#include <netinet/in.h>
#define class nsrr_class // AIX 4.3.1.0
#include <arpa/nameser.h>
#undef class
#include <resolv.h>
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
// Only AIX 4.3 and better supports 64-bit.
// The AIX 4.3 online documentation says 'size_t' but a user asked IBM
// and they told him the documentation is wrong. Indeed 'size_t' is
// obviously wrong for 64-bit programming. And anyway 'socklen_t'
// reportedly works for all AIX 4.3 users.
#define QT_SOCKLEN_T socklen_t
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
// Only AIX 4.3 and better supports 64-bit.
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,107 @@
include($${PATHTOSRC}version.pro)
include($${PATHTOSRC}config/config.pro)
aix_4.3-com:CONFIG += thread
aix64_4.3-pwr3:CONFIG += thread
# Put the current build name in CONFIG so I can branch off it.
CONFIG += $$MK_BUILDNAME
contains(RELEASEMODE, release) {
CONFIG -= debug
CONFIG += release
message("Building in release mode")
}
contains(RELEASEMODE, debug) {
CONFIG -= release
CONFIG += debug
message("Building in Debug mode")
}
CONFIG -= qt
equals( LIBMODE, dynamic ) {
CONFIG -= staticlib
CONFIG += dll
windows-x86-gcc:QMAKE_EXTENSION_SHLIB = dll
message( "Building dynamic libraries" )
} else {
CONFIG -= dll
CONFIG += staticlib
message( "Building static libraries" )
}
dll:RELEASEMODE = $$RELEASEMODE-shared
else:RELEASEMODE = $$RELEASEMODE-static
#equals( TESTMODE, test ) {
# DEFINES += TESTING
# RELEASEMODE = $${RELEASEMODE}-testing
# message( "Building in test mode" )
#}
# This define is needed to compile cgns correctly on HP. WRO 2005-Feb-28
hpux_11.00-pa8000: DEFINES += LOWERCASE
hpux64_11.00-pa8000: DEFINES += LOWERCASE
hpux64_11.22-itanium2: DEFINES += LOWERCASE
# Is profiling requested?
!isEmpty(PROFILEMODE) {
RELEASEMODE = $$RELEASEMODE$$PROFILEMODE
QMAKE_CFLAGS += $$PROFILEMODE
QMAKE_CXXFLAGS += $$PROFILEMODE
QMAKE_LFLAGS += $$PROFILEMODE
message( "Building in profile mode: $$PROFILEMODE" )
}
# Where is qmake?
QMAKE_QMAKE = $${PATHTOSRC}config/$$MK_BUILDNAME/qmake
########################## Compiler Options #######################
# Allow user to override the default compiler options with
# environmental variables.
!isEmpty( CC ) {
QMAKE_CC = $$CC
}
!isEmpty( CXX ) {
equals( QMAKE_LINK, $$QMAKE_CXX ) {
QMAKE_LINK = $$CXX
}
equals( QMAKE_LINK_SHLIB, $$QMAKE_CXX ) {
QMAKE_LINK_SHLIB = $$CXX
}
QMAKE_CXX = $$CXX
}
##################################################################
CCMBASE = $$PATHTOSRC
CCMINC = $$CCMBASE/include
CCMLIB = $$CCMBASE/lib/$$MK_BUILDNAME/$$RELEASEMODE
CCMBIN = $$CCMBASE/bin/$$MK_BUILDNAME/$$RELEASEMODE
CCMOBJ = $$CCMBASE/obj/$$MK_BUILDNAME/$$RELEASEMODE
##################################################################
INCLUDEPATH += \
$$PATHTOSRC \
$$CCMINC
#DEPENDPATH += $$CCMINC
DESTDIR = $$CCMLIB
contains(TEMPLATE,app) {
DESTDIR = $$CCMBIN
}
OBJECTS_DIR = $$CCMOBJ
#headers.path = $$CCMINC
#headers.files = *.h
#INSTALLS += headers
#message ( "CONFIG=$$CONFIG" )
message ( "MK_BUILDNAME=$$MK_BUILDNAME; export MK_BUILDNAME;" )
message ( "RELEASEMODE=$$RELEASEMODE; export RELEASEMODE;" )

View File

@ -0,0 +1,42 @@
#!/bin/sh
# $Id: config.gnu.to.star,v 1.4 2006/06/05 21:12:16 geoffp Exp $
# Convert the modified gnu machine type used in ammbatch from the config.system
# script to the star machine type. Return unknown if there is no known match.
# Also process MACHMOD ($2) to see if we want to compile with different than
# the default options.
# echo Input is ${1:-null}-${2:-null}
case ${1:-null}-${2:-null} in
rs6000-ibm-aix4.3.0-32) echo aix_4.3-com ;;
rs6000-ibm-aix4.3.0-null) echo aix64_4.3-pwr3 ;;
rs6000-ibm-aix5.1.0-32) echo aix_5.1-pwr4 ;;
rs6000-ibm-aix5.1.0-null) echo aix64_5.1-pwr4 ;;
hppa1.1-hp-hpux-10.20-null) echo hpux_10.20-com ;;
hppa2.0-hp-hpux-11.00-32) echo hpux_11.00-pa8000 ;;
hppa2.0-hp-hpux-11.00-null) echo hpux64_11.00-pa8000 ;;
ia64-hp-hpux11.22-null) echo hpux64_11.22-itanium2 ;;
mips-sgi-irix6-32) echo irix_6.5-mips3 ;;
mips-sgi-irix64_6-32) echo irix_6.5-mips3 ;;
mips-sgi-irix64_6-null) echo irix64_6.5-mips4 ;;
i586-unknown-linux_2.2-glibc-null) echo linux_2.2-x86-glibc_2.2.0 ;;
i586-unknown-linux_2.4-glibc-null) echo linux_2.4-x86-glibc_2.3.2 ;;
ia64-unknown-linux-null) echo linux64_2.4-itanium-glibc_2.2.4 ;;
alpha-dec-osf3-null) echo osf1_4.0-com ;;
alpha-dec-osf5-null) echo osf1_5.1-com ;;
sparc-sun-sunos-5.8-32) echo sunos_5.8-ultra ;;
sparc-sun-sunos-5.8-null) echo sunos64_5.8-ultra ;;
i686-pc-mingw32-null) echo windows-x86-gcc ;;
i686-pc-mingw32-vc) echo windows-x86 ;;
x86_64-unknown-linux-gnu-null) echo linux64_2.4-x86-glibc_2.2.5 ;;
ppc64-unknown-linux-gnu-null) echo linux64_2.6-pwr4-glibc_2.3.3 ;;
*) echo unknown ;;
esac
# Automatic setting of emacs local variables.
# Local Variables:
# tab-width: 8
# End:

View File

@ -0,0 +1,25 @@
# Settings in this file will override those in the default configuration.
#
######################### Compilation Options #####################
# Default release/debug options.
isEmpty(RELEASEMODE) {
RELEASEMODE = debug
}
######################### MeshKernel Options #####################
# The base directory to install includes, libs, and objects
# Defaults to PATH_TO_SRC/..
KERNELBASE=
# Directory to install include (header) files.
# Defaults to KERNELBASE/include
KERNELINC=
# Directory to install library files.
# Defaults to KERNELBASE/lib/BUILDNAME/RELEASEMODE
KERNELLIB=
# Directory to store object files.
# Defaults to KERNELBASE/obj/BUILDNAME/RELEASEMODE
KERNELOBJ=

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,111 @@
#
# $Id: qmake.conf,v 1.5 2006/03/24 13:51:52 wo Exp $
#
# qmake configuration for hpux-acc
#
# We define _POSIX_C_SOURCE to 199506L when using threads, therefore
# we also need to redefine _HPUX_SOURCE. See pthread(3t) for more details.
#
# From the "HP aC++ Online Programmer's Guide":
# Using +DS to Specify Instruction Scheduling:
# * By default, the compiler performs scheduling tuned for the system
# on which you are compiling, or, if specified, tuned for the setting
# of the +DA option.
#
# From the online "C/HP-UX Reference Manual":
# -Aa
# Enables strict ANSI C compliance.
# -Ae
# Enables ANSI C compliance, HP value-added features (as described
# for +e option), and _HPUX_SOURCE name space macro. It is equivalent
# to -Aa +e -D_HPUX_SOURCE.
# +e
# Enables the following HP value added features while compiling in
# ANSI C mode: sized enum, long long, long pointers, compiler supplied
# defaults for missing arguments to intrinsic calls, and $ in identifier
# HP C extensions.
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = /opt/ansic/bin/cc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = +DA2.0W +DS2.0W +z +p +Olibcalls -D_LARGEFILE64_SOURCE -DLARGE_FILES -w
QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = +O2 +Odataprefetch
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = +Z
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE
QMAKE_CXX = /opt/aCC/bin/aCC
QMAKE_CXXFLAGS = -AA $$QMAKE_CFLAGS -D__STRICT_ANSI__ -D_HPUX_SOURCE
QMAKE_CXXFLAGS_DEPS = +M
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 = /usr/include/X11R6
QMAKE_LIBDIR_X11 = /usr/lib/X11R6
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include
QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib /usr/contrib/X11R6/lib
QMAKE_LINK = /opt/aCC/bin/aCC
QMAKE_LINK_SHLIB = /opt/aCC/bin/aCC
QMAKE_LFLAGS = -AA +DA2.0W +DS2.0W -Wl,+s
QMAKE_LFLAGS_RELEASE = +O2
QMAKE_LFLAGS_DEBUG = -g
QMAKE_LFLAGS_SHLIB = -b -Wl,-a,shared_archive
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,+h,
QMAKE_LFLAGS_THREAD =
QMAKE_RPATH = -Wl,+b,
QMAKE_HPUX_SHLIB = 1
QMAKE_EXTENSION_SHLIB = sl
QMAKE_LIBS = -lm -lnsl
QMAKE_LIBS_DYNLOAD = -ldld
QMAKE_LIBS_X11 = -lXext -lX11
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu -lXt
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu -lXt
QMAKE_LIBS_THREAD = -lpthread
QMAKE_LIBS_YACC = -ly
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar cqs
QMAKE_RANLIB =
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for ccmio library:
DEFINES += HPUX64_11_00_PA8000
MK_BUILDNAME = hpux64_11.00-pa8000
MK_LIBS_STLPORT = -lstlport_aCC
MK_LIBS_STLPORT_DEBUG = -lstlport_aCC_stldebug

View File

@ -0,0 +1,95 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dl.h>
#define QT_HPUX_LD
#define QT_NO_LIBRARY_UNLOAD
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// #ifdef __cplusplus
// extern "C" {
// #endif
// getres() is mangled because of missing extern "C" on
// HP-UX 11.x systems missing PHCO_23963
#include <resolv.h>
// #ifdef __cplusplus
// }
// #endif
// Undeclared - at least on HP-UX 10.20.
extern "C" int res_init();
#define QT_NO_LIBRARY_UNLOAD
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
#define QT_SOCKLEN_T int
// presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher
#if !defined(_XOPEN_UNIX)
// HP-UX 9's select() didn't accept fd_set, yet.
#define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e))
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,130 @@
#
# $Id: qmake.conf,v 1.2 2004/08/24 20:11:19 wayne Exp $
#
# qmake configuration for hpuxi-acc-64
#
# We define _POSIX_C_SOURCE to 199506L when using threads, therefore
# we also need to redefine _HPUX_SOURCE.
# From pthread(3t):
# Some documentation will recommend the use of -D_REENTRANT for
# compilation. While this also functions properly, it is considered
# an obsolescent form.
# See pthread(3t) for more details.
#
# From the "HP aC++ Online Programmer's Guide":
# When +DA2.0W is specified:
# * 64-bit SVR4 Executable and Linking Format (ELF) object files
# are generated for PA-RISC 2.0.
# * The preprocessor predefined macro, __LP64__ is defined.
# * The correct path for 64-bit system and language libraries is
# selected.
# When +DD32 is specified:
# * The size of an int, long, or pointer data type is 32-bits.
# The size of an int data type is 32-bits. The size of a long or
# pointer data type is 64-bits.
# * This is the default, currently equivalent to +DA1.1 architecture.
# When +DD64 is specified:
# * The size of an int data type is 32-bits. The size of a long or
# pointer data type is 64-bits.
# * This is currently equivalent to +DA2.OW architecture.
# * The preprocessor predefined macro, __LP64__ is defined.
# Using +DS to Specify Instruction Scheduling:
# * By default, the compiler performs scheduling tuned for the system
# on which you are compiling, or, if specified, tuned for the setting
# of the +DA option.
#
# From the online "C/HP-UX Reference Manual":
# -Aa
# Enables strict ANSI C compliance.
# -Ae
# Enables ANSI C compliance, HP value-added features (as described
# for +e option), and _HPUX_SOURCE name space macro. It is equivalent
# to -Aa +e -D_HPUX_SOURCE.
# +e
# Enables the following HP value added features while compiling in
# ANSI C mode: sized enum, long long, long pointers, compiler supplied
# defaults for missing arguments to intrinsic calls, and $ in identifier
# HP C extensions.
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release plugin_no_soname
QMAKE_CC = /opt/ansic/bin/cc
QMAKE_LEX = lex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = +DD64 +DSitanium -w -D_LARGEFILE64_SOURCE -DLARGE_FILES
QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = +O3 +Osize
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = +Z
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE
QMAKE_CXX = /opt/aCC/bin/aCC
QMAKE_CXXFLAGS = -AA $$QMAKE_CFLAGS -w -D__STRICT_ANSI__ -D_HPUX_SOURCE
QMAKE_CXXFLAGS_DEPS = +M
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 = /usr/include/X11R6
QMAKE_LIBDIR_X11 = /usr/lib/hpux64/X11R6
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include
QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib/hpux64 /usr/contrib/X11R6/lib/hpux64
QMAKE_LINK = /opt/aCC/bin/aCC
QMAKE_LINK_SHLIB = /opt/aCC/bin/aCC
QMAKE_LFLAGS = -AA +DD64 +DSitanium -Wl,+s
QMAKE_LFLAGS_RELEASE = +O3
QMAKE_LFLAGS_DEBUG = -g
QMAKE_LFLAGS_SHLIB = -b -Wl,-a,shared
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,+h,
QMAKE_LFLAGS_THREAD =
QMAKE_RPATH =
QMAKE_LIBS = -lm -lnsl
QMAKE_LIBS_DYNLOAD = -ldl
QMAKE_LIBS_X11 = -lXext -lX11
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu -lXt
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu -lXt
QMAKE_LIBS_THREAD = -lpthread
QMAKE_LIBS_YACC = -ly
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar cqs
QMAKE_RANLIB =
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += HPUX64_11_22_ITANIUM2
MK_BUILDNAME = hpux64_11.22-itanium2
MK_LIBS_STLPORT = -lstlport_aCC
MK_LIBS_STLPORT_DEBUG = -lstlport_aCC_stldebug

View File

@ -0,0 +1,88 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dl.h>
#define QT_HPUX_LD
#define QT_NO_LIBRARY_UNLOAD
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// #ifdef __cplusplus
// extern "C" {
// #endif
// getres() is mangled because of missing extern "C" on
// HP-UX 11.x systems missing PHCO_23963
#include <resolv.h>
// #ifdef __cplusplus
// }
// #endif
// Undeclared - at least on HP-UX 10.20.
extern "C" int res_init();
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
#define QT_SOCKLEN_T int
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,111 @@
#
# $Id: qmake.conf,v 1.2 2004/08/24 20:11:19 wayne Exp $
#
# qmake configuration for hpux-acc
#
# We define _POSIX_C_SOURCE to 199506L when using threads, therefore
# we also need to redefine _HPUX_SOURCE. See pthread(3t) for more details.
#
# From the "HP aC++ Online Programmer's Guide":
# Using +DS to Specify Instruction Scheduling:
# * By default, the compiler performs scheduling tuned for the system
# on which you are compiling, or, if specified, tuned for the setting
# of the +DA option.
#
# From the online "C/HP-UX Reference Manual":
# -Aa
# Enables strict ANSI C compliance.
# -Ae
# Enables ANSI C compliance, HP value-added features (as described
# for +e option), and _HPUX_SOURCE name space macro. It is equivalent
# to -Aa +e -D_HPUX_SOURCE.
# +e
# Enables the following HP value added features while compiling in
# ANSI C mode: sized enum, long long, long pointers, compiler supplied
# defaults for missing arguments to intrinsic calls, and $ in identifier
# HP C extensions.
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = /opt/ansic/bin/cc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = +DA2.0N +DS2.0N +z +p +Olibcalls -D_LARGEFILE64_SOURCE -DLARGE_FILES -w
QMAKE_CFLAGS_WARN_ON =
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = +O3 +Odataprefetch
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = +Z
QMAKE_CFLAGS_YACC =
QMAKE_CFLAGS_THREAD = -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE
QMAKE_CXX = /opt/aCC/bin/aCC
QMAKE_CXXFLAGS = -AA $$QMAKE_CFLAGS -D__STRICT_ANSI__ -D_HPUX_SOURCE
QMAKE_CXXFLAGS_DEPS = +M
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD = $$QMAKE_CFLAGS_THREAD
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 = /usr/include/X11R6
QMAKE_LIBDIR_X11 = /usr/lib/X11R6
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL = /opt/graphics/OpenGL/include /usr/contrib/X11R6/include
QMAKE_LIBDIR_OPENGL = /opt/graphics/OpenGL/lib /usr/contrib/X11R6/lib
QMAKE_LINK = /opt/aCC/bin/aCC
QMAKE_LINK_SHLIB = /opt/aCC/bin/aCC
QMAKE_LFLAGS = -AA +nostl -Wl,+s
QMAKE_LFLAGS_RELEASE = +O3
QMAKE_LFLAGS_DEBUG = -g
QMAKE_LFLAGS_SHLIB = -b -Wl,-a,shared_archive
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,+h,
QMAKE_LFLAGS_THREAD =
QMAKE_RPATH = -Wl,+b,
QMAKE_HPUX_SHLIB = 1
QMAKE_EXTENSION_SHLIB = sl
QMAKE_LIBS = -lm -lnsl
QMAKE_LIBS_DYNLOAD = -ldld
QMAKE_LIBS_X11 = -lXext -lX11
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu -lXt
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu -lXt
QMAKE_LIBS_THREAD = -lpthread
QMAKE_LIBS_YACC = -ly
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar cqs
QMAKE_RANLIB =
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += HPUX_11_00_PA8000
MK_BUILDNAME = hpux_11.00-pa8000
MK_LIBS_STLPORT = -lstlport_aCC
MK_LIBS_STLPORT_DEBUG = -lstlport_aCC_stldebug

View File

@ -0,0 +1,95 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dl.h>
#define QT_HPUX_LD
#define QT_NO_LIBRARY_UNLOAD
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// #ifdef __cplusplus
// extern "C" {
// #endif
// getres() is mangled because of missing extern "C" on
// HP-UX 11.x systems missing PHCO_23963
#include <resolv.h>
// #ifdef __cplusplus
// }
// #endif
// Undeclared - at least on HP-UX 10.20.
extern "C" int res_init();
#define QT_NO_LIBRARY_UNLOAD
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#define QT_SIGNAL_ARGS int
#define QT_SIGNAL_IGNORE SIG_IGN
#define QT_SOCKLEN_T int
// presence of _XOPEN_UNIX can be used to detect HP-UX 10 or higher
#if !defined(_XOPEN_UNIX)
// HP-UX 9's select() didn't accept fd_set, yet.
#define select(a,b,c,d,e) select((a), (int *)(b), (int *)(c), (int *)(d), (e))
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,92 @@
#
# $Id: qmake.conf,v 1.2 2005/09/21 18:55:39 wo Exp $
#
# qmake configuration for irix-g++
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = gcc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -mips4 -mabi=64
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -Wall -W
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = -O2
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_THREAD =
QMAKE_CXX = g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD =
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL =
QMAKE_LIBDIR_OPENGL =
QMAKE_LINK = g++
QMAKE_LINK_SHLIB = g++
QMAKE_LFLAGS = -mips4 -mabi=64
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -shared -Wl,-LD_LAYOUT:lgot_buffer=1000
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,-soname,
QMAKE_LFLAGS_THREAD =
QMAKE_RPATH = -Wl,-rpath,
QMAKE_LIBS = -lC
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_X11 = -lXext -lX11 -lm
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
# libGLU is using the SGI C++ library internally and this somehow clashes
# with the GNU C++ library (similar name mangling and symbol names?)
# so we add -lC so that the SGI C++ library is used first...
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu
QMAKE_LIBS_THREAD = -lpthread
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar cq
QMAKE_RANLIB =
QMAKE_CLEAN = so_locations
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += IRIX64_6_5_MIPS4
MK_BUILDNAME = irix64_6.5-mips4
MK_LIBS_STLPORT = -lstlport_gcc
MK_LIBS_STLPORT_DEBUG = -lstlport_gcc_stldebug

View File

@ -0,0 +1,97 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// On IRIX header files <netinet/in.h> and <arpa/nameser.h> are not
// included by <resolv.h>. Note that <arpa/nameser.h> must be included
// before <resolv.h>.
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI)
#define QT_SIGNAL_ARGS int
#else
#define QT_SIGNAL_ARGS void
#endif
#define QT_SIGNAL_IGNORE SIG_IGN
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500)
#define QT_SOCKLEN_T size_t
#else
#define QT_SOCKLEN_T int
#endif
#if 0
// on Irix 6.5 and better only - but how to check for it?
#if defined(_SGIAPI)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

View File

@ -0,0 +1,92 @@
#
# $Id: qmake.conf,v 1.2 2005/09/21 18:55:39 wo Exp $
#
# qmake configuration for irix-g++
#
MAKEFILE_GENERATOR = UNIX
TEMPLATE = app
CONFIG += qt warn_on release link_prl
QMAKE_CC = gcc
QMAKE_LEX = flex
QMAKE_LEXFLAGS =
QMAKE_YACC = yacc
QMAKE_YACCFLAGS = -d
QMAKE_CFLAGS = -mips3 -mabi=n32
QMAKE_CFLAGS_DEPS = -M
QMAKE_CFLAGS_WARN_ON = -Wall -W
QMAKE_CFLAGS_WARN_OFF = -w
QMAKE_CFLAGS_RELEASE = -O2
QMAKE_CFLAGS_DEBUG = -g
QMAKE_CFLAGS_SHLIB = -fPIC
QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_THREAD =
QMAKE_CXX = g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_DEPS = $$QMAKE_CFLAGS_DEPS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB = $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_THREAD =
QMAKE_INCDIR =
QMAKE_LIBDIR =
QMAKE_INCDIR_X11 =
QMAKE_LIBDIR_X11 =
QMAKE_INCDIR_QT = $(QTDIR)/include
QMAKE_LIBDIR_QT = $(QTDIR)/lib
QMAKE_INCDIR_OPENGL =
QMAKE_LIBDIR_OPENGL =
QMAKE_LINK = g++
QMAKE_LINK_SHLIB = g++
QMAKE_LFLAGS = -mips3 -mabi=n32
QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -shared -Wl,-LD_LAYOUT:lgot_buffer=1000
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
QMAKE_LFLAGS_SONAME = -Wl,-soname,
QMAKE_LFLAGS_THREAD =
QMAKE_RPATH = -Wl,-rpath,
QMAKE_LIBS = -lC
QMAKE_LIBS_DYNLOAD =
QMAKE_LIBS_X11 = -lXext -lX11 -lm
QMAKE_LIBS_X11SM = -lSM -lICE
QMAKE_LIBS_QT = -lqt
QMAKE_LIBS_QT_THREAD = -lqt-mt
# libGLU is using the SGI C++ library internally and this somehow clashes
# with the GNU C++ library (similar name mangling and symbol names?)
# so we add -lC so that the SGI C++ library is used first...
QMAKE_LIBS_OPENGL = -lGLU -lGL -lXmu
QMAKE_LIBS_OPENGL_QT = -lGL -lXmu
QMAKE_LIBS_THREAD = -lpthread
QMAKE_MOC = $(QTDIR)/bin/moc
QMAKE_UIC = $(QTDIR)/bin/uic
QMAKE_AR = ar cq
QMAKE_RANLIB =
QMAKE_CLEAN = so_locations
QMAKE_TAR = tar -cf
QMAKE_GZIP = gzip -9f
QMAKE_COPY = cp -f -p
QMAKE_MOVE = mv -f
QMAKE_DEL_FILE = rm -f
QMAKE_DEL_DIR = rmdir
QMAKE_CHK_DIR_EXISTS = test -d
QMAKE_MKDIR = mkdir -p
# added options for MeshKernel:
DEFINES += IRIX_6_5_MIPS3
MK_BUILDNAME = irix_6.5-mips3
MK_LIBS_STLPORT = -lstlport_gcc
MK_LIBS_STLPORT_DEBUG = -lstlport_gcc_stldebug

View File

@ -0,0 +1,97 @@
#ifndef QPLATFORMDEFS_H
#define QPLATFORMDEFS_H
// Get Qt defines/settings
#include "qglobal.h"
// Set any POSIX/XOPEN defines at the top of this file to turn on specific APIs
#include <unistd.h>
// We are hot - unistd.h should have turned on the specific APIs we requested
#ifdef QT_THREAD_SUPPORT
#include <pthread.h>
#endif
#include <dirent.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <signal.h>
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/ipc.h>
#include <sys/time.h>
#include <sys/shm.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/wait.h>
// DNS header files are not fully covered by X/Open specifications.
// In particular nothing is said about res_* :/
// On IRIX header files <netinet/in.h> and <arpa/nameser.h> are not
// included by <resolv.h>. Note that <arpa/nameser.h> must be included
// before <resolv.h>.
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#if !defined(QT_NO_COMPAT)
#define QT_STATBUF struct stat
#define QT_STATBUF4TSTAT struct stat
#define QT_STAT ::stat
#define QT_FSTAT ::fstat
#define QT_STAT_REG S_IFREG
#define QT_STAT_DIR S_IFDIR
#define QT_STAT_MASK S_IFMT
#define QT_STAT_LNK S_IFLNK
#define QT_FILENO fileno
#define QT_OPEN ::open
#define QT_CLOSE ::close
#define QT_LSEEK ::lseek
#define QT_READ ::read
#define QT_WRITE ::write
#define QT_ACCESS ::access
#define QT_GETCWD ::getcwd
#define QT_CHDIR ::chdir
#define QT_MKDIR ::mkdir
#define QT_RMDIR ::rmdir
#define QT_OPEN_RDONLY O_RDONLY
#define QT_OPEN_WRONLY O_WRONLY
#define QT_OPEN_RDWR O_RDWR
#define QT_OPEN_CREAT O_CREAT
#define QT_OPEN_TRUNC O_TRUNC
#define QT_OPEN_APPEND O_APPEND
#endif
#define QT_SIGNAL_RETTYPE void
#if defined(_LANGUAGE_C_PLUS_PLUS) || !defined(_SGIAPI)
#define QT_SIGNAL_ARGS int
#else
#define QT_SIGNAL_ARGS void
#endif
#define QT_SIGNAL_IGNORE SIG_IGN
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE-0 >= 500)
#define QT_SOCKLEN_T size_t
#else
#define QT_SOCKLEN_T int
#endif
#if 0
// on Irix 6.5 and better only - but how to check for it?
#if defined(_SGIAPI)
#define QT_SNPRINTF ::snprintf
#define QT_VSNPRINTF ::vsnprintf
#endif
#endif
#endif // QPLATFORMDEFS_H

View File

@ -0,0 +1,36 @@
*.pro
*~
Makefile.cartesian
Makefile.cfev
Makefile.cfevtest
Makefile.collapser
Makefile.common
Makefile.compatibility
Makefile.convex_decomp
Makefile.core
Makefile.corealg
Makefile.coreio
Makefile.geometry
Makefile.interf
Makefile.license
Makefile.linalg
Makefile.meshercommon
Makefile.mkprogen
Makefile.mkprospec
Makefile.newsurface
Makefile.newvolume
Makefile.octree
Makefile.pipeline
Makefile.resurfacer
Makefile.robustgeometry
Makefile.surface
Makefile.surfacerepair
Makefile.surfacewrapper
Makefile.test
Makefile.viewcommon
Makefile.voxelmesher
make.*.list*
qmake.vars
test.general.log
test.specific.log
zzzz*

Some files were not shown because too many files have changed in this diff Show More