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
904dd4f9
Commit
904dd4f9
authored
17 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
Detect when we have zero lc and fix it (+ send an error message)
parent
b25143ae
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
Mesh/BackgroundMesh.cpp
+23
-18
23 additions, 18 deletions
Mesh/BackgroundMesh.cpp
with
23 additions
and
18 deletions
Mesh/BackgroundMesh.cpp
+
23
−
18
View file @
904dd4f9
// $Id: BackgroundMesh.cpp,v 1.2
6
2007-1
0-10 08:49:34 remacl
e Exp $
// $Id: BackgroundMesh.cpp,v 1.2
7
2007-1
1-08 19:29:50 geuzain
e Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
...
...
@@ -182,34 +182,39 @@ double BGM_MeshSize(GEntity *ge, double U, double V, double X, double Y, double
double
l3
=
CTX
.
lc
;
double
l4
=
lc_field
.
empty
()
?
MAX_LC
:
lc_field
(
X
,
Y
,
Z
);
// use the field unconstrained by other characteristic lengths
if
(
!
lc_field
.
empty
()
&&
!
CTX
.
mesh
.
constrained_bgmesh
)
return
l4
*
CTX
.
mesh
.
lc_factor
;
double
lc
;
if
(
CTX
.
mesh
.
lc_from_curvature
&&
ge
->
dim
()
<
3
)
l1
=
LC_MVertex_CURV
(
ge
,
U
,
V
);
if
(
ge
->
dim
()
<
2
)
l2
=
LC_MVertex_PNTS
(
ge
,
U
,
V
);
if
(
!
lc_field
.
empty
()
&&
!
CTX
.
mesh
.
constrained_bgmesh
){
// use the fields unconstrained by other characteristic lengths
lc
=
l4
*
CTX
.
mesh
.
lc_factor
;
}
else
{
if
(
CTX
.
mesh
.
lc_from_curvature
&&
ge
->
dim
()
<
3
)
l1
=
LC_MVertex_CURV
(
ge
,
U
,
V
);
if
(
ge
->
dim
()
<
2
)
l2
=
LC_MVertex_PNTS
(
ge
,
U
,
V
);
lc
=
std
::
min
(
std
::
min
(
std
::
min
(
l1
,
l2
),
l3
),
l4
)
*
CTX
.
mesh
.
lc_factor
;
}
// printf("l1 = %12.5E l2 = %12.5E l4 = %12.5E\n",l1,l2,l4);
double
lc
=
std
::
min
(
std
::
min
(
std
::
min
(
l1
,
l2
),
l3
),
l4
);
if
(
lc
<=
0.
){
Msg
(
GERROR
,
"Incorrect char. length lc = %g: using default instead"
,
lc
);
return
l3
*
CTX
.
mesh
.
lc_factor
;
}
return
lc
*
CTX
.
mesh
.
lc_factor
;
return
lc
;
}
// we extend the 1d mesh in surfaces if no background mesh exists
// in this case, it is the only way to have something smooth
// we do it also if CTX.mesh.constrained_bgmesh is true;
bool
Extend1dMeshIn2dSurfaces
()
bool
Extend1dMeshIn2dSurfaces
()
{
if
(
lc_field
.
empty
())
return
true
;
if
(
CTX
.
mesh
.
constrained_bgmesh
==
true
)
return
true
;
if
(
lc_field
.
empty
())
return
true
;
if
(
CTX
.
mesh
.
constrained_bgmesh
)
return
true
;
return
false
;
}
bool
Extend2dMeshIn3dVolumes
()
bool
Extend2dMeshIn3dVolumes
()
{
return
Extend1dMeshIn2dSurfaces
();
return
Extend1dMeshIn2dSurfaces
();
}
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