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
f2e638ac
Commit
f2e638ac
authored
14 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
tensor view : ellipses honnor COG/Vertex option
parent
30f487d0
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Post/PViewVertexArrays.cpp
+61
-52
61 additions, 52 deletions
Post/PViewVertexArrays.cpp
with
61 additions
and
52 deletions
Post/PViewVertexArrays.cpp
+
61
−
52
View file @
f2e638ac
...
...
@@ -954,34 +954,41 @@ static void addTensorElement(PView *p, int iEnt, int iEle, int numNodes, int typ
fullMatrix
<
double
>
V
(
3
,
3
);
fullMatrix
<
double
>
rightV
(
3
,
3
);
double
vval
[
3
][
PVIEW_NMAX
][
9
];
if
(
opt
->
tensorType
==
PViewOptions
::
VonMises
){
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
val
[
i
][
0
]
=
ComputeVonMises
(
val
[
i
]);
addScalarElement
(
p
,
type
,
xyz
,
val
,
pre
,
numNodes
);
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
MinEigenValue
)
{
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
MinEigenValue
||
opt
->
tensorType
==
PViewOptions
::
MaxEigenValue
||
opt
->
tensorType
==
PViewOptions
::
EigenVectors
)
{
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
tensor
(
j
,
0
)
=
val
[
i
][
0
+
j
*
3
];
tensor
(
j
,
1
)
=
val
[
i
][
1
+
j
*
3
];
tensor
(
j
,
2
)
=
val
[
i
][
2
+
j
*
3
];
}
tensor
.
eig
(
S
,
imS
,
V
,
rightV
,
true
);
tensor
.
eig
(
S
,
imS
,
V
,
rightV
,
opt
->
tensorType
!=
PViewOptions
::
EigenVectors
);
if
(
PViewOptions
::
MinEigenValue
==
opt
->
tensorType
)
val
[
i
][
0
]
=
S
(
0
);
}
addScalarElement
(
p
,
type
,
xyz
,
val
,
pre
,
numNodes
);
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
MaxEigenValue
)
{
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
{
else
if
(
PViewOptions
::
MaxEigenValue
==
opt
->
tensorType
)
val
[
i
][
0
]
=
S
(
2
);
else
if
(
PViewOptions
::
EigenVectors
==
opt
->
tensorType
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
tensor
(
j
,
0
)
=
val
[
i
][
0
+
j
*
3
]
;
tensor
(
j
,
1
)
=
val
[
i
][
1
+
j
*
3
]
;
tensor
(
j
,
2
)
=
val
[
i
][
2
+
j
*
3
]
;
vval
[
j
][
i
][
0
]
=
V
(
j
,
0
)
*
S
(
j
)
;
vval
[
j
][
i
][
1
]
=
V
(
j
,
1
)
*
S
(
j
)
;
vval
[
j
][
i
][
2
]
=
V
(
j
,
2
)
*
S
(
j
)
;
}
tensor
.
eig
(
S
,
imS
,
V
,
rightV
,
true
);
val
[
i
][
0
]
=
S
(
2
);
}
}
if
(
PViewOptions
::
EigenVectors
==
opt
->
tensorType
)
{
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
0
],
pre
);
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
1
],
pre
);
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
2
],
pre
);
}
else
addScalarElement
(
p
,
type
,
xyz
,
val
,
pre
,
numNodes
);
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
EigenVectors
)
{
double
vval
[
3
][
PVIEW_NMAX
][
9
];
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
Ellipse
)
{
if
(
opt
->
glyphLocation
==
PViewOptions
::
Vertex
){
double
vval
[
3
][
4
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
){
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
tensor
(
j
,
0
)
=
val
[
i
][
0
+
j
*
3
];
...
...
@@ -989,16 +996,18 @@ static void addTensorElement(PView *p, int iEnt, int iEle, int numNodes, int typ
tensor
(
j
,
2
)
=
val
[
i
][
2
+
j
*
3
];
}
tensor
.
eig
(
S
,
imS
,
V
,
rightV
,
false
);
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
vval
[
k
][
0
]
=
xyz
[
i
][
k
];
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
vval
[
j
][
i
][
0
]
=
V
(
j
,
0
)
*
S
(
j
);
vval
[
j
][
i
][
1
]
=
V
(
j
,
1
)
*
S
(
j
);
vval
[
j
][
i
][
2
]
=
V
(
j
,
2
)
*
S
(
j
);
vval
[
k
][
j
+
1
]
=
V
(
j
,
k
)
*
S
(
j
);
}
}
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
0
],
pre
);
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
1
],
pre
);
addVectorElement
(
p
,
iEnt
,
iEle
,
numNodes
,
type
,
xyz
,
vval
[
2
],
pre
);
}
else
if
(
opt
->
tensorType
==
PViewOptions
::
Ellipse
)
{
double
lmax
=
std
::
max
(
S
(
0
),
std
::
max
(
S
(
1
),
S
(
2
)));
unsigned
int
color
=
opt
->
getColor
(
lmax
,
opt
->
tmpMin
,
opt
->
tmpMax
,
false
,
(
opt
->
intervalsType
==
PViewOptions
::
Discrete
)
?
opt
->
nbIso
:
-
1
);
unsigned
int
col
[
4
]
=
{
color
,
color
,
color
,
color
};
p
->
va_ellipses
->
add
(
vval
[
0
],
vval
[
1
],
vval
[
2
],
0
,
col
,
0
,
false
);
}
}
else
if
(
opt
->
glyphLocation
==
PViewOptions
::
COG
){
double
vval
[
3
][
4
]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
{
for
(
int
j
=
0
;
j
<
3
;
j
++
)
{
...
...
@@ -1017,12 +1026,12 @@ static void addTensorElement(PView *p, int iEnt, int iEle, int numNodes, int typ
vval
[
2
][
0
]
+=
xyz
[
i
][
2
]
/
numNodes
;
}
double
lmax
=
std
::
max
(
S
(
0
),
std
::
max
(
S
(
1
),
S
(
2
)));
//unsigned int color = opt->getColor(lmax, opt->externalMin, opt->externalMax, false, (opt->intervalsType == PViewOptions::Discrete) ? opt->nbIso : -1);
unsigned
int
color
=
opt
->
getColor
(
lmax
,
opt
->
tmpMin
,
opt
->
tmpMax
,
false
,
(
opt
->
intervalsType
==
PViewOptions
::
Discrete
)
?
opt
->
nbIso
:
-
1
);
unsigned
int
col
[
4
]
=
{
color
,
color
,
color
,
color
};
p
->
va_ellipses
->
add
(
vval
[
0
],
vval
[
1
],
vval
[
2
],
0
,
col
,
0
,
false
);
}
}
}
static
void
addElementsInArrays
(
PView
*
p
,
bool
preprocessNormalsOnly
)
{
...
...
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