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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
0d361fd0
Commit
0d361fd0
authored
15 years ago
by
Emilie Marchandise
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
148885f7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Solver/multiscaleLaplace.cpp
+16
-5
16 additions, 5 deletions
Solver/multiscaleLaplace.cpp
with
16 additions
and
5 deletions
Solver/multiscaleLaplace.cpp
+
16
−
5
View file @
0d361fd0
...
@@ -227,6 +227,7 @@ static void recur_compute_centers_ (double R, double a1, double a2,
...
@@ -227,6 +227,7 @@ static void recur_compute_centers_ (double R, double a1, double a2,
centers
.
push_back
(
std
::
make_pair
(
PL
,
zero
));
centers
.
push_back
(
std
::
make_pair
(
PL
,
zero
));
centers
.
push_back
(
std
::
make_pair
(
PR
,
zero
));
centers
.
push_back
(
std
::
make_pair
(
PR
,
zero
));
std
::
map
<
SPoint2
,
double
>
CR
;
for
(
int
i
=
0
;
i
<
root
->
children
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
root
->
children
.
size
();
i
++
){
multiscaleLaplaceLevel
*
m
=
root
->
children
[
i
];
multiscaleLaplaceLevel
*
m
=
root
->
children
[
i
];
centers
.
push_back
(
std
::
make_pair
(
m
->
center
,
m
));
centers
.
push_back
(
std
::
make_pair
(
m
->
center
,
m
));
...
@@ -237,12 +238,13 @@ static void recur_compute_centers_ (double R, double a1, double a2,
...
@@ -237,12 +238,13 @@ static void recur_compute_centers_ (double R, double a1, double a2,
m
->
radius
=
std
::
max
(
m
->
radius
,
sqrt
((
m
->
center
.
x
()
-
p
.
x
())
*
(
m
->
center
.
x
()
-
p
.
x
())
+
m
->
radius
=
std
::
max
(
m
->
radius
,
sqrt
((
m
->
center
.
x
()
-
p
.
x
())
*
(
m
->
center
.
x
()
-
p
.
x
())
+
(
m
->
center
.
y
()
-
p
.
y
())
*
(
m
->
center
.
y
()
-
p
.
y
())));
(
m
->
center
.
y
()
-
p
.
y
())
*
(
m
->
center
.
y
()
-
p
.
y
())));
}
}
CR
.
insert
(
std
::
make_pair
(
m
->
center
,
m
->
radius
));
}
}
//add the center of real holes ...
//add the center of real holes ...
if
(
root
->
children
.
size
()
==
0
){
//|| boundaries.size()-1 != root->children.size()){
std
::
vector
<
std
::
vector
<
MEdge
>
>
boundaries
;
std
::
vector
<
std
::
vector
<
MEdge
>
>
boundaries
;
connected_bounds
(
root
->
elements
,
boundaries
);
connected_bounds
(
root
->
elements
,
boundaries
);
if
(
root
->
children
.
size
()
==
0
){
// || boundaries.size()-1 != root->children.size()){
for
(
unsigned
int
i
=
0
;
i
<
boundaries
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
boundaries
.
size
();
i
++
){
std
::
vector
<
MEdge
>
me
=
boundaries
[
i
];
std
::
vector
<
MEdge
>
me
=
boundaries
[
i
];
SPoint2
c
(
0.0
,
0.0
);
SPoint2
c
(
0.0
,
0.0
);
...
@@ -258,6 +260,15 @@ static void recur_compute_centers_ (double R, double a1, double a2,
...
@@ -258,6 +260,15 @@ static void recur_compute_centers_ (double R, double a1, double a2,
rad
=
std
::
max
(
rad
,
sqrt
((
c
.
x
()
-
p
.
x
())
*
(
c
.
x
()
-
p
.
x
())
+
rad
=
std
::
max
(
rad
,
sqrt
((
c
.
x
()
-
p
.
x
())
*
(
c
.
x
()
-
p
.
x
())
+
(
c
.
y
()
-
p
.
y
())
*
(
c
.
y
()
-
p
.
y
())));
(
c
.
y
()
-
p
.
y
())
*
(
c
.
y
()
-
p
.
y
())));
}
}
//check if the center has not been added
// bool newCenter = false;
// for (std::map<SPoint2,double>::iterator it = CR.begin(); it != CR.end(); it++){
// SPoint2 p = it->first;
// double radius = it->second;
// double dist = sqrt ((c.x() - p.x())*(c.x() - p.x())+ (c.y() - p.y())*(c.y() - p.y()));
// if (dist > radius) newCenter = true;
// }
if
(
std
::
abs
(
rad
/
root
->
radius
)
<
0.9
&&
std
::
abs
(
rad
)
<
0.99
){
if
(
std
::
abs
(
rad
/
root
->
radius
)
<
0.9
&&
std
::
abs
(
rad
)
<
0.99
){
centers
.
push_back
(
std
::
make_pair
(
c
,
zero
));
centers
.
push_back
(
std
::
make_pair
(
c
,
zero
));
}
}
...
@@ -903,7 +914,7 @@ void multiscaleLaplace::parametrize (multiscaleLaplaceLevel & level){
...
@@ -903,7 +914,7 @@ void multiscaleLaplace::parametrize (multiscaleLaplaceLevel & level){
MElement
*
e
=
level
.
elements
[
i
];
MElement
*
e
=
level
.
elements
[
i
];
std
::
vector
<
SPoint2
>
localCoord
;
std
::
vector
<
SPoint2
>
localCoord
;
double
local_size
=
localSize
(
e
,
solution
);
double
local_size
=
localSize
(
e
,
solution
);
if
(
local_size
<
1
.e-5
*
global_size
)
if
(
local_size
<
5
.e-5
*
global_size
)
//1.e-5
tooSmall
.
push_back
(
e
);
tooSmall
.
push_back
(
e
);
else
goodSize
.
push_back
(
e
);
else
goodSize
.
push_back
(
e
);
}
}
...
@@ -939,7 +950,7 @@ void multiscaleLaplace::parametrize (multiscaleLaplaceLevel & level){
...
@@ -939,7 +950,7 @@ void multiscaleLaplace::parametrize (multiscaleLaplaceLevel & level){
for
(
int
k
=
0
;
k
<
regions_
[
i
].
size
()
;
k
++
){
for
(
int
k
=
0
;
k
<
regions_
[
i
].
size
()
;
k
++
){
MElement
*
e
=
regions_
[
i
][
k
];
MElement
*
e
=
regions_
[
i
][
k
];
double
local_size
=
localSize
(
e
,
solution
);
double
local_size
=
localSize
(
e
,
solution
);
if
(
local_size
<
1.e-7
*
global_size
)
if
(
local_size
<
1.e-7
*
global_size
)
//1.e-7
really_small_elements
=
true
;
really_small_elements
=
true
;
}
}
if
(
really_small_elements
)
regions
.
push_back
(
regions_
[
i
]);
if
(
really_small_elements
)
regions
.
push_back
(
regions_
[
i
]);
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
Next
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