Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
integration-cfmesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Community
integration-cfmesh
Commits
20bd0f12
Commit
20bd0f12
authored
Mar 14, 2015
by
Franjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial implementation
parent
d35f1b4e
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
870 additions
and
116 deletions
+870
-116
meshLibrary/Make/files
meshLibrary/Make/files
+3
-0
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
...ities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
+648
-78
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
...ities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
+80
-38
utilities/checkSurfaceMesh/Make/files
utilities/checkSurfaceMesh/Make/files
+3
-0
utilities/checkSurfaceMesh/Make/options
utilities/checkSurfaceMesh/Make/options
+10
-0
utilities/checkSurfaceMesh/checkSurfaceMesh.C
utilities/checkSurfaceMesh/checkSurfaceMesh.C
+126
-0
No files found.
meshLibrary/Make/files
View file @
20bd0f12
...
...
@@ -86,6 +86,7 @@ checkNonMappableCellConnections = $(topology)/checkNonMappableCellConnections
triSurfaceTools = utilities/triSurfaceTools
triSurface2DCheck = $(triSurfaceTools)/triSurface2DCheck
triSurfaceChecks = $(triSurfaceTools)/triSurfaceChecks
triSurfaceCleanupDuplicates = $(triSurfaceTools)/triSurfaceCleanupDuplicates
triSurfaceCleanupDuplicateTriangles = $(triSurfaceTools)/triSurfaceCleanupDuplicateTriangles
triSurfaceCopyParts = $(triSurfaceTools)/triSurfaceCopyParts
...
...
@@ -407,6 +408,8 @@ $(objectRefinement)/hollowConeRefinement.C
$(triSurface2DCheck)/triSurface2DCheck.C
$(triSurfaceChecks)/triSurfaceChecks.C
$(triSurfaceCleanupDuplicates)/triSurfaceCleanupDuplicates.C
$(triSurfaceCleanupDuplicates)/triSurfaceCleanupDuplicatesFunctions.C
...
...
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.C
View file @
20bd0f12
This diff is collapsed.
Click to expand it.
meshLibrary/utilities/triSurfaceTools/triSurfaceChecks/triSurfaceChecks.H
View file @
20bd0f12
...
...
@@ -35,57 +35,99 @@ SourceFiles
#ifndef triSurface2DCheck_H
#define triSurface2DCheck_H
#include "triSurf.H"
#include "symmTensor.H"
#include "labelLongList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
class
triSurf
;
class
boundBox
;
/*---------------------------------------------------------------------------*\
Class triSurface2DCheck
Declaration
Namespace triSurfaceChecka
Declaration
\*---------------------------------------------------------------------------*/
class
triSurface2DCheck
namespace
triSurfaceChecks
{
// Private data
//- reference to triSurf
const
triSurf
&
surf_
;
//- covariance matrix
symmTensor
covarianceMatrix_
;
// Private member functions
//- create covariance matrix
void
createCovarianceMatrix
();
//- Disallow default bitwise copy construct
triSurface2DCheck
(
const
triSurface2DCheck
&
);
//- Disallow default bitwise assignment
void
operator
=
(
const
triSurface2DCheck
&
);
public:
// Constructors
//- check the angles of triangles. Triangles wth the smallest angle below
//- the given threshold are marked as bad-quality triangles
label
checkAngles
(
const
triSurf
&
,
labelLongList
&
,
const
scalar
angleTol
=
5.0
);
label
checkAngles
(
triSurf
&
,
const
word
subsetName
=
"smallAngles"
,
const
scalar
angleTol
=
5.0
);
//- check for existence of boudary and non-manifold edges
label
checkSurfaceManifolds
(
const
triSurf
&
,
labelLongList
&
triangleInManifold
);
label
checkSurfaceManifolds
(
triSurf
&
,
const
word
subsetPrefix
=
"manifold_"
);
//- check for existence of holes in the surface mesh
label
checkForHoles
(
const
triSurf
&
,
labelLongList
&
);
label
checkForHoles
(
triSurf
&
,
const
word
subsetPrefix
=
"hole_"
);
//- check for existence of non-manifold edges
label
checkForNonManifoldEdges
(
const
triSurf
&
,
labelLongList
&
);
label
checkForNonManifoldEdges
(
triSurf
&
,
const
word
subsetPrefix
=
"nonManifold_"
);
//- check orientation of triangles
label
checkOrientation
(
const
triSurf
&
,
labelLongList
&
triangleInGroup
);
label
checkOrientation
(
triSurf
&
,
const
word
subsetPrefix
=
"orientation_"
);
//- check for disconnected surface parts
label
checkDisconnectedParts
(
const
triSurf
&
,
labelLongList
&
triangleInRegion
);
label
checkDisconnectedParts
(
triSurf
&
,
const
word
subsetPrefix
=
"region_"
);
//- calculate bounding box of the surface mesh
void
calculateBoundingBox
(
const
triSurf
&
,
boundBox
&
);
//- check if there exist any self-intersections
label
checkSelfIntersections
(
const
triSurf
&
,
labelLongList
&
,
const
scalar
tol
=
1e-6
);
label
checkSelfIntersections
(
triSurf
&
,
const
word
subsetName
=
"selfIntersect"
,
const
scalar
tol
=
1e-6
);
//- check if there exist any overlaps
label
checkOverlaps
(
const
triSurf
&
,
labelLongList
&
,
const
scalar
tol
=
1e-6
,
const
scalar
angleTol
=
5.0
);
label
checkOverlaps
(
triSurf
&
,
const
word
subsetName
=
"overlappingTriangles"
,
const
scalar
tol
=
1e-6
,
const
scalar
angleTol
=
5.0
);
//- Construct from octree
triSurface2DCheck
(
const
triSurf
&
surface
);
// Destructor
~
triSurface2DCheck
();
// Member Functions
//- checks if the surface is a 2D triangulation
bool
is2DSurface
()
const
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- create subset containing invalid facets
void
createSubsets
();
};
}
// End namespace triSurfaceChecks
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
utilities/checkSurfaceMesh/Make/files
0 → 100644
View file @
20bd0f12
checkSurfaceMesh.C
EXE = $(FOAM_USER_APPBIN)/checkSurfaceMesh
utilities/checkSurfaceMesh/Make/options
0 → 100644
View file @
20bd0f12
EXE_INC = \
-I../../meshLibrary/lnInclude \
-I$(LIB_SRC)/triSurface/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-ltriSurface \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary \
-lmeshTools
utilities/checkSurfaceMesh/checkSurfaceMesh.C
0 → 100644
View file @
20bd0f12
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | cfMesh: A library for mesh generation
\\ / O peration |
\\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
\\/ M anipulation | Copyright (C) Creative Fields, Ltd.
-------------------------------------------------------------------------------
License
This file is part of cfMesh.
cfMesh is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
Reads the specified surface and writes it in the fms format.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "IFstream.H"
#include "fileName.H"
#include "triSurf.H"
#include "triSurfModifier.H"
#include "helperFunctions.H"
#include "demandDrivenData.H"
#include "coordinateModifier.H"
#include "checkMeshDict.H"
#include "surfaceMeshGeometryModification.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
using
namespace
Foam
;
int
main
(
int
argc
,
char
*
argv
[])
{
# include "setRootCase.H"
# include "createTime.H"
IOdictionary
meshDict
(
IOobject
(
"meshDict"
,
runTime
.
system
(),
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
checkMeshDict
cmd
(
meshDict
);
fileName
surfaceFile
=
meshDict
.
lookup
(
"surfaceFile"
);
if
(
Pstream
::
parRun
()
)
surfaceFile
=
".."
/
surfaceFile
;
triSurf
surface
(
runTime
.
path
()
/
surfaceFile
);
surfaceMeshGeometryModification
gMod
(
surface
,
meshDict
);
//- modify points
const
triSurf
*
modSurfPtr
=
gMod
.
modifyGeometry
();
Info
<<
"Writting modified surface"
<<
endl
;
modSurfPtr
->
writeSurface
(
"modifiedSurf.stl"
);
# ifdef DEBUGScaling
//- apply backward modification
Info
<<
"Here"
<<
endl
;
coordinateModifier
cMod
(
meshDict
.
subDict
(
"anisotropicSources"
));
Info
<<
"Starting modifications"
<<
endl
;
forAll
(
surface
.
points
(),
i
)
{
Info
<<
"
\n
Orig point "
<<
i
<<
" coordinates "
<<
surface
.
points
()[
i
]
<<
" modified point "
<<
modSurfPtr
->
points
()[
i
]
<<
endl
;
const
point
p
=
cMod
.
backwardModifiedPoint
(
modSurfPtr
->
points
()[
i
]);
if
(
mag
(
p
-
surface
.
points
()[
i
])
>
1e-14
)
{
Warning
<<
"Point "
<<
i
<<
" is different "
<<
p
<<
" from original "
<<
surface
.
points
()[
i
]
<<
" modified point "
<<
cMod
.
modifiedPoint
(
surface
.
points
()[
i
])
<<
endl
;
::
exit
(
0
);
}
}
Info
<<
"Backscaling Ok"
<<
endl
;
::
exit
(
0
);
# endif
surfaceMeshGeometryModification
bgMod
(
*
modSurfPtr
,
meshDict
);
const
triSurf
*
backModSurfPtr
=
bgMod
.
revertGeometryModification
();
Info
<<
"Writting backward transformed surface"
<<
endl
;
backModSurfPtr
->
writeSurface
(
"backwardModifiedSurf.stl"
);
# ifdef DEBUGScaling
forAll
(
backModSurfPtr
->
points
(),
pI
)
if
(
mag
(
backModSurfPtr
->
points
()[
pI
]
-
surface
.
points
()[
pI
])
>
1e-14
)
Warning
<<
"Point "
<<
pI
<<
" is different "
<<
backModSurfPtr
->
points
()[
pI
]
<<
" from original "
<<
surface
.
points
()[
pI
]
<<
endl
;
# endif
deleteDemandDrivenData
(
modSurfPtr
);
deleteDemandDrivenData
(
backModSurfPtr
);
Info
<<
"End
\n
"
<<
endl
;
return
0
;
}
// ************************************************************************* //
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment