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
c73a077d
Commit
c73a077d
authored
15 years ago
by
Jean-François Remacle
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
28e46135
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/GEdgeCompound.cpp
+23
-0
23 additions, 0 deletions
Geo/GEdgeCompound.cpp
Geo/GEdgeCompound.h
+3
-1
3 additions, 1 deletion
Geo/GEdgeCompound.h
Mesh/meshGFaceBDS.cpp
+81
-7
81 additions, 7 deletions
Mesh/meshGFaceBDS.cpp
Numeric/gmshLinearSystemCSR.cpp
+1
-1
1 addition, 1 deletion
Numeric/gmshLinearSystemCSR.cpp
with
108 additions
and
9 deletions
Geo/GEdgeCompound.cpp
+
23
−
0
View file @
c73a077d
...
...
@@ -195,6 +195,29 @@ void GEdgeCompound::getLocalParameter ( const double &t,
}
}
// give a GEdge and
void
GEdgeCompound
::
getCompoundParameter
(
GEdge
*
ge
,
const
double
&
tLoc
,
double
&
t
)
const
{
for
(
int
iEdge
=
0
;
iEdge
<
(
int
)
_compound
.
size
();
iEdge
++
){
//printf("iEdge=%d tmin=%g\n",iEdge,_pars[iEdge]);
if
(
ge
==
_compound
[
iEdge
]){
double
tmin
=
_pars
[
iEdge
];
double
tmax
=
_pars
[
iEdge
+
1
];
Range
<
double
>
b
=
_compound
[
iEdge
]
->
parBounds
(
0
);
t
=
_orientation
[
iEdge
]
?
tmin
+
(
tLoc
-
b
.
low
())
/
(
b
.
high
()
-
b
.
low
())
*
(
tmax
-
tmin
)
:
tmax
-
(
tLoc
-
b
.
low
())
/
(
b
.
high
()
-
b
.
low
())
*
(
tmax
-
tmin
);
//printf("bhigh=%g, blow=%g, global t=%g , tLoc=%g ,iEdge=%d\n",b.high(), b.low(), t,tLoc,iEdge);
return
;
}
}
}
void
GEdgeCompound
::
parametrize
()
{
_pars
.
push_back
(
0.0
);
...
...
This diff is collapsed.
Click to expand it.
Geo/GEdgeCompound.h
+
3
−
1
View file @
c73a077d
...
...
@@ -24,7 +24,9 @@ public:
void
getLocalParameter
(
const
double
&
t
,
int
&
iEdge
,
double
&
tLoc
)
const
;
void
getCompoundParameter
(
GEdge
*
ge
,
const
double
&
tLoc
,
double
&
t
)
const
;
GEdgeCompound
(
GModel
*
m
,
int
tag
,
std
::
vector
<
GEdge
*>
&
compound
);
virtual
~
GEdgeCompound
();
Range
<
double
>
parBounds
(
int
i
)
const
;
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGFaceBDS.cpp
+
81
−
7
View file @
c73a077d
...
...
@@ -33,10 +33,10 @@ double computeEdgeLinearLength(BDS_Point *p1, BDS_Point *p2)
}
inline
double
computeEdgeLinearLength
(
BDS_Point
*
p1
,
BDS_Point
*
p2
,
GFace
*
f
,
double
SCALINGU
,
double
SCALINGV
)
BDS_Point
*
p2
,
GFace
*
f
,
double
SCALINGU
,
double
SCALINGV
)
{
GPoint
GP
=
f
->
point
(
SPoint2
(
0.5
*
(
p1
->
u
+
p2
->
u
)
*
SCALINGU
,
...
...
@@ -56,6 +56,78 @@ inline double computeEdgeLinearLength(BDS_Point *p1,
return
l1
+
l2
;
}
inline
double
computeEdgeLinearLength_new
(
BDS_Point
*
p1
,
BDS_Point
*
p2
,
GFace
*
f
,
double
SCALINGU
,
double
SCALINGV
)
{
const
int
nbSb
=
10
;
GPoint
GP
[
nbSb
-
1
];
for
(
int
i
=
1
;
i
<
nbSb
;
i
++
){
double
xi
=
(
double
)
i
/
nbSb
;
GP
[
i
-
1
]
=
f
->
point
(
SPoint2
(((
1
-
xi
)
*
p1
->
u
+
xi
*
p2
->
u
)
*
SCALINGU
,
((
1
-
xi
)
*
p1
->
v
+
xi
*
p2
->
v
)
*
SCALINGV
));
if
(
!
GP
[
i
-
1
].
succeeded
())
return
computeEdgeLinearLength
(
p1
,
p2
);
}
double
l
=
0
;
for
(
int
i
=
0
;
i
<
nbSb
;
i
++
){
if
(
i
==
0
){
const
double
dx1
=
p1
->
X
-
GP
[
0
].
x
();
const
double
dy1
=
p1
->
Y
-
GP
[
0
].
y
();
const
double
dz1
=
p1
->
Z
-
GP
[
0
].
z
();
l
+=
sqrt
(
dx1
*
dx1
+
dy1
*
dy1
+
dz1
*
dz1
);
}
else
if
(
i
==
nbSb
-
1
){
const
double
dx1
=
p2
->
X
-
GP
[
nbSb
-
1
].
x
();
const
double
dy1
=
p2
->
Y
-
GP
[
nbSb
-
1
].
y
();
const
double
dz1
=
p2
->
Z
-
GP
[
nbSb
-
1
].
z
();
l
+=
sqrt
(
dx1
*
dx1
+
dy1
*
dy1
+
dz1
*
dz1
);
}
else
{
const
double
dx1
=
GP
[
i
].
x
()
-
GP
[
i
-
1
].
x
();
const
double
dy1
=
GP
[
i
].
y
()
-
GP
[
i
-
1
].
y
();
const
double
dz1
=
GP
[
i
].
z
()
-
GP
[
i
-
1
].
z
();
l
+=
sqrt
(
dx1
*
dx1
+
dy1
*
dy1
+
dz1
*
dz1
);
}
}
return
l
;
}
inline
double
computeEdgeMiddleCoord_new
(
BDS_Point
*
p1
,
BDS_Point
*
p2
,
GFace
*
f
,
double
SCALINGU
,
double
SCALINGV
)
{
const
int
nbSb
=
3
;
double
L
=
computeEdgeLinearLength
(
p1
,
p2
);
GPoint
GP
[
nbSb
];
for
(
int
i
=
1
;
i
<
nbSb
;
i
++
){
double
xi
=
(
double
)
i
/
nbSb
;
GP
[
i
-
1
]
=
f
->
point
(
SPoint2
(((
1
-
xi
)
*
p1
->
u
+
xi
*
p2
->
u
)
*
SCALINGU
,
((
1
-
xi
)
*
p1
->
v
+
xi
*
p2
->
v
)
*
SCALINGV
));
if
(
!
GP
[
i
-
1
].
succeeded
())
return
0.5
;
const
double
dx1
=
p1
->
X
-
GP
[
i
-
1
].
x
();
const
double
dy1
=
p1
->
Y
-
GP
[
i
-
1
].
y
();
const
double
dz1
=
p1
->
Z
-
GP
[
i
-
1
].
z
();
double
LPLUS
=
sqrt
(
dx1
*
dx1
+
dy1
*
dy1
+
dz1
*
dz1
);
if
(
LPLUS
>
L
*
.5
){
double
XIMINUS
,
XIPLUS
,
LPLUS
,
LMINUS
;
if
(
i
==
1
){
XIMINUS
=
0
;
}
return
XIMINUS
+
(
LPLUS
-
L
*
.5
)
/
(
LPLUS
-
LMINUS
)
/
(
nbSb
-
1
);
}
}
return
0.5
;
}
inline
double
computeEdgeMiddleCoord
(
BDS_Point
*
p1
,
BDS_Point
*
p2
,
GFace
*
f
,
...
...
@@ -431,9 +503,9 @@ void splitEdgePassUnsorted(GFace *gf, BDS_Mesh &m, double MAXE_, int &nb_split)
if
(
!
(
*
it
)
->
deleted
){
double
lone
=
NewGetLc
(
*
it
,
gf
,
m
.
scalingU
,
m
.
scalingV
);
if
((
*
it
)
->
numfaces
()
==
2
&&
(
lone
>
MAXE_
)){
//
const double coord = 0.5;
const
double
coord
=
computeEdgeMiddleCoord
((
*
it
)
->
p1
,
(
*
it
)
->
p2
,
gf
,
m
.
scalingU
,
m
.
scalingV
);
const
double
coord
=
0.5
;
//
const double coord = computeEdgeMiddleCoord((*it)->p1, (*it)->p2, gf,
//
m.scalingU, m.scalingV);
BDS_Point
*
mid
;
GPoint
gpp
=
gf
->
point
(
m
.
scalingU
*
(
coord
*
(
*
it
)
->
p1
->
u
+
(
1
-
coord
)
*
(
*
it
)
->
p2
->
u
),
...
...
@@ -478,6 +550,8 @@ void splitEdgePass(GFace *gf, BDS_Mesh &m, double MAXE_, int &nb_split)
BDS_Edge
*
e
=
edges
[
i
].
second
;
if
(
!
e
->
deleted
){
const
double
coord
=
0.5
;
// const double coord = computeEdgeMiddleCoord((*it)->p1, (*it)->p2, gf,
// m.scalingU, m.scalingV);
BDS_Point
*
mid
;
double
U
=
coord
*
e
->
p1
->
u
+
(
1
-
coord
)
*
e
->
p2
->
u
;
double
V
=
coord
*
e
->
p1
->
v
+
(
1
-
coord
)
*
e
->
p2
->
v
;
...
...
This diff is collapsed.
Click to expand it.
Numeric/gmshLinearSystemCSR.cpp
+
1
−
1
View file @
c73a077d
...
...
@@ -291,7 +291,7 @@ void sortColumns (int NbLines,
template
<
>
int
gmshLinearSystemCSRGmm
<
double
>
::
systemSolve
()
{
if
(
!
sorted
)
if
(
!
sorted
)
sortColumns
(
_b
->
size
(),
CSRList_Nbr
(
a_
),
(
INDEX_TYPE
*
)
ptr_
->
array
,
...
...
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