Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-microstructure-backup
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Klaus Böhnlein
dune-microstructure-backup
Commits
7e1ca3bc
Commit
7e1ca3bc
authored
1 year ago
by
Sander, Oliver
Browse files
Options
Downloads
Patches
Plain Diff
Store the basis of matrix space in Voigt notation
This again saves a few conversions.
parent
c4ac0bd6
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
dune/microstructure/CorrectorComputer.hh
+13
-20
13 additions, 20 deletions
dune/microstructure/CorrectorComputer.hh
with
13 additions
and
20 deletions
dune/microstructure/CorrectorComputer.hh
+
13
−
20
View file @
7e1ca3bc
...
...
@@ -67,11 +67,9 @@ protected:
const
std
::
array
<
VectorCT
,
3
>
phiContainer
=
{
phi_1_
,
phi_2_
,
phi_3_
};
// ---- Basis for R_sym^{2x2}
constexpr
static
double
sqrtOf2
=
1.414213562373095
;
// The sqrt method is not constexpr
constexpr
static
MatrixRT
G1_
{{
1.0
,
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
},
{
0.0
,
0
,
0.0
}};
constexpr
static
MatrixRT
G2_
{{
0.0
,
0.0
,
0.0
},
{
0.0
,
1.0
,
0.0
},
{
0
,
0.0
,
0.0
}};
constexpr
static
MatrixRT
G3_
{{
0.0
,
1.0
/
sqrtOf2
,
0.0
},
{
1.0
/
sqrtOf2
,
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
}};
constexpr
static
std
::
array
<
MatrixRT
,
3
>
matrixBasis_
=
{
G1_
,
G2_
,
G3_
};
// Could really be constexpr static, but then we would need to write the basis here directly in Voigt notation.
// However, I suspect that our Voigt representation may still change in the future.
const
std
::
array
<
VoigtVector
<
double
,
3
>
,
3
>
matrixBasis_
;
Func2Tensor
x3G_1_
=
[]
(
const
Domain
&
x
)
{
return
MatrixRT
{{
1.0
*
x
[
2
],
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
}};
//TODO könnte hier sign übergeben?
...
...
@@ -104,6 +102,9 @@ public:
gamma_
(
gamma
),
log_
(
log
),
parameterSet_
(
parameterSet
),
matrixBasis_
(
std
::
array
<
VoigtVector
<
double
,
3
>
,
3
>
{
matrixToVoigt
(
Dune
::
FieldMatrix
<
double
,
3
,
3
>
({{
1
,
0
,
0
},
{
0
,
0
,
0
},
{
0
,
0
,
0
}})),
matrixToVoigt
(
Dune
::
FieldMatrix
<
double
,
3
,
3
>
({{
0
,
0
,
0
},
{
0
,
1
,
0
},
{
0
,
0
,
0
}})),
matrixToVoigt
(
Dune
::
FieldMatrix
<
double
,
3
,
3
>
({{
0
,
1
/
std
::
sqrt
(
2.0
),
0
},
{
1
/
std
::
sqrt
(
2.0
),
0
,
0
},
{
0
,
0
,
0
}}))}),
phiOffset_
(
basis
.
size
())
{
...
...
@@ -157,7 +158,7 @@ public:
// shared_ptr<std::array<VectorRT, 3>> getBasiscontainer(){return make_shared<std::array<VectorRT, 3>>(basisContainer_);}
auto
getMatrixBasiscontainer
(){
return
make_shared
<
std
::
array
<
MatrixRT
,
3
>>
(
matrixBasis_
);}
auto
getMatrixBasiscontainer
(){
return
make_shared
<
std
::
array
<
VoigtVector
<
double
,
3
>
,
3
>>
(
matrixBasis_
);}
// auto getx3MatrixBasiscontainer(){return make_shared<std::array<Func2Tensor, 3>>(x3MatrixBasisContainer_);}
auto
getx3MatrixBasiscontainer
(){
return
x3MatrixBasisContainer_
;}
...
...
@@ -408,7 +409,7 @@ public:
double
energyDensityGphi
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
(
matrixToVoigt
(
matrixBasis_
[
m
]
)
,
phase
),
deformationGradient
[
j
][
l
]);
double
energyDensityGphi
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
(
matrixBasis_
[
m
],
phase
),
deformationGradient
[
j
][
l
]);
// double energyDensityGphi = scalarProduct(material_.ElasticityTensor(basisContainer[m],localIndicatorFunction(quadPos)),sym(defGradientV));
// double energyDensityGphi= scalarProduct(elasticityTensor(basisContainer[m],localIndicatorFunction(quadPos)),sym(defGradientV));
// std::cout << "scalarProduct(elasticityTensor(basisContainer[m],indicatorFunction(element.geometry().global(quadPos))),sym(defGradientV))" << scalarProduct(elasticityTensor(basisContainer[m],indicatorFunction(element.geometry().global(quadPos))),sym(defGradientV)) <<std::endl;
...
...
@@ -457,7 +458,7 @@ public:
double
energyDensityGG
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
(
matrixToVoigt
(
matrixBasis_
[
m
]
)
,
phase
),
matrixToVoigt
(
matrixBasis_
[
n
])
)
;
double
energyDensityGG
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
(
matrixBasis_
[
m
],
phase
),
matrixBasis_
[
n
]);
// double energyDensityGG = scalarProduct(material_.ElasticityTensor(basisContainer[m],localIndicatorFunction(quadPos)),sym(basisContainer[n]));
// double energyDensityGG= scalarProduct(elasticityTensor(basisContainer[m],localIndicatorFunction(quadPos)),sym(basisContainer[n]));
// double energyDensityGG= scalarProduct(elasticityTensor(basisContainer[m],indicatorFunction(element.geometry().global(quadPos))),sym(basisContainer[n]));
...
...
@@ -531,14 +532,6 @@ public:
// LocalBasis-Offset
const
int
localPhiOffset
=
localView
.
size
();
///////////////////////////////////////////////
// Basis for R_sym^{2x2}
//////////////////////////////////////////////
MatrixRT
G_1
{{
1.0
,
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
}};
MatrixRT
G_2
{{
0.0
,
0.0
,
0.0
},
{
0.0
,
1.0
,
0.0
},
{
0.0
,
0.0
,
0.0
}};
MatrixRT
G_3
{{
0.0
,
1.0
/
sqrt
(
2.0
),
0.0
},
{
1.0
/
sqrt
(
2.0
),
0.0
,
0.0
},
{
0.0
,
0.0
,
0.0
}};
std
::
array
<
MatrixRT
,
3
>
basisContainer
=
{
G_1
,
G_2
,
G_3
};
// int orderQR = 2*(dim*localFiniteElement.localBasis().order()-1)+5; // TEST
// int orderQR = 0;
// int orderQR = 1;
...
...
@@ -620,7 +613,7 @@ public:
// double energyDensityfG= scalarProduct(material_.ElasticityTensorGlobal((-1.0)*forceTerm(quadPos),element.geometry().global(quadPos)),sym(basisContainer[m]));
double
energyDensityfG
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
((
-
1.0
)
*
matrixToVoigt
(
forceTerm
(
quadPos
)),
localIndicatorFunction
(
quadPos
)),
matrix
ToVoigt
(
basisContainer
[
m
])
)
;
double
energyDensityfG
=
voigtScalarProduct
(
material_
.
applyElasticityTensor
((
-
1.0
)
*
matrixToVoigt
(
forceTerm
(
quadPos
)),
localIndicatorFunction
(
quadPos
)),
matrix
Basis_
[
m
]);
// double energyDensityfG= scalarProduct(material_.ElasticityTensor((-1.0)*forceTerm(quadPos),localIndicatorFunction(quadPos)),sym(basisContainer[m]));
// double energyDensityfG= scalarProduct(elasticityTensor((-1.0)*forceTerm(quadPos),localIndicatorFunction(quadPos)),sym(basisContainer[m]));
// double energyDensityfG= scalarProduct(elasticityTensor((-1.0)*forceTerm(quadPos),indicatorFunction(element.geometry().global(quadPos))),sym(basisContainer[m]));
...
...
@@ -1101,9 +1094,9 @@ public:
for
(
size_t
i
=
0
;
i
<
3
;
i
++
)
{
mContainer
[
0
]
+=
m_1_
[
i
]
*
matrixBasis_
[
i
];
mContainer
[
1
]
+=
m_2_
[
i
]
*
matrixBasis_
[
i
];
mContainer
[
2
]
+=
m_3_
[
i
]
*
matrixBasis_
[
i
];
mContainer
[
0
]
+=
m_1_
[
i
]
*
voigtToMatrix
(
matrixBasis_
[
i
]
)
;
mContainer
[
1
]
+=
m_2_
[
i
]
*
voigtToMatrix
(
matrixBasis_
[
i
]
)
;
mContainer
[
2
]
+=
m_3_
[
i
]
*
voigtToMatrix
(
matrixBasis_
[
i
]
)
;
}
std
::
cout
<<
"--- plot corrector-Matrices M_alpha --- "
<<
std
::
endl
;
...
...
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