Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-microstructure
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
Commits
61e72fdf
Commit
61e72fdf
authored
2 years ago
by
Klaus Böhnlein
Browse files
Options
Downloads
Patches
Plain Diff
Fix material_neukamm definition
parent
274ab1ab
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/prestrainedMaterial.hh
+63
-7
63 additions, 7 deletions
dune/microstructure/prestrainedMaterial.hh
with
63 additions
and
7 deletions
dune/microstructure/prestrainedMaterial.hh
+
63
−
7
View file @
61e72fdf
...
...
@@ -32,10 +32,12 @@ using std::make_shared;
template
<
class
Domain
>
int
indicatorFunction_material_1
(
const
Domain
&
x
)
{
// std::cout << "x[0] , x[1] , x[2]" << x[0] << " , " << x[1] << ", "<< x[2] << std::endl;
// std::cout << "-1/2: " << -1/2 << std::endl;
double
theta
=
0.25
;
if
(
x
[
0
]
<
(
-
1
/
2
+
theta
)
&&
x
[
2
]
<
(
-
1
/
2
+
theta
))
if
(
x
[
0
]
<
(
-
0.5
+
theta
)
and
x
[
2
]
<
(
-
0.5
+
theta
))
return
1
;
//#Phase1
else
if
(
x
[
1
]
<
(
-
1
/
2
+
theta
)
&&
x
[
2
]
>
(
1
/
2
-
theta
))
else
if
(
x
[
1
]
<
(
-
0.5
+
theta
)
and
x
[
2
]
>
(
0.5
-
theta
))
return
2
;
//#Phase2
else
return
0
;
//#Phase3
...
...
@@ -194,7 +196,7 @@ public:
:
gridView_
(
gridView
),
parameterSet_
(
parameterSet
)
{
std
::
string
materialFunctionName_
=
parameterSet
.
get
<
std
::
string
>
(
"materialFunction"
,
"material"
);
std
::
string
materialFunctionName_
=
parameterSet
.
get
<
std
::
string
>
(
"materialFunction"
,
"material
_1
"
);
std
::
cout
<<
"materialFunctionName_ : "
<<
materialFunctionName_
<<
std
::
endl
;
...
...
@@ -227,6 +229,50 @@ public:
/////////////////////////////////////////////////////////////////////////////////////////////////////////
// static int indicatorFunction_material_1(const Domain& x)
// {
// // std::cout << "x[0] , x[1] , x[2]" << x[0] << " , " << x[1] << ", "<< x[2] << std::endl;
// double theta=0.25;
// std::cout << "-1/2" << -1/2 << std::endl;
// if ((x[1]< (-0.5+theta)) and (x[2]>(0.5-theta)))
// {
// return 2; //#Phase1
// }
// else if ((x[0] < (-0.5+theta)) and (x[2]<(-0.5+theta)))
// {
// return 1; //#Phase2
// }
// else
// {
// return 0; //#Phase3
// }
// }
// static int indicatorFunction_material_1(const Domain& x)
// {
// // std::cout << "x[0] , x[1] , x[2]" << x[0] << " , " << x[1] << ", "<< x[2] << std::endl;
// double theta=0.25;
// if ((x[0] < (-1/2+theta)) and (x[2]<(-1/2+theta)))
// return 1; //#Phase1
// else if ((x[1]< (-1/2+theta)) and (x[2]>(1/2-theta)))
// return 2; //#Phase2
// else
// return 0; //#Phase3
// }
static
MatrixRT
material_1
(
const
MatrixRT
&
G
,
const
int
&
phase
)
{
const
FieldVector
<
double
,
3
>
mu
=
{
80.0
,
80.0
,
60.0
};
const
FieldVector
<
double
,
3
>
lambda
=
{
80.0
,
80.0
,
25.0
};
if
(
phase
==
1
)
return
2.0
*
mu
[
0
]
*
sym
(
G
)
+
lambda
[
0
]
*
trace
(
sym
(
G
))
*
Id
();
if
(
phase
==
2
)
return
2.0
*
mu
[
1
]
*
sym
(
G
)
+
lambda
[
1
]
*
trace
(
sym
(
G
))
*
Id
();
else
return
2.0
*
mu
[
2
]
*
sym
(
G
)
+
lambda
[
2
]
*
trace
(
sym
(
G
))
*
Id
();
}
// static int indicatorFunction_material_1(const Domain& x)
// {
...
...
@@ -267,8 +313,9 @@ public:
//---function that determines elasticity Tensor
void
setupElasticityTensor
(
const
std
::
string
name
)
// cant use materialFunctionName_ here!?
{
if
(
name
==
"material"
)
{
std
::
cout
<<
"Using material definition:"
<<
name
<<
std
::
endl
;
if
(
name
==
"material_1"
)
{
// indicatorFunctionGVF_ = Dune::Functions::makeGridViewFunction(indicatorFunction_material_1, gridView_);
// indicatorFunction_ = indicatorFunction_material_1;
indicatorFunctionGVF_
=
Dune
::
Functions
::
makeGridViewFunction
(
indicatorFunction_material_1
<
Domain
>
,
gridView_
);
...
...
@@ -279,7 +326,7 @@ public:
{
// indicatorFunctionGVF_ = Dune::Functions::makeGridViewFunction(indicatorFunction_material_1, gridView_);
// indicatorFunction_ = indicatorFunction_material_1;
indicatorFunctionGVF_
=
Dune
::
Functions
::
makeGridViewFunction
(
indicatorFunction_material_
1
<
Domain
>
,
gridView_
);
indicatorFunctionGVF_
=
Dune
::
Functions
::
makeGridViewFunction
(
indicatorFunction_material_
homogeneous
<
Domain
>
,
gridView_
);
indicatorFunction_
=
indicatorFunction_material_homogeneous
<
Domain
>
;
elasticityTensor_
=
material_homogeneous
;
}
...
...
@@ -318,7 +365,11 @@ public:
// return material_1(G,indicatorFunction_(x));
}
int
applyIndicatorFunction
(
const
Domain
&
x
)
const
{
// return indicatorFunction_(x)
;
return
indicatorFunction_material_1
(
x
);
}
//////////////////////////////////////////////////////////////////////////////
...
...
@@ -378,6 +429,11 @@ public:
auto
getIndicatorFunctionGVF
()
const
{
return
indicatorFunctionGVF_
;}
//get as GridViewFunction
auto
getIndicatorFunction
()
const
{
return
indicatorFunction_
;}
// shared_ptr<Func2int> getIndicatorFunction(){return make_shared<Func2int>(indicatorFunction_);}
// auto getIndicatorFunction(){return make_shared<Func2int>(indicatorFunction_);}
// shared_ptr<Func2TensorParam> getElasticityTensor(){return make_shared<Func2TensorParam>(elasticityTensor_);}
...
...
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