Group { // Link with Physical groups in mesh file Omega = Region[1]; Gamma0 = Region[2]; } Function { // Physical parameters made available in the GUI DefineConstant[ order = {1, Choices{1="First order", 2="Second order"}, Name "Input/FE scheme"}, young = {150e9, Name "Input/0Young modulus [Pa]" }, poisson = {0.17, Name "Input/1Poisson coeficient" }, density = {4400, Name "Input/2Mass density", Label "Mass density [kg/m^3]" } ]; // Functions used in the weak formulations below E[] = young; nu[] = poisson; rho[] = density; a[] = E[]*(1.-nu[])/(1.+nu[])/(1.-2.*nu[]); b[] = E[]/2./(1.+nu[]); // = mu = G c[] = E[]*nu[]/(1.+nu[])/(1.-2.*nu[]); C_xx[] = Tensor[ a[],0 ,0 , 0 ,b[],0 , 0 ,0 ,b[] ]; C_xy[] = Tensor[ 0 ,c[],0 , b[],0 ,0 , 0 ,0 ,0 ]; C_xz[] = Tensor[ 0 ,0 ,c[], 0 ,0 ,0 , b[],0 ,0 ]; C_yx[] = Tensor[ 0 ,b[],0 , c[],0 ,0 , 0 ,0 ,0 ]; C_yy[] = Tensor[ b[],0 ,0 , 0 ,a[],0 , 0 ,0 ,b[] ]; C_yz[] = Tensor[ 0 ,0 ,0 , 0 ,0 ,c[], 0 ,b[],0 ]; C_zx[] = Tensor[ 0 ,0 ,b[], 0 ,0 ,0 , c[],0 ,0 ]; C_zy[] = Tensor[ 0 ,0 ,0 , 0 ,0 ,b[], 0 ,c[],0 ]; C_zz[] = Tensor[ b[],0 ,0 , 0 ,b[],0 , 0 ,0 ,a[] ]; } Constraint { // Dirichlet boundary conditions { Name Displacement_x ; Case { { Region Gamma0 ; Value 0. ; } } } { Name Displacement_y ; Case { { Region Gamma0 ; Value 0. ; } } } { Name Displacement_z ; Case { { Region Gamma0 ; Value 0. ; } } } } Integration { { Name GradGrad ; Case { { Type Gauss ; Case { { GeoElement Triangle ; NumberOfPoints 4 ; } { GeoElement Quadrangle ; NumberOfPoints 4 ; } { GeoElement Tetrahedron ; NumberOfPoints 4 ; } { GeoElement Hexahedron ; NumberOfPoints 6 ; } { GeoElement Prism ; NumberOfPoints 9 ; } } } } } } Jacobian { { Name Vol ; Case { { Region All ; Jacobian Vol ; } } } } FunctionSpace { { Name H_ux_Mec ; Type Form0 ; BasisFunction { { Name sxn ; NameOfCoef uxn ; Function BF_Node ; Support Omega ; Entity NodesOf[ All ] ; } If(order == 2) { Name sxn2 ; NameOfCoef uxn2 ; Function BF_Node_2E ; Support Omega ; Entity EdgesOf[ All ] ; } EndIf } Constraint { { NameOfCoef uxn ; EntityType NodesOf ; NameOfConstraint Displacement_x ; } If(order == 2) { NameOfCoef uxn2 ; EntityType EdgesOf ; NameOfConstraint Displacement_x ; } EndIf } } { Name H_uy_Mec ; Type Form0 ; BasisFunction { { Name syn ; NameOfCoef uyn ; Function BF_Node ; Support Omega ; Entity NodesOf[ All ] ; } If(order == 2) { Name syn2 ; NameOfCoef uyn2 ; Function BF_Node_2E ; Support Omega ; Entity EdgesOf[ All ] ; } EndIf } Constraint { { NameOfCoef uyn ; EntityType NodesOf ; NameOfConstraint Displacement_y ; } If(order == 2) { NameOfCoef uyn2 ; EntityType EdgesOf ; NameOfConstraint Displacement_y ; } EndIf } } { Name H_uz_Mec ; Type Form0 ; BasisFunction { { Name syn ; NameOfCoef uzn ; Function BF_Node ; Support Omega ; Entity NodesOf[ All ] ; } If(order == 2) { Name szn2 ; NameOfCoef uzn2 ; Function BF_Node_2E ; Support Omega ; Entity EdgesOf[ All ] ; } EndIf } Constraint { { NameOfCoef uzn ; EntityType NodesOf ; NameOfConstraint Displacement_z ; } If(order == 2) { NameOfCoef uzn2 ; EntityType EdgesOf ; NameOfConstraint Displacement_z ; } EndIf } } } Formulation { { Name Elasticity3D_u_modal ; Type FemEquation ; Quantity { { Name ux ; Type Local ; NameOfSpace H_ux_Mec ; } { Name uy ; Type Local ; NameOfSpace H_uy_Mec ; } { Name uz ; Type Local ; NameOfSpace H_uz_Mec ; } } Equation { Galerkin { [ C_xx[] * Dof{d ux}, {d ux} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_xy[] * Dof{d uy}, {d ux} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_xz[] * Dof{d uz}, {d ux} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_yx[] * Dof{d ux}, {d uy} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_yy[] * Dof{d uy}, {d uy} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_yz[] * Dof{d uz}, {d uy} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_zx[] * Dof{d ux}, {d uz} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_zy[] * Dof{d uy}, {d uz} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { [ C_zz[] * Dof{d uz}, {d uz} ] ; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { DtDtDof [ rho[] * Dof{ux} , {ux} ]; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { DtDtDof [ rho[] * Dof{uy} , {uy} ]; In Omega ; Jacobian Vol ; Integration GradGrad ; } Galerkin { DtDtDof [ rho[] * Dof{uz} , {uz} ]; In Omega ; Jacobian Vol ; Integration GradGrad ; } } } } PostProcessing { { Name Elasticity3D ; NameOfFormulation Elasticity3D_u_modal ; NameOfSystem Sys_Mec; PostQuantity { { Name u ; Value { Term { [ Vector[ {ux}, {uy}, {uz} ]]; In Omega ; Jacobian Vol ; } } } { Name um ; Value { Term { [ Norm[ Vector[ {ux}, {uy}, {uz} ] ] ] ; In Omega ; Jacobian Vol; } } } { Name ux ; Value { Term { [ {ux} ] ; In Omega ; Jacobian Vol; } } } { Name uy ; Value { Term { [ {uy} ] ; In Omega ; Jacobian Vol; } } } { Name uz ; Value { Term { [ {uz} ] ; In Omega ; Jacobian Vol; } } } { Name epsxx ; Value { Term { [ CompX [ {d ux} ] ] ; In Omega ; Jacobian Vol; } } } { Name epsyy ; Value { Term { [ CompY [ {d uy} ] ] ; In Omega ; Jacobian Vol; } } } { Name epszz ; Value { Term { [ CompZ [ {d uz} ] ] ; In Omega ; Jacobian Vol; } } } { Name epsxy ; Value { Term { [ CompX [ {d uy} ] + CompY [ {d ux} ] ] ; In Omega ; Jacobian Vol; } } } { Name epsyz ; Value { Term { [ CompY [ {d uz} ] + CompZ [ {d uy} ] ] ; In Omega ; Jacobian Vol; } } } { Name epszx ; Value { Term { [ CompZ [ {d ux} ] + CompX [ {d uz} ] ] ; In Omega ; Jacobian Vol; } } } } } } Resolution { { Name Analysis ; System { { Name Sys_Mec; NameOfFormulation Elasticity3D_u_modal; } } Operation { SetGlobalSolverOptions["-petsc_prealloc 400"]; GenerateSeparate[Sys_Mec]; EigenSolve[Sys_Mec, 10, (2*Pi*0)^2, 0]; SaveSolutions[Sys_Mec] ; PostOperation[Mec] ; } } } PostOperation { { Name Mec ; NameOfPostProcessing Elasticity3D; Operation { Print[ u, OnElementsOf Omega, File "displacement.pos"] ; //Print[ uz, OnElementsOf Omega, File "displacement_z.pos"] ; } } } DefineConstant[ R_ = {"Analysis", Name "GetDP/1ResolutionChoices", Visible 0}, C_ = {"-solve -slepc -bin -v2", Name "GetDP/9ComputeCommand", Visible 0}, P_ = {"", Name "GetDP/2PostOperationChoices", Visible 0} ];