Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
00938688
Commit
00938688
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
arg to refine curved surfaces
parent
bee1546c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/api_demos/mainCartesian.cpp
+12
-10
12 additions, 10 deletions
utils/api_demos/mainCartesian.cpp
with
12 additions
and
10 deletions
utils/api_demos/mainCartesian.cpp
+
12
−
10
View file @
00938688
// lx ly lz rmax levels
// lx ly lz rmax levels
refcs
//
// plaqueEp.stp 0.2 0.2 0.2 0.3 3
// plaqueEpRotated.stp 0.3 0.3 0.3 0.3 3
// jonction_collee2.stp 6 6 6 10 3
// panneau_raidi_simple.stp 3 3 50 10
1
// panneau_raidi_simple.stp 3 3 50 10
2 0
// plaque_trouee.stp 1 1 1 2 3
#include
"Gmsh.h"
#include
"GModel.h"
#include
"MVertex.h"
#include
"cartesian.h"
#include
"MTriangle.h"
#include
"SOrientedBoundingBox.h"
#include
"Numeric.h"
#include
"GmshMessage.h"
#include
"cartesian.h"
void
insertActiveCells
(
double
x
,
double
y
,
double
z
,
double
rmax
,
cartesianBox
<
double
>
&
box
)
...
...
@@ -174,7 +171,7 @@ void removeOutsideCells(cartesianBox<double> *box)
int
main
(
int
argc
,
char
*
argv
[])
{
if
(
argc
<
6
){
printf
(
"Usage: %s file lx ly lz rmax [levels=1]
\n
"
,
argv
[
0
]);
printf
(
"Usage: %s file lx ly lz rmax [levels=1]
[refcs=1]
\n
"
,
argv
[
0
]);
printf
(
"where
\n
"
);
printf
(
" 'file' contains a CAD model
\n
"
);
printf
(
" 'lx', 'ly' and 'lz' are the sizes of the elements along the"
...
...
@@ -182,6 +179,7 @@ int main(int argc,char *argv[])
printf
(
" 'rmax' is the radius of the largest sphere that can be inscribed"
" in the structure
\n
"
);
printf
(
" 'levels' sets the number of levels in the grid
\n
"
);
printf
(
" 'refcs' selects if curved surfaces should be refined
\n
"
);
return
-
1
;
}
...
...
@@ -191,6 +189,7 @@ int main(int argc,char *argv[])
double
lx
=
atof
(
argv
[
2
]),
ly
=
atof
(
argv
[
3
]),
lz
=
atof
(
argv
[
4
]);
double
rmax
=
atof
(
argv
[
5
]);
int
levels
=
(
argc
>
6
)
?
atof
(
argv
[
6
])
:
1
;
int
refineCurvedSurfaces
=
(
argc
>
7
)
?
atof
(
argv
[
7
])
:
1
;
// minimum distance between points in the cloud at the coarsest
// level
...
...
@@ -214,10 +213,13 @@ int main(int argc,char *argv[])
Msg
::
Info
(
"Filling refined point cloud on curves and curved surfaces"
);
for
(
GModel
::
eiter
eit
=
gm
->
firstEdge
();
eit
!=
gm
->
lastEdge
();
eit
++
)
fillPointCloud
(
*
eit
,
s
,
refinePoints
);
// FIXME: refine this by computing e.g. "mean" curvature
for
(
GModel
::
fiter
fit
=
gm
->
firstFace
();
fit
!=
gm
->
lastFace
();
fit
++
)
if
((
*
fit
)
->
geomType
()
!=
GEntity
::
Plane
)
(
*
fit
)
->
fillPointCloud
(
2
*
s
,
&
refinePoints
);
if
(
refineCurvedSurfaces
){
for
(
GModel
::
fiter
fit
=
gm
->
firstFace
();
fit
!=
gm
->
lastFace
();
fit
++
)
if
((
*
fit
)
->
geomType
()
!=
GEntity
::
Plane
)
(
*
fit
)
->
fillPointCloud
(
2
*
s
,
&
refinePoints
);
}
Msg
::
Info
(
" %d points in the refined cloud"
,
(
int
)
refinePoints
.
size
());
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment