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
ab383e0c
Commit
ab383e0c
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
pp
parent
14bd21cd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Mesh/meshGRegionBoundaryLayers.cpp
+18
-13
18 additions, 13 deletions
Mesh/meshGRegionBoundaryLayers.cpp
Post/PViewAsSimpleFunction.cpp
+9
-2
9 additions, 2 deletions
Post/PViewAsSimpleFunction.cpp
Post/PViewAsSimpleFunction.h
+11
-3
11 additions, 3 deletions
Post/PViewAsSimpleFunction.h
with
38 additions
and
18 deletions
Mesh/meshGRegionBoundaryLayers.cpp
+
18
−
13
View file @
ab383e0c
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include
"meshGFaceBoundaryLayers.h"
#include
"GModel.h"
#include
"GRegion.h"
...
...
@@ -9,7 +14,7 @@
//
// ^ ni
// |
// |
// |
// +-----------------+
// bi /
...
...
@@ -27,7 +32,7 @@ static double solidAngle (SVector3 &ni, SVector3 &nj,
double
a
=
atan2
(
sina
.
norm
(),
cosa
);
double
sign
=
dot
(
nj
,
bibj
);
return
sign
>
0
?
fabs
(
a
)
:
-
fabs
(
a
);
}
}
BoundaryLayerColumns
*
buildAdditionalPoints3D_CAD_BASED
(
GRegion
*
gr
)
{
}
...
...
@@ -61,7 +66,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
while
(
itf
!=
faces
.
end
()){
if
(
blf
->
isFaceBL
((
*
itf
)
->
tag
())){
printf
(
"FACE %d is a boundary layer face %d triangles
\n
"
,(
*
itf
)
->
tag
(),(
*
itf
)
->
triangles
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
(
*
itf
)
->
triangles
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
(
*
itf
)
->
triangles
.
size
();
i
++
)
for
(
unsigned
int
j
=
0
;
j
<
3
;
j
++
){
if
((
*
itf
)
->
triangles
[
i
]
->
getVertex
(
j
)
->
onWhat
()
->
dim
()
!=
3
){
_columns
->
_non_manifold_faces
.
insert
(
std
::
make_pair
((
*
itf
)
->
triangles
[
i
]
->
getVertex
(
j
),(
*
itf
)
->
triangles
[
i
]));
...
...
@@ -73,7 +78,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
++
itf
;
}
printf
(
"%d vertices
\n
"
,
_vertices
.
size
());
// assume that the initial mesh has been created i.e. that there exist
// tetrahedra inside the domain. Tetrahedra are used to define
// exterior normals
...
...
@@ -87,8 +92,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
MVertex
*
v2
=
f
.
getVertex
(
2
);
MVertex
*
v3
=
0
;
for
(
int
k
=
0
;
k
<
4
;
k
++
){
if
(
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
)
!=
v0
&&
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
)
!=
v1
&&
if
(
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
)
!=
v0
&&
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
)
!=
v1
&&
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
)
!=
v2
){
v3
=
gr
->
tetrahedra
[
i
]
->
getVertex
(
k
);
}
...
...
@@ -102,9 +107,9 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
if
(
sign
>
0
)
it
->
second
=
n
;
else
it
->
second
=
n
*
(
-
1.0
);
}
}
}
}
// for all boundry points
for
(
std
::
set
<
MVertex
*>::
iterator
it
=
_vertices
.
begin
();
it
!=
_vertices
.
end
()
;
++
it
){
std
::
vector
<
MTriangle
*>
_connections
;
...
...
@@ -115,7 +120,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
_connections
.
push_back
(
itm
->
second
);
_allDirs
.
push_back
(
_normals
[
itm
->
second
->
getFace
(
0
)]);
}
// a list of normals is associated to a given vertex
SPoint3
p
((
*
it
)
->
x
(),(
*
it
)
->
y
(),(
*
it
)
->
z
());
std
::
vector
<
std
::
vector
<
int
>
>
groupsOfDirections
;
...
...
@@ -129,7 +134,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
SPoint3
bj
=
_connections
[
iDir
]
->
barycenter
();
SVector3
nj
=
_allDirs
[
iDir
];
double
angle
=
solidAngle
(
ni
,
nj
,
bi
,
bj
);
// those two directions are
// those two directions are
if
(
angle
<
_treshold
){
found
=
true
;
groupsOfDirections
[
j
].
push_back
(
i
);
...
...
@@ -144,8 +149,8 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
groupsOfDirections
.
push_back
(
newDir
);
}
}
std
::
vector
<
SVector3
>
shoot
;
for
(
unsigned
int
j
=
0
;
j
<
groupsOfDirections
.
size
();
j
++
){
SVector3
n
;
...
...
@@ -156,7 +161,7 @@ BoundaryLayerColumns* buildAdditionalPoints3D (GRegion *gr)
n
.
normalize
();
shoot
.
push_back
(
n
);
}
// now create the BL points
for
(
unsigned
int
DIR
=
0
;
DIR
<
shoot
.
size
();
DIR
++
){
SVector3
n
=
shoot
[
DIR
];
...
...
This diff is collapsed.
Click to expand it.
Post/PViewAsSimpleFunction.cpp
+
9
−
2
View file @
ab383e0c
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include
"PView.h"
#include
"PViewData.h"
#include
"PViewAsSimpleFunction.h"
double
PViewEvaluator
::
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
{
double
PViewEvaluator
::
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
{
PViewData
*
pvd
=
_pv
->
getData
();
double
value
;
bool
found
=
pvd
->
searchScalar
(
x
,
y
,
z
,
&
value
,
_step
);
bool
found
=
pvd
->
searchScalar
(
x
,
y
,
z
,
&
value
,
_step
);
if
(
found
)
return
value
;
return
1.e22
;
}
This diff is collapsed.
Click to expand it.
Post/PViewAsSimpleFunction.h
+
11
−
3
View file @
ab383e0c
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _PVIEW_AS_SIMPLEFUNCTION_H
#define _PVIEW_AS_SIMPLEFUNCTION_H
#include
"simpleFunction.h"
class
PView
;
class
PViewEvaluator
:
public
simpleFunction
<
double
>
{
PView
*
_pv
;
int
_step
;
public:
PViewEvaluator
(
PView
*
pv
)
:
_pv
(
pv
),
_step
(
0
)
{}
public:
PViewEvaluator
(
PView
*
pv
)
:
_pv
(
pv
),
_step
(
0
)
{}
double
operator
()
(
const
double
x
,
const
double
y
,
const
double
z
)
const
;
void
setStep
(
int
s
)
{
_step
=
s
;}
void
setStep
(
int
s
)
{
_step
=
s
;
}
};
#endif
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