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
7f458220
Commit
7f458220
authored
Jul 24, 2014
by
Franjo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a utility and calculaion of planes
parent
b07d2388
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
315 additions
and
0 deletions
+315
-0
meshLibrary/Make/files
meshLibrary/Make/files
+3
-0
meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.C
...zer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.C
+147
-0
meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.H
...zer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.H
+99
-0
utilities/improveSymmetryPlanes/Make/files
utilities/improveSymmetryPlanes/Make/files
+3
-0
utilities/improveSymmetryPlanes/Make/options
utilities/improveSymmetryPlanes/Make/options
+8
-0
utilities/improveSymmetryPlanes/improveSymmetryPlanes.C
utilities/improveSymmetryPlanes/improveSymmetryPlanes.C
+55
-0
No files found.
meshLibrary/Make/files
View file @
7f458220
...
...
@@ -39,6 +39,7 @@ removeCellsInSelectedDomains = $(nonManifoldMeshing)/removeCellsInSelectedDomain
meshOptimizer = utilities/smoothers/geometry/meshOptimizer
tetMeshOptimisation = $(meshOptimizer)/tetMeshOptimisation
symmetryPlaneOptimisation = $(meshOptimizer)/symmetryPlaneOptimisation
simplexSmoother = $(tetMeshOptimisation)/advancedSmoothers/simplexSmoother
knuppMetric = $(tetMeshOptimisation)/advancedSmoothers/knuppMetric
meshUntangler = $(tetMeshOptimisation)/advancedSmoothers/meshUntangler
...
...
@@ -356,6 +357,8 @@ $(meshOptimizer)/optimizeMeshFV.C
$(tetMeshOptimisation)/tetMeshOptimisation.C
$(tetMeshOptimisation)/tetMeshOptimisationParallel.C
$(symmetryPlaneOptimisation)/symmetryPlaneOptimisation.C
$(simplexSmoother)/simplexSmoother.C
$(knuppMetric)/knuppMetric.C
...
...
meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.C
0 → 100644
View file @
7f458220
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#include "demandDrivenData.H"
#include "symmetryPlaneOptimisation.H"
#include "partTetMesh.H"
#include "meshSurfaceEngine.H"
#include "meshSurfaceEngineModifier.H"
#include "partTetMeshSimplex.H"
#include "meshUntangler.H"
#include "volumeOptimizer.H"
#include "knuppMetric.H"
#include <map>
# ifdef USE_OMP
#include <omp.h>
# endif
// #define DEBUGSearch
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void
symmetryPlaneOptimisation
::
detectSymmetryPlanes
()
{
const
PtrList
<
boundaryPatch
>&
boundaries
=
mesh_
.
boundaries
();
const
pointFieldPMG
&
points
=
mesh_
.
points
();
const
faceListPMG
&
faces
=
mesh_
.
faces
();
symmetryPlanes_
.
clear
();
typedef
std
::
map
<
label
,
std
::
pair
<
vector
,
label
>
>
mapType
;
mapType
centreSum
,
normalSum
;
forAll
(
boundaries
,
patchI
)
{
if
(
boundaries
[
patchI
].
type
()
==
"symmetryPlane"
)
{
std
::
pair
<
vector
,
label
>&
cs
=
centreSum
[
patchI
];
cs
=
std
::
pair
<
vector
,
label
>
(
vector
::
zero
,
0
);
std
::
pair
<
vector
,
label
>&
ns
=
normalSum
[
patchI
];
ns
=
std
::
pair
<
vector
,
label
>
(
vector
::
zero
,
0
);
const
label
start
=
boundaries
[
patchI
].
patchStart
();
const
label
end
=
start
+
boundaries
[
patchI
].
patchSize
();
for
(
label
faceI
=
start
;
faceI
<
end
;
++
faceI
)
{
cs
.
first
+=
faces
[
faceI
].
centre
(
points
);
ns
.
first
+=
faces
[
faceI
].
normal
(
points
);
}
cs
.
second
=
ns
.
second
=
boundaries
[
patchI
].
patchSize
();
}
}
if
(
Pstream
::
parRun
()
)
{
//- sum up all normals and centres of all processors
//- every symmetry plane patch must be present on all processors
forAllIter
(
mapType
,
centreSum
,
pIter
)
{
std
::
pair
<
vector
,
label
>&
cs
=
pIter
->
second
;
reduce
(
cs
.
second
,
sumOp
<
label
>
());
reduce
(
cs
.
first
,
sumOp
<
vector
>
());
std
::
pair
<
vector
,
label
>&
ns
=
normalSum
[
pIter
->
first
];
reduce
(
ns
.
first
,
sumOp
<
vector
>
());
ns
.
second
=
cs
.
second
;
}
}
//- create planes corresponding to each symmetry plane
forAllConstIter
(
mapType
,
centreSum
,
it
)
{
const
point
c
=
it
->
second
.
first
/
it
->
second
.
second
;
const
std
::
pair
<
vector
,
label
>&
ns
=
normalSum
[
it
->
first
];
const
point
n
=
ns
.
first
/
ns
.
second
;
const
word
pName
=
boundaries
[
it
->
first
].
patchName
();
symmetryPlanes_
.
insert
(
std
::
make_pair
(
pName
,
plane
(
c
,
n
)));
}
}
void
symmetryPlaneOptimisation
::
pointInPlanes
(
VRWGraph
&
)
const
{
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from mesh
symmetryPlaneOptimisation
::
symmetryPlaneOptimisation
(
polyMeshGen
&
mesh
)
:
mesh_
(
mesh
)
{
detectSymmetryPlanes
();
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
symmetryPlaneOptimisation
::~
symmetryPlaneOptimisation
()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void
symmetryPlaneOptimisation
::
optimizeSymmetryPlanes
()
{
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// ************************************************************************* //
meshLibrary/utilities/smoothers/geometry/meshOptimizer/symmetryPlaneOptimisation/symmetryPlaneOptimisation.H
0 → 100644
View file @
7f458220
/*---------------------------------------------------------------------------*\
========= |
\\ / 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/>.
Class
symmetryPlaneOptimisation
Description
Smoothing of symmetry planes in the mesh such that all points
are in the plane.
SourceFiles
symmetryPlaneOptimisation.C
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneOptimisation_H
#define symmetryPlaneOptimisation_H
#include "DynList.H"
#include "polyMeshGenModifier.H"
#include "boundBox.H"
#include "labelLongList.H"
#include "boolList.H"
#include "plane.H"
#include <map>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
/*---------------------------------------------------------------------------*\
Class symmetryPlaneOptimisation Declaration
\*---------------------------------------------------------------------------*/
class
symmetryPlaneOptimisation
{
// Private data
//- reference to the mesh
polyMeshGen
&
mesh_
;
//- symmetry planes in the mesh
std
::
map
<
word
,
plane
>
symmetryPlanes_
;
// Private member functions
//- detect symmetry planes
void
detectSymmetryPlanes
();
//- point-planes addressing
void
pointInPlanes
(
VRWGraph
&
)
const
;
public:
// Constructors
//- Construct from mesh
symmetryPlaneOptimisation
(
polyMeshGen
&
mesh
);
// Destructor
~
symmetryPlaneOptimisation
();
// Member Functions
//- move vertices to the symmetry planes
void
optimizeSymmetryPlanes
();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
utilities/improveSymmetryPlanes/Make/files
0 → 100644
View file @
7f458220
improveSymmetryPlanes.C
EXE = $(FOAM_USER_APPBIN)/improveSymmetryPlanes
utilities/improveSymmetryPlanes/Make/options
0 → 100644
View file @
7f458220
EXE_INC = \
-I../../meshLibrary/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lmeshLibrary \
-lmeshTools
utilities/improveSymmetryPlanes/improveSymmetryPlanes.C
0 → 100644
View file @
7f458220
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Ensures that all mesh points belonging to a symmetryPlane are
in a plane.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "Time.H"
#include "polyMeshGenModifier.H"
#include "symmetryPlaneOptimisation.H"
using
namespace
Foam
;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int
main
(
int
argc
,
char
*
argv
[])
{
# include "setRootCase.H"
# include "createTime.H"
polyMeshGen
pmg
(
runTime
);
pmg
.
read
();
symmetryPlaneOptimisation
(
pmg
).
optimizeSymmetryPlanes
();
pmg
.
write
();
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