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
b981580d
Commit
b981580d
authored
1 year ago
by
Klaus Böhnlein
Browse files
Options
Downloads
Patches
Plain Diff
add microproblem of buckling_experiment
parent
84f5606a
No related branches found
No related tags found
1 merge request
!13
Feature: IndexedMicrostructure (Definition of individual macroscopic microstructure-phases)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
experiment/buckling_experiment/buckling_microproblem.py
+100
-0
100 additions, 0 deletions
experiment/buckling_experiment/buckling_microproblem.py
with
100 additions
and
0 deletions
experiment/buckling_experiment/buckling_microproblem.py
0 → 100644
+
100
−
0
View file @
b981580d
import
math
import
numpy
as
np
class
ParameterSet
(
dict
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
(
ParameterSet
,
self
).
__init__
(
*
args
,
**
kwargs
)
self
.
__dict__
=
self
parameterSet
=
ParameterSet
()
#############################################
# Paths
#############################################
parameterSet
.
resultPath
=
'
/home/klaus/Desktop/Dune_bendIso/dune-microstructure/outputs_buckling_microproblem
'
parameterSet
.
baseName
=
'
buckling_microproblem
'
##################### MICROSCALE PROBLEM ####################
class
Microstructure
:
def
__init__
(
self
):
# self.macroPoint = macroPoint
self
.
gamma
=
1.0
#in the future this might change depending on macroPoint.
self
.
phases
=
2
#in the future this might change depending on macroPoint.
#--- Define different material phases:
#- PHASE 1
self
.
phase1_type
=
"
isotropic
"
self
.
materialParameters_phase1
=
[
200
,
1.0
]
#- PHASE 2
self
.
phase2_type
=
"
isotropic
"
self
.
materialParameters_phase2
=
[
100
,
1.0
]
#--- Indicator function for material phases
def
indicatorFunction
(
self
,
x
):
# if (abs(x[0]) < (theta/2) and x[2] >= 0 ):
if
(
abs
(
x
[
0
])
<
(
1.0
/
4.0
)
and
x
[
2
]
>=
0
):
return
1
#Phase1
else
:
return
2
#Phase2
#--- Define prestrain function for each phase (also works with non-constant values)
def
prestrain_phase1
(
self
,
x
):
# return [[2, 0, 0], [0,2,0], [0,0,2]]
# rho = 1.0
rho
=
1.0
return
[[
rho
*
1.0
,
0
,
0
],
[
0
,
rho
*
1.0
,
0
],
[
0
,
0
,
rho
*
1.0
]]
def
prestrain_phase2
(
self
,
x
):
return
[[
0
,
0
,
0
],
[
0
,
0
,
0
],
[
0
,
0
,
0
]]
#############################################
# Grid parameters
#############################################
parameterSet
.
microGridLevel
=
4
#############################################
# Assembly options
#############################################
parameterSet
.
set_IntegralZero
=
1
#(default = false)
parameterSet
.
set_oneBasisFunction_Zero
=
1
#(default = false)
#parameterSet.arbitraryLocalIndex = 7 #(default = 0)
#parameterSet.arbitraryElementNumber = 3 #(default = 0)
#############################################
# Solver Options, Type: #1: CG - SOLVER , #2: GMRES - SOLVER, #3: QR - SOLVER, #4: UMFPACK - SOLVER (default)
#############################################
parameterSet
.
Solvertype
=
4
# recommended to use iterative solver (e.g GMRES) for finer grid-levels
parameterSet
.
Solver_verbosity
=
0
#(default = 2) degree of information for solver output
#############################################
# Write/Output options #(default=false)
#############################################
# --- (Optional output) write Material / prestrain / Corrector functions to .vtk-Files:
parameterSet
.
write_materialFunctions
=
1
# VTK indicator function for material/prestrain definition
#parameterSet.write_prestrainFunctions = 1 # VTK norm of B (currently not implemented)
parameterSet
.
MaterialSubsamplingRefinement
=
2
# --- (Additional debug output)
parameterSet
.
print_debug
=
0
#(default=false)
parameterSet
.
print_corrector_matrices
=
0
# --- Write Correctos to VTK-File:
parameterSet
.
writeCorrectorsVTK
=
1
# --- Use caching of element matrices:
parameterSet
.
cacheElementMatrices
=
1
# --- check orthogonality (75) from paper:
parameterSet
.
write_checkOrthogonality
=
0
# --- write effective quantities (Qhom.Beff) to .txt-files
parameterSet
.
write_EffectiveQuantitiesToTxt
=
True
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