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
65af28fd
Commit
65af28fd
authored
12 years ago
by
Emilie Sauvage
Browse files
Options
Downloads
Patches
Plain Diff
Changed intersection so that intersection(M,M) = M
parent
aead9631
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
Geo/STensor3.cpp
+42
-0
42 additions, 0 deletions
Geo/STensor3.cpp
with
42 additions
and
0 deletions
Geo/STensor3.cpp
+
42
−
0
View file @
65af28fd
...
@@ -22,6 +22,8 @@ void STensor3::print (const char *s) const
...
@@ -22,6 +22,8 @@ void STensor3::print (const char *s) const
(
*
this
)(
2
,
0
),
(
*
this
)(
2
,
1
),
(
*
this
)(
2
,
2
));
(
*
this
)(
2
,
0
),
(
*
this
)(
2
,
1
),
(
*
this
)(
2
,
2
));
}
}
//// ORIGINAL CODE FROM GMSH
/*
SMetric3 intersection (const SMetric3 &m1, const SMetric3 &m2)
SMetric3 intersection (const SMetric3 &m1, const SMetric3 &m2)
{
{
SMetric3 im1 = m1.invert();
SMetric3 im1 = m1.invert();
...
@@ -39,6 +41,46 @@ SMetric3 intersection (const SMetric3 &m1, const SMetric3 &m2)
...
@@ -39,6 +41,46 @@ SMetric3 intersection (const SMetric3 &m1, const SMetric3 &m2)
return iv;
return iv;
}
}
*/
//// MODIFIED INTERSECTION
SMetric3
intersection
(
const
SMetric3
&
m1
,
const
SMetric3
&
m2
)
{
SMetric3
im1
=
m1
.
invert
();
fullMatrix
<
double
>
V
(
3
,
3
);
fullVector
<
double
>
S
(
3
);
im1
*=
m2
;
im1
.
eig
(
V
,
S
,
true
);
SVector3
v0
(
V
(
0
,
0
),
V
(
1
,
0
),
V
(
2
,
0
));
SVector3
v1
(
V
(
0
,
1
),
V
(
1
,
1
),
V
(
2
,
1
));
SVector3
v2
(
V
(
0
,
2
),
V
(
1
,
2
),
V
(
2
,
2
));
double
l0
=
std
::
max
(
dot
(
v0
,
m1
,
v0
),
dot
(
v0
,
m2
,
v0
));
double
l1
=
std
::
max
(
dot
(
v1
,
m1
,
v1
),
dot
(
v1
,
m2
,
v1
));
double
l2
=
std
::
max
(
dot
(
v2
,
m1
,
v2
),
dot
(
v2
,
m2
,
v2
));
// Correction as explained in the PhD thesis of Frederic Alauzet p.16
double
max_eig
=
std
::
max
(
l0
,
std
::
max
(
l1
,
l2
));
double
min_eig
=
std
::
min
(
l0
,
std
::
min
(
l1
,
l2
));
double
range_eig
=
(
max_eig
-
min_eig
);
if
(
range_eig
<
1.0e-1
)
// Change this value if you think it's too big ...
{
if
(
max_eig
<=
1.0
)
{
return
m1
;
}
else
{
return
m2
;
}
}
SMetric3
iv
(
l0
,
l1
,
l2
,
v0
,
v1
,
v2
);
return
iv
;
}
// preserve orientation of m1 !!!
// preserve orientation of m1 !!!
SMetric3
intersection_conserveM1
(
const
SMetric3
&
m1
,
const
SMetric3
&
m2
)
SMetric3
intersection_conserveM1
(
const
SMetric3
&
m1
,
const
SMetric3
&
m2
)
...
...
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