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
3e3f1e36
Commit
3e3f1e36
authored
Mar 25, 2015
by
Franjo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'enhancement-surfaceMeshUnits-63' into development
parents
8058b73b
c3675b6b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
102 deletions
+45
-102
utilities/backScaleMesh/Make/files
utilities/backScaleMesh/Make/files
+0
-3
utilities/scaleMesh/Make/files
utilities/scaleMesh/Make/files
+3
-0
utilities/scaleMesh/Make/options
utilities/scaleMesh/Make/options
+0
-0
utilities/scaleMesh/scaleMesh.C
utilities/scaleMesh/scaleMesh.C
+18
-23
utilities/scaleSurfaceMesh/scaleSurfaceMesh.C
utilities/scaleSurfaceMesh/scaleSurfaceMesh.C
+24
-76
No files found.
utilities/backScaleMesh/Make/files
deleted
100644 → 0
View file @
8058b73b
backScaleMesh.C
EXE = $(FOAM_USER_APPBIN)/backScaleMesh
utilities/scaleMesh/Make/files
0 → 100644
View file @
3e3f1e36
scaleMesh.C
EXE = $(FOAM_USER_APPBIN)/scaleMesh
utilities/
backS
caleMesh/Make/options
→
utilities/
s
caleMesh/Make/options
View file @
3e3f1e36
File moved
utilities/
backScaleMesh/backS
caleMesh.C
→
utilities/
scaleMesh/s
caleMesh.C
View file @
3e3f1e36
...
...
@@ -22,13 +22,13 @@ License
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
Reads the specified surface and writes it in the fms format
.
Scales the mesh into other units
.
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "polyMeshGen.H"
#include "
coordinateModifier
.H"
#include "
helperFunctions
.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
...
...
@@ -36,37 +36,32 @@ using namespace Foam;
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
validArgs
.
append
(
"scalingFactor"
);
# include "setRootCase.H"
# include "createTime.H"
IOdictionary
meshDict
(
IOobject
(
"meshDict"
,
runTime
.
system
(),
runTime
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
const
scalar
scalingFactor
(
help
::
textToScalar
(
args
.
args
()[
1
]));
Info
<<
"Scaling mesh vertices by a factor "
<<
scalingFactor
<<
endl
;
//- read the mesh from disk
polyMeshGen
pmg
(
runTime
);
Info
<<
"Reading mesh"
<<
endl
;
pmg
.
read
();
//- scale the points
pointFieldPMG
&
pts
=
pmg
.
points
();
if
(
!
meshDict
.
found
(
"anisotropicSources"
)
)
FatalError
<<
"Cannot backward scale mesh. anisotropicSources"
<<
" does not exist in meshDict"
<<
exit
(
FatalError
);
coordinateModifier
cMod
(
meshDict
.
subDict
(
"anisotropicSources"
));
//- apply backward transformation
forAll
(
pts
,
i
)
pts
[
i
]
=
cMod
.
backwardModifiedPoint
(
pts
[
i
]);
# ifdef USE_OMP
# pragma omp parallel for schedule(dynamic, 100)
# endif
forAll
(
pts
,
pointI
)
pts
[
pointI
]
*=
scalingFactor
;
Info
<<
"Writting mesh with backward transformed points"
<<
endl
;
//- write the mesh back on disk
Info
<<
"Writting scaled mesh"
<<
endl
;
pmg
.
write
();
Info
<<
"End
\n
"
<<
endl
;
...
...
utilities/scaleSurfaceMesh/scaleSurfaceMesh.C
View file @
3e3f1e36
...
...
@@ -22,7 +22,7 @@ License
along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
Description
Reads the specified surface and writes it in the fms format
.
Scales surface vertices by a precribed factor
.
\*---------------------------------------------------------------------------*/
...
...
@@ -32,10 +32,6 @@ Description
#include "triSurf.H"
#include "triSurfModifier.H"
#include "helperFunctions.H"
#include "demandDrivenData.H"
#include "coordinateModifier.H"
#include "checkMeshDict.H"
#include "surfaceMeshGeometryModification.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
...
...
@@ -43,79 +39,31 @@ 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
);
argList
::
noParallel
();
argList
::
validArgs
.
clear
();
argList
::
validArgs
.
append
(
"input surface file"
);
argList
::
validArgs
.
append
(
"output surface file"
);
argList
::
validArgs
.
append
(
"scalingFactor"
);
argList
args
(
argc
,
argv
);
const
fileName
inFileName
(
args
.
args
()[
1
]);
const
fileName
outFileName
(
args
.
args
()[
2
]);
const
scalar
scalingFactor
(
help
::
textToScalar
(
args
.
args
()[
3
]));
//- read the surface mesh
triSurf
surface
(
inFileName
);
triSurfModifier
sMod
(
surface
);
pointField
&
pts
=
sMod
.
pointsAccess
();
//- scales the vertices
# ifdef USE_OMP
# pragma omp parallel for schedule(dynamic, 100)
# endif
forAll
(
pts
,
pointI
)
pts
[
pointI
]
*=
scalingFactor
;
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
);
//- write the mesh back on disk
surface
.
writeSurface
(
outFileName
);
Info
<<
"End
\n
"
<<
endl
;
...
...
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