Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wenqing
ogs
Commits
ee4b2639
Commit
ee4b2639
authored
6 years ago
by
wenqing
Browse files
Options
Downloads
Patches
Plain Diff
[Math] Added a function to calculate the norm of deviatoric vector
parent
0330afab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MathLib/KelvinVector-impl.h
+9
-0
9 additions, 0 deletions
MathLib/KelvinVector-impl.h
MathLib/KelvinVector.h
+4
-0
4 additions, 0 deletions
MathLib/KelvinVector.h
with
13 additions
and
0 deletions
MathLib/KelvinVector-impl.h
+
9
−
0
View file @
ee4b2639
...
...
@@ -7,6 +7,8 @@
*
*/
#include
<cmath>
namespace
MathLib
{
namespace
KelvinVector
...
...
@@ -20,6 +22,13 @@ double Invariants<KelvinVectorSize>::equivalentStress(
return
std
::
sqrt
(
3
*
J2
(
deviatoric_v
));
}
template
<
int
KelvinVectorSize
>
double
Invariants
<
KelvinVectorSize
>::
Norm
(
Eigen
::
Matrix
<
double
,
KelvinVectorSize
,
1
>
const
&
deviatoric_v
)
{
return
std
::
sqrt
(
deviatoric_v
.
transpose
()
*
deviatoric_v
);
}
template
<
int
KelvinVectorSize
>
double
Invariants
<
KelvinVectorSize
>::
J2
(
Eigen
::
Matrix
<
double
,
KelvinVectorSize
,
1
>
const
&
deviatoric_v
)
...
...
This diff is collapsed.
Click to expand it.
MathLib/KelvinVector.h
+
4
−
0
View file @
ee4b2639
...
...
@@ -87,6 +87,10 @@ struct Invariants final
static
double
equivalentStress
(
Eigen
::
Matrix
<
double
,
KelvinVectorSize
,
1
>
const
&
deviatoric_v
);
/// Get the norm of the deviatoric stress.
static
double
Norm
(
Eigen
::
Matrix
<
double
,
KelvinVectorSize
,
1
>
const
&
deviatoric_v
);
/// Second invariant of deviatoric tensor.
/// \note The input vector must have trace equal zero.
static
double
J2
(
...
...
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