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
8dde2c00
Commit
8dde2c00
authored
3 years ago
by
Klaus Böhnlein
Browse files
Options
Downloads
Patches
Plain Diff
modify material_neukamm to 3Phases
parent
2ee71bde
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/microstructure/prestrain_material_geometry.hh
+29
-12
29 additions, 12 deletions
dune/microstructure/prestrain_material_geometry.hh
geometries/material_neukamm.py
+12
-2
12 additions, 2 deletions
geometries/material_neukamm.py
inputs/cellsolver.parset
+4
-3
4 additions, 3 deletions
inputs/cellsolver.parset
with
45 additions
and
17 deletions
dune/microstructure/prestrain_material_geometry.hh
+
29
−
12
View file @
8dde2c00
...
...
@@ -53,7 +53,8 @@ public:
}
else
if
(
imp
==
"material_neukamm"
){
std
::
array
<
double
,
2
>
mu
=
parameters
.
get
<
std
::
array
<
double
,
2
>>
(
"mu"
,
{
1.0
,
3.0
});
// std::array<double,2> mu = parameters.get<std::array<double,2>>("mu", {1.0,3.0});
std
::
array
<
double
,
3
>
mu
=
parameters
.
get
<
std
::
array
<
double
,
3
>>
(
"mu"
,
{
1.0
,
3.0
,
2.0
});
// Python::Module module = Python::import(parameters.get<std::string>("material_neukamm"));
Python
::
Module
module
=
Python
::
import
(
"material_neukamm"
);
...
...
@@ -64,8 +65,10 @@ public:
// std::cout << "Test:" << indicatorFunction(z) << std::endl;
if
(
indicatorFunction
(
z
)
==
1
)
return
mu
[
0
];
else
else
if
(
indicatorFunction
(
z
)
==
2
)
return
mu
[
1
];
else
return
mu
[
2
];
};
return
muTerm
;
}
...
...
@@ -491,7 +494,8 @@ public:
return
lambdaTerm
;
}
if
(
imp
==
"material_neukamm"
){
std
::
array
<
double
,
2
>
lambda
=
parameters
.
get
<
std
::
array
<
double
,
2
>>
(
"lambda"
,
{
1.0
,
3.0
});
// std::array<double,2> lambda = parameters.get<std::array<double,2>>("lambda", {1.0,3.0});
std
::
array
<
double
,
3
>
lambda
=
parameters
.
get
<
std
::
array
<
double
,
3
>>
(
"lambda"
,
{
1.0
,
3.0
,
2.0
});
Python
::
Module
module
=
Python
::
import
(
"material_neukamm"
);
auto
indicatorFunction
=
Python
::
make_function
<
double
>
(
module
.
get
(
"f"
));
...
...
@@ -501,8 +505,10 @@ public:
// std::cout << "Test:" << indicatorFunction(z) << std::endl;
if
(
indicatorFunction
(
z
)
==
1
)
return
lambda
[
0
];
else
else
if
(
indicatorFunction
(
z
)
==
2
)
return
lambda
[
1
];
else
return
lambda
[
2
];
};
return
lambdaTerm
;
}
...
...
@@ -995,22 +1001,33 @@ public:
return
B
;
}
else
if
(
imp
==
"material_neukamm"
){
std
::
array
<
double
,
2
>
rho
=
parameters
.
get
<
std
::
array
<
double
,
2
>>
(
"rho"
,
{
1.0
,
3.0
});
//
std::array<double,2> rho = parameters.get<std::array<double,2>>("rho", {1.0,3.0});
// Python::Module module = Python::import(parameters.get<std::string>("two_phase_material_1"));
Python
::
Module
module
=
Python
::
import
(
"material_neukamm"
);
auto
indicatorFunction
=
Python
::
make_function
<
double
>
(
module
.
get
(
"f"
));
Func2Tensor
B
=
[
rho
,
indicatorFunction
]
(
const
Domain
&
x
)
auto
B1
=
Python
::
make_function
<
MatrixRT
>
(
module
.
get
(
"b1"
));
auto
B2
=
Python
::
make_function
<
MatrixRT
>
(
module
.
get
(
"b2"
));
auto
B3
=
Python
::
make_function
<
MatrixRT
>
(
module
.
get
(
"b3"
));
// Func2Tensor B = [rho,indicatorFunction] (const Domain& x)
Func2Tensor
B
=
[
indicatorFunction
,
B1
,
B2
,
B3
]
(
const
Domain
&
x
)
{
// std::cout << "Test:" << indicatorFunction(z) << std::endl;
if
(
indicatorFunction
(
x
)
==
1
)
return
MatrixRT
{{
rho
[
0
],
0.0
,
0.0
},
{
0.0
,
rho
[
0
],
0.0
},
{
0.0
,
0.0
,
rho
[
0
]}};
else
return
MatrixRT
{{
rho
[
1
],
0.0
,
0.0
},
{
0.0
,
rho
[
1
],
0.0
},
{
0.0
,
0.0
,
rho
[
1
]}};
{
// return MatrixRT{{rho[0], 0.0 , 0.0}, {0.0, rho[0], 0.0}, {0.0, 0.0, rho[0]}};
// printmatrix(std::cout, B1(x), "Matrix B1(x)", "--");
return
B1
(
x
);
}
else
if
(
indicatorFunction
(
x
)
==
2
)
// return MatrixRT{{rho[1], 0.0 , 0.0}, {0.0, rho[1], 0.0}, {0.0, 0.0, rho[1]}};
return
B2
(
x
);
else
return
B3
(
x
);
};
std
::
cout
<<
" Prestrain Type:
two_phase_
material_
1
"
<<
std
::
endl
;
std
::
cout
<<
" Prestrain Type: material_
neukamm
"
<<
std
::
endl
;
return
B
;
}
else
if
(
imp
==
"two_phase_material_2"
){
...
...
This diff is collapsed.
Click to expand it.
geometries/material_neukamm.py
+
12
−
2
View file @
8dde2c00
...
...
@@ -12,6 +12,16 @@ def f(x):
if
((
abs
(
x
[
0
])
<
theta
/
2
)
and
x
[
2
]
<-
1
/
2
+
theta
):
return
1
#Phase1
elif
((
abs
(
x
[
1
])
<
factor
*
theta
/
2
)
and
x
[
2
]
>
1
/
2
-
theta
):
return
1
#Phase
1
return
2
#Phase
2
else
:
return
0
#Phase2
return
0
#Phase3
def
b1
(
x
):
return
[[
1
,
4
,
5
],
[
-
5
,
8
,
9
],
[
-
5
,
8
,
0
]]
def
b2
(
x
):
return
[[
9
,
1
,
9
],
[
1
,
9
,
1
],
[
1
,
1
,
9
]]
def
b3
(
x
):
return
[[
0
,
0
,
0
],
[
0
,
0
,
0
],
[
0
,
8
,
0
]]
This diff is collapsed.
Click to expand it.
inputs/cellsolver.parset
+
4
−
3
View file @
8dde2c00
...
...
@@ -10,7 +10,7 @@
#############################################
### Remove/Comment this when running via Python-Script:
outputPath=/home/stefan/DUNE/dune-microstructure/outputs
#outputPath=/home/klaus/Desktop/DUNE/dune-microstructure/outputs
#############################################
...
...
@@ -64,8 +64,8 @@ lambda1=1.0
# better: pass material parameters as a vector
mu=80 60
lambda=80 25
mu=80 60
20
lambda=80 25
10
rho=1.0 0
...
...
@@ -80,6 +80,7 @@ theta=0.25
#--- choose composite-Implementation:
geometryFunctionPath = /home/stefan/DUNE/dune-microstructure/geometries
#geometryFunctionPath = /home/klaus/Desktop/DUNE/dune-microstructure/geometries
material_prestrain_imp= "material_neukamm" #(Python-indicator-function with same name determines material phases)
#material_prestrain_imp= "two_phase_material_2" #(Python-indicator-function with same name determines material phases)
#material_prestrain_imp= "two_phase_material_3" #(Python-indicator-function with same name determines material phases)
...
...
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