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
7cf23f73
Commit
7cf23f73
authored
18 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
better logic (fix bug where we could not get grids coarser than CTX.lc/10)
parent
862c691f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Mesh/BackgroundMesh.cpp
+17
-16
17 additions, 16 deletions
Mesh/BackgroundMesh.cpp
with
17 additions
and
16 deletions
Mesh/BackgroundMesh.cpp
+
17
−
16
View file @
7cf23f73
// $Id: BackgroundMesh.cpp,v 1.1
6
2007-0
2-02 17:16:46 remacl
e Exp $
// $Id: BackgroundMesh.cpp,v 1.1
7
2007-0
3-21 23:27:17 geuzain
e Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -165,12 +165,13 @@ double LC_MVertex_BGM(GEntity *ge, double X, double Y, double Z)
// mesh vertices
double
LC_MVertex_PNTS
(
GEntity
*
ge
,
double
U
,
double
V
)
{
double
a
;
switch
(
ge
->
dim
()){
case
0
:
{
GVertex
*
gv
=
(
GVertex
*
)
ge
;
return
gv
->
prescribedMeshSizeAtVertex
();
double
lc
=
gv
->
prescribedMeshSizeAtVertex
();
if
(
lc
>=
MAX_LC
)
return
CTX
.
lc
/
10.
;
return
lc
;
}
case
1
:
{
...
...
@@ -178,9 +179,11 @@ double LC_MVertex_PNTS(GEntity *ge, double U, double V)
GVertex
*
v1
=
ged
->
getBeginVertex
();
GVertex
*
v2
=
ged
->
getEndVertex
();
Range
<
double
>
range
=
ged
->
parBounds
(
0
);
a
=
(
U
-
range
.
low
())
/
(
range
.
high
()
-
range
.
low
());
return
(
1
-
a
)
*
v1
->
prescribedMeshSizeAtVertex
()
+
double
a
=
(
U
-
range
.
low
())
/
(
range
.
high
()
-
range
.
low
());
double
lc
=
(
1
-
a
)
*
v1
->
prescribedMeshSizeAtVertex
()
+
(
a
)
*
v2
->
prescribedMeshSizeAtVertex
()
;
if
(
lc
>=
MAX_LC
)
return
CTX
.
lc
/
10.
;
return
lc
;
}
default
:
return
MAX_LC
;
...
...
@@ -190,23 +193,21 @@ double LC_MVertex_PNTS(GEntity *ge, double U, double V)
// This is the only function that is used by the meshers
double
BGM_MeshSize
(
GEntity
*
ge
,
double
U
,
double
V
,
double
X
,
double
Y
,
double
Z
)
{
double
l1
=
MAX_LC
;
double
l2
=
MAX_LC
;
double
l3
=
CTX
.
lc
/
10.
;
double
l3
=
CTX
.
lc
;
double
l4
=
LC_MVertex_BGM
(
ge
,
X
,
Y
,
Z
);
double
l5
=
Attractor
::
lc
(
X
,
Y
,
Z
);
double
l5
=
Attractor
::
lc
(
X
,
Y
,
Z
);
if
(
l4
<
MAX_LC
&&
!
CTX
.
mesh
.
constrained_bgmesh
)
return
l4
*
CTX
.
mesh
.
lc_factor
;
if
(
ge
->
dim
()
<
2
)
l2
=
LC_MVertex_PNTS
(
ge
,
U
,
V
);
double
l
=
std
::
min
(
std
::
min
(
std
::
min
(
l2
,
l4
),
l3
),
l5
);
l
*=
CTX
.
mesh
.
lc_factor
;
if
(
ge
->
dim
()
<
2
)
l2
=
LC_MVertex_PNTS
(
ge
,
U
,
V
);
double
l1
=
MAX_LC
;
if
(
CTX
.
mesh
.
lc_from_curvature
&&
ge
->
dim
()
<
3
)
l1
=
std
::
max
(
l3
/
100
,
LC_MVertex_CURV
(
ge
,
U
,
V
));
return
std
::
min
(
l
,
l1
)
;
l1
=
std
::
max
(
l3
/
100.
,
LC_MVertex_CURV
(
ge
,
U
,
V
));
double
lc
=
std
::
min
(
std
::
min
(
std
::
min
(
std
::
min
(
l1
,
l2
),
l3
),
l4
),
l5
);
return
lc
*
CTX
.
mesh
.
lc_factor
;
}
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