Changeset 26659
- Timestamp:
- 11/23/21 12:28:22 (3 years ago)
- Location:
- issm/trunk-jpl/src/jl
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
r26658 r26659 68 68 function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{ 69 69 70 #Initialize Element matrix 70 #Internmediaries 71 numnodes = 3 72 73 #Initialize Element matrix and basis function derivatives 71 74 Ke = ElementMatrix(element.nodes) 75 dbasis = Matrix{Float64}(undef,numnodes,2) 76 77 #Retrieve all inputs and parameters 78 xyz_list = GetVerticesCoordinates(element.vertices) 79 vx_input = GetInput(element, VxEnum) 80 vy_input = GetInput(element, VyEnum) 81 H_input = GetInput(element, ThicknessEnum) 82 83 #Start integrating 84 gauss = GaussTria(2) 85 for i in 1:gauss.numgauss 86 87 Jdet = JacobianDeterminant(xyz_list, gauss) 88 89 println(Jdet) 90 91 error("STOP") 92 vx = GetInputValue(vx_input, gauss, i) 93 vy = GetInputValue(vy_input, gauss, i) 94 end 95 96 97 error("STOP") 72 98 73 99 return Ke -
issm/trunk-jpl/src/jl/solve/elements.jl
r26652 r26659 102 102 103 103 end # }}} 104 105 #Finite Element stuff 106 function JacobianDeterminant(xyz_list::Matrix{Float64}, gauss::GaussTria) #{{{ 107 108 #Get Jacobian Matrix 109 J = Jacobian(xyz_list) 110 111 #Get its determinant 112 Jdet = Matrix2x2Determinant(J) 113 114 #check and return 115 if(Jdet<0) error("negative Jacobian Determinant") end 116 return Jdet 117 118 end#}}} 119 function Jacobian(xyz_list::Matrix{Float64}) #{{{ 120 121 J = Matrix{Float64}(undef,2,2) 122 123 x1 = xyz_list[1,1] 124 y1 = xyz_list[1,2] 125 x2 = xyz_list[2,1] 126 y2 = xyz_list[2,2] 127 x3 = xyz_list[3,1] 128 y3 = xyz_list[3,2] 129 130 J[1,1] = .5*(x2-x1) 131 J[1,2] = sqrt(3)/6*(2*x3 -x1 -x2) 132 J[2,1] = .5*(y2-y1) 133 J[2,2] = sqrt(3)/6*(2*y3 -y1 -y2) 134 135 return J 136 end#}}} -
issm/trunk-jpl/src/jl/solve/gauss.jl
r26649 r26659 23 23 coords3 = [0.333333333333333] 24 24 elseif(order==2) 25 npoints = 3 25 26 weights = [0.577350269189625; 0.577350269189625; 0.577350269189625] 26 27 coords1 = [0.666666666666667; 0.166666666666667; 0.166666666666667] … … 28 29 coords3 = [0.166666666666667; 0.166666666666667; 0.666666666666667] 29 30 elseif(order==3) 30 npoints =431 npoints = 4 31 32 weights = [-0.974278579257493; 0.902109795608790; 0.902109795608790; 0.902109795608790] 32 33 coords1 = [ 0.333333333333333; 0.600000000000000; 0.200000000000000; 0.200000000000000] -
issm/trunk-jpl/src/jl/solve/modules.jl
r26655 r26659 69 69 count = 0 70 70 for i in 1:md.mesh.numberofvertices 71 push!(vertices,Vertex(i,x[i],y[i] ))71 push!(vertices,Vertex(i,x[i],y[i],0.)) 72 72 end 73 73 -
issm/trunk-jpl/src/jl/solve/nodes.jl
r26658 r26659 124 124 count = GetDofList(nodes[i],doflist,count,setenum) 125 125 end 126 println(count," ",ndofs)127 126 @assert count==ndofs 128 127 -
issm/trunk-jpl/src/jl/solve/solve.jl
r26655 r26659 14 14 include("./modules.jl") 15 15 include("./toolkits.jl") 16 include("./utils.jl") 16 17 include("./elementmatrix.jl") 17 18 -
issm/trunk-jpl/src/jl/solve/vertices.jl
r26629 r26659 4 4 x::Float64 5 5 y::Float64 6 z::Float64 6 7 end# }}} 8 9 #vertices functions 10 function GetVerticesCoordinates(vertices::Vector{Vertex}) #{{{ 11 12 #Intermediaries 13 nbv = length(vertices) 14 15 #Allocate 16 xyz_list = Matrix{Float64}(undef,nbv,3) 17 18 #Assign value to xyz_list 19 for i in 1:nbv 20 xyz_list[i,1]=vertices[i].x 21 xyz_list[i,2]=vertices[i].y 22 xyz_list[i,3]=vertices[i].z 23 end 24 25 return xyz_list 26 end #}}} -
issm/trunk-jpl/src/jl/test101.jl
r26634 r26659 6 6 #md = ISSM.triangle(md,"../../test/Exp/Square.exp",180000.) 7 7 md = ISSM.triangle(md,"../../test/Exp/Square.exp",250000.) 8 #md = ISSM.triangle(md,"../../test/Exp/Square.exp",1000.) 8 9 md = ISSM.setmask(md,"all","") 9 10
Note:
See TracChangeset
for help on using the changeset viewer.