Skip to content
Snippets Groups Projects
Commit bf177246 authored by Klaus Böhnlein's avatar Klaus Böhnlein
Browse files

update

parent 27281c14
No related branches found
No related tags found
No related merge requests found
...@@ -110,6 +110,7 @@ protected: ...@@ -110,6 +110,7 @@ protected:
// MatrixFunc L2_; // MatrixFunc L2_;
// MatrixFunc L3_; // MatrixFunc L3_;
// Elasticity tensors (in voigt notation)
FieldMatrix<double,6,6> L1_; FieldMatrix<double,6,6> L1_;
FieldMatrix<double,6,6> L2_; FieldMatrix<double,6,6> L2_;
FieldMatrix<double,6,6> L3_; FieldMatrix<double,6,6> L3_;
...@@ -137,20 +138,20 @@ protected: ...@@ -137,20 +138,20 @@ protected:
//Transformation matrix for Voigt notation //Transformation matrix for Voigt notation
// FieldMatrix<double,6,6> D = {{1.0, 0.0, 0.0, 0.0 , 0.0, 0.0}, FieldMatrix<double,6,6> D_ = {{1.0, 0.0, 0.0, 0.0 , 0.0, 0.0},
// {0.0, 1.0, 0.0, 0.0 , 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0 , 0.0, 0.0},
// {0.0, 0.0, 1.0, 0.0 , 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0 , 0.0, 0.0},
// {0.0, 0.0, 0.0, sqrt(2.0) , 0.0, 0.0}, {0.0, 0.0, 0.0, sqrt(2.0) , 0.0, 0.0},
// {0.0, 0.0, 0.0, 0.0 , sqrt(2.0), 0.0}, {0.0, 0.0, 0.0, 0.0 , sqrt(2.0), 0.0},
// {0.0, 0.0, 0.0, 0.0 , 0.0, sqrt(2.0)} {0.0, 0.0, 0.0, 0.0 , 0.0, sqrt(2.0)}
// }; };
// FieldMatrix<double,6,6> D_inv = {{1.0, 0.0, 0.0, 0.0 , 0.0, 0.0}, FieldMatrix<double,6,6> D_inv = {{1.0, 0.0, 0.0, 0.0 , 0.0, 0.0},
// {0.0, 1.0, 0.0, 0.0 , 0.0, 0.0}, {0.0, 1.0, 0.0, 0.0 , 0.0, 0.0},
// {0.0, 0.0, 1.0, 0.0 , 0.0, 0.0}, {0.0, 0.0, 1.0, 0.0 , 0.0, 0.0},
// {0.0, 0.0, 0.0, 1.0/sqrt(2.0) , 0.0, 0.0}, {0.0, 0.0, 0.0, 1.0/sqrt(2.0) , 0.0, 0.0},
// {0.0, 0.0, 0.0, 0.0 , 1.0/sqrt(2.0), 0.0}, {0.0, 0.0, 0.0, 0.0 , 1.0/sqrt(2.0), 0.0},
// {0.0, 0.0, 0.0, 0.0 , 0.0, 1.0/sqrt(2.0)} {0.0, 0.0, 0.0, 0.0 , 0.0, 1.0/sqrt(2.0)}
// }; };
...@@ -238,12 +239,13 @@ public: ...@@ -238,12 +239,13 @@ public:
// { 0.0 ,0.0, 0.0, 0.0, 0.0, 2.0*mu[2]} // { 0.0 ,0.0, 0.0, 0.0, 0.0, 2.0*mu[2]}
// }; // };
// printmatrix(std::cout, D_, "D_", "--");
// printmatrix(std::cout, D_inv, "D_inv", "--");
// printmatrix(std::cout, L1_, "L1_", "--"); // printmatrix(std::cout, L1_, "L1_", "--");
// L1_.leftmultiply(D_inv); // L1_.leftmultiply(D_inv);
// printmatrix(std::cout, L1_, "L1_", "--"); // printmatrix(std::cout, L1_, "L1_.leftmultiply(D_inv)", "--");
// L1_.rightmultiply(D); // L1_.rightmultiply(D_);
// printmatrix(std::cout, L1_, "L1_", "--"); // printmatrix(std::cout, L1_, "L1_.rightmultiply(D_)", "--");
// Python::Module module = Python::import(materialFunctionName_); // Python::Module module = Python::import(materialFunctionName_);
...@@ -454,16 +456,6 @@ FieldMatrix<double,6,6> setupPhase(const std::string phaseType, Python::Module m ...@@ -454,16 +456,6 @@ FieldMatrix<double,6,6> setupPhase(const std::string phaseType, Python::Module m
// --- Helpers
static FieldVector<double,6> MatrixToVoigt(const MatrixRT& G)
{
return {G[0][0], G[1][1], G[2][2], G[1][2], G[0][2], G[0][1]};
}
static MatrixRT VoigtToMatrix(const FieldVector<double,6>& v)
{
return {{v[0], v[5], v[4]}, {v[5], v[1], v[3]}, {v[4], v[3], v[2]}};
}
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
...@@ -572,26 +564,39 @@ FieldMatrix<double,6,6> setupPhase(const std::string phaseType, Python::Module m ...@@ -572,26 +564,39 @@ FieldMatrix<double,6,6> setupPhase(const std::string phaseType, Python::Module m
// --- Definition of transversely isotropic elasticity tensor (in voigt notation) // --- Definition of transversely isotropic elasticity tensor (in voigt notation)
// - Input: (Youngs modulus, shear modulus, Poisson ratio): {E1,E2,G12,nu12,nu23} // - Input: (Youngs modulus, shear modulus, Poisson ratio): {E1,E2,G12,nu12,nu23}
// - Output: compliance Matrix // - Output: inverse compliance Matrix
FieldMatrix<double,6,6> general_anisotropic(const VectorRT& framevector1, FieldMatrix<double,6,6> general_anisotropic(const VectorRT& framevector1,
const VectorRT& framevector2, const VectorRT& framevector2,
const VectorRT& framevector3, const VectorRT& framevector3,
const FieldMatrix<double,6,6>& C //compliance matrix const FieldMatrix<double,6,6>& C //compliance matrix
) )
{ {
//--- return elasticity tensor //--- return elasticity tensor (in Voigt notation)
auto tmp = C; auto tmp = C;
tmp.invert(); tmp.invert();
// printmatrix(std::cout, C, "C after .invert()", "--"); // printmatrix(std::cout, C, "C after .invert()", "--");
return tmp; return tmp;
} }
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
// --- Helpers
static FieldVector<double,6> MatrixToVoigt(const MatrixRT& G)
{
// return {G[0][0], G[1][1], G[2][2], G[1][2], G[0][2], G[0][1]};
return {G[0][0], G[1][1], G[2][2], 2.0*G[1][2], 2.0*G[0][2], 2.0*G[0][1]};
}
static MatrixRT VoigtToMatrix(const FieldVector<double,6>& v)
{
// return {{v[0], v[5], v[4]}, {v[5], v[1], v[3]}, {v[4], v[3], v[2]}};
return {{v[0], v[5]/2.0, v[4]/2.0}, {v[5]/2.0, v[1], v[3]/2.0}, {v[4]/2.0, v[3]/2.0, v[2]}};
}
MatrixRT applyElasticityTensor(const MatrixRT& G, const int& phase) const MatrixRT applyElasticityTensor(const MatrixRT& G, const int& phase) const
{ {
// FieldVector<double,6> G_tmp = {G[0][0], G[1][1], G[2][2], sqrt(2.0)*G[1][2], sqrt(2.0)*G[0][2], sqrt(2.0)*G[0][1]}; // FieldVector<double,6> G_tmp = {G[0][0], G[1][1], G[2][2], sqrt(2.0)*G[1][2], sqrt(2.0)*G[0][2], sqrt(2.0)*G[0][1]};
// FieldVector<double,6> G_tmp = {G[0][0], G[1][1], G[2][2], G[1][2], G[0][2], G[0][1]}; // FieldVector<double,6> G_tmp = {G[0][0], G[1][1], G[2][2], G[1][2], G[0][2], G[0][1]};
......
...@@ -26,7 +26,7 @@ outputPath=/home/klaus/Desktop/Dune-Testing/dune-microstructure/outputs ...@@ -26,7 +26,7 @@ outputPath=/home/klaus/Desktop/Dune-Testing/dune-microstructure/outputs
## {start,finish} computes on all grid from 2^(start) to 2^finish refinement ## {start,finish} computes on all grid from 2^(start) to 2^finish refinement
#---------------------------------------------------- #----------------------------------------------------
numLevels= 2 2 # computes all levels from first to second entry numLevels= 2 3 # computes all levels from first to second entry
############################################# #############################################
...@@ -35,12 +35,12 @@ numLevels= 2 2 # computes all levels from first to second entry ...@@ -35,12 +35,12 @@ numLevels= 2 2 # computes all levels from first to second entry
# --- Choose material definition: # --- Choose material definition:
#materialFunction = "material_test" #materialFunction = "material_test"
#materialFunction = "material_neukamm" materialFunction = "material_neukamm"
#materialFunction = "two_phase_material_1" #materialFunction = "two_phase_material_1"
#materialFunction = "two_phase_material_2" #materialFunction = "two_phase_material_2"
#materialFunction = "two_phase_material_3" #materialFunction = "two_phase_material_3"
#materialFunction = "material_orthotropic" #materialFunction = "material_orthotropic"
materialFunction = "homogeneous" #materialFunction = "homogeneous"
# --- Choose scale ratio gamma: # --- Choose scale ratio gamma:
......
...@@ -28,7 +28,7 @@ def indicatorFunction(x): ...@@ -28,7 +28,7 @@ def indicatorFunction(x):
############### ###############
# Wood # Wood
############### ###############
# def f(x): # def indicatorFunction(x):
# theta=0.25 # theta=0.25
# if ((abs(x[0]) < theta/2) and x[2]<0.25): # if ((abs(x[0]) < theta/2) and x[2]<0.25):
# return 1 #latewood # return 1 #latewood
...@@ -43,7 +43,7 @@ def indicatorFunction(x): ...@@ -43,7 +43,7 @@ def indicatorFunction(x):
######################################################################### #########################################################################
## Notation - Parameter input : ## Notation - Parameter input :
# isotropic (Lame parameters) : [mu , lambda] # isotropic (Lame parameters) : [mu , lambda]
# orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # see https://en.wikipedia.org/wiki/Poisson%27s_ratio with x=1,y=2,z=3
# transversely_isotropic : [E1,E2,G12,nu12,nu23] # transversely_isotropic : [E1,E2,G12,nu12,nu23]
# general_anisotropic : full compliance matrix C # general_anisotropic : full compliance matrix C
###################################################################### ######################################################################
......
...@@ -24,7 +24,7 @@ def indicatorFunction(x): ...@@ -24,7 +24,7 @@ def indicatorFunction(x):
######################################################################### #########################################################################
## Notation - Parameter input : ## Notation - Parameter input :
# isotropic (Lame parameters) : [mu , lambda] # isotropic (Lame parameters) : [mu , lambda]
# orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # see https://en.wikipedia.org/wiki/Poisson%27s_ratio with x=1,y=2,z=3
# transversely_isotropic : [E1,E2,G12,nu12,nu23] # transversely_isotropic : [E1,E2,G12,nu12,nu23]
# general_anisotropic : full compliance matrix C # general_anisotropic : full compliance matrix C
###################################################################### ######################################################################
......
...@@ -16,7 +16,7 @@ def indicatorFunction(x): ...@@ -16,7 +16,7 @@ def indicatorFunction(x):
elif (x[1]<-0.5+theta and x[2]>0.5-theta): elif (x[1]<-0.5+theta and x[2]>0.5-theta):
return 2 #Phase2 return 2 #Phase2
else : else :
return 0 #Phase3 return 3 #Phase3
########### Options for material phases: ################################# ########### Options for material phases: #################################
...@@ -24,7 +24,7 @@ def indicatorFunction(x): ...@@ -24,7 +24,7 @@ def indicatorFunction(x):
######################################################################### #########################################################################
## Notation - Parameter input : ## Notation - Parameter input :
# isotropic (Lame parameters) : [mu , lambda] # isotropic (Lame parameters) : [mu , lambda]
# orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # orthotropic : [E1,E2,E3,G12,G23,G31,nu12,nu13,nu23] # see https://en.wikipedia.org/wiki/Poisson%27s_ratio with x=1,y=2,z=3
# transversely_isotropic : [E1,E2,G12,nu12,nu23] # transversely_isotropic : [E1,E2,G12,nu12,nu23]
# general_anisotropic : full compliance matrix C # general_anisotropic : full compliance matrix C
###################################################################### ######################################################################
...@@ -36,32 +36,40 @@ Phases=3 ...@@ -36,32 +36,40 @@ Phases=3
#--- Define different material phases: #--- Define different material phases:
#- PHASE 1 #- PHASE 1
phase1_type="isotropic" # phase1_type="isotropic"
materialParameters_phase1 = [80, 80] # materialParameters_phase1 = [80, 80]
# phase1_type="orthotropic" # phase1_type="orthotropic"
# materialParameters_phase1 = [11.2e3,630,1190,700,230,960,0.63 ,0.49,0.37] # walnut parameters (values for compliance matrix) # materialParameters_phase1 = [11.2e3,630,1190,700,230,960,0.63 ,0.49,0.37] # walnut parameters (values for compliance matrix)
# # materialParameters_phase1 = [10.7e3,430,710,620,23,500, 0.51 ,0.38,0.31] # Norway spruce parameters (values for compliance matrix) # # materialParameters_phase1 = [10.7e3,430,710,620,23,500, 0.51 ,0.38,0.31] # Norway spruce parameters (values for compliance matrix)
phase1_type="general_anisotropic"
materialParameters_phase1 = np.array([[1.0, 8.0, 16.0, 16.0 , 8.0, 8.0],
[8.0, 1.0, 16.0, 16.0 , 8.0, 8.0],
[8.0, 8.0, 1.0, 16.0 , 8.0, 8.0],
[8.0, 8.0, 16.0, math.sqrt(2), 8.0, 8.0],
[8.0, 8.0, 16.0, 16.0 , 8.0, 8.0],
[8.0, 8.0, 16.0, 16.0 , 8.0, 1.0]])
#- PHASE 2 #- PHASE 2
# phase2_type="transversely_isotropic" phase2_type="transversely_isotropic"
# materialParameters_phase2 = [11.2e3,1190,960,0.63 ,0.37] materialParameters_phase2 = [11.2e3,1190,960,0.63 ,0.37]
phase2_type="isotropic" # phase2_type="isotropic"
materialParameters_phase2 = [80, 80] # materialParameters_phase2 = [80, 80]
#- PHASE 3 #- PHASE 3
phase3_type="isotropic" # phase3_type="isotropic"
materialParameters_phase3 = [60, 25] # materialParameters_phase3 = [60, 25]
#--- for general anisotopic material the compliance matrix is required: #--- for general anisotopic material the compliance matrix is required:
# phase3_type="general_anisotropic" phase3_type="general_anisotropic"
# materialParameters_phase3 = np.array([[1.0, 0.0, 0.0, 0.0 , 0.0, 0.0], materialParameters_phase3 = np.array([[1.0, 0.0, 0.0, 0.0 , 0.0, 0.0],
# [0.0, 1.0, 0.0, 0.0 , 0.0, 0.0], [0.0, 1.0, 0.0, 0.0 , 0.0, 0.0],
# [0.0, 0.0, 1.0, 0.0 , 0.0, 0.0], [0.0, 0.0, 1.0, 0.0 , 0.0, 0.0],
# [0.0, 0.0, 0.0, math.sqrt(2), 0.0, 0.0], [0.0, 0.0, 0.0, math.sqrt(2), 0.0, 0.0],
# [0.0, 0.0, 0.0, 0.0 , 1.0, 0.0], [0.0, 0.0, 0.0, 0.0 , 1.0, 0.0],
# [0.0, 0.0, 0.0, 0.0 , 0.0, 1.0]]) [0.0, 0.0, 0.0, 0.0 , 0.0, 1.0]])
#--- define prestrain function for each phase #--- define prestrain function for each phase
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment