Changeset 26658
- Timestamp:
- 11/23/21 07:13:52 (3 years ago)
- Location:
- issm/trunk-jpl/src/jl/solve
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/jl/solve/analyses/stressbalanceanalysis.jl
r26655 r26658 66 66 67 67 end #}}} 68 function CreateKMatrix(analysis::StressbalanceAnalysis,element::Tria)# {{{ 69 70 #Initialize Element matrix 71 Ke = ElementMatrix(element.nodes) 72 73 return Ke 74 end #}}} 68 75 function GetSolutionFromInputs(analysis::StressbalanceAnalysis,ug::Vector{Float64},element::Tria) #{{{ 69 76 -
issm/trunk-jpl/src/jl/solve/elementmatrix.jl
r26655 r26658 7 7 end #}}} 8 8 function ElementMatrix(nodes::Vector{Node})#{{{ 9 error("not implemented yet") 9 10 #Get matrix size 11 nrows = NumberOfDofs(nodes,GsetEnum) 12 13 #Initialize element matrix with zeros 14 values = zeros(nrows,nrows) 15 16 #Get dof lists 17 gglobaldoflist=GetGlobalDofList(nodes,nrows,GsetEnum) 18 fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum) 19 sglobaldoflist=GetGlobalDofList(nodes,nrows,SsetEnum) 20 21 return ElementMatrix(nrows,gglobaldoflist,fglobaldoflist,sglobaldoflist,values) 10 22 end#}}} 23 function Base.show(io::IO, this::ElementMatrix)# {{{ 24 25 println(io,"ElementMatrix:") 26 println(io," nrows: ",this.nrows) 27 println(io," gglobaldoflist: ",this.gglobaldoflist) 28 println(io," fglobaldoflist: ",this.fglobaldoflist) 29 println(io," sglobaldoflist: ",this.sglobaldoflist) 30 print(io," values: ") 31 display(this.values) 32 end# }}} 33 34 mutable struct ElementVector#{{{ 35 nrows::Int64 36 fglobaldoflist::Vector{Int64} 37 values::Vector{Float64} 38 end #}}} 39 function ElementVector(nodes::Vector{Node})#{{{ 40 41 #Get matrix size 42 nrows = NumberOfDofs(nodes,GsetEnum) 43 44 #Initialize element matrix with zeros 45 values = zeros(nrows,nrows) 46 47 #Get dof list 48 fglobaldoflist=GetGlobalDofList(nodes,nrows,FsetEnum) 49 50 return ElementVector(nrows,fglobaldoflist,values) 51 end#}}} 52 function Base.show(io::IO, this::ElementVector)# {{{ 53 54 println(io,"ElementVector:") 55 println(io," nrows: ",this.nrows) 56 println(io," gglobaldoflist: ",this.gglobaldoflist) 57 println(io," fglobaldoflist: ",this.fglobaldoflist) 58 println(io," sglobaldoflist: ",this.sglobaldoflist) 59 print(io," values: ") 60 display(this.values) 61 end# }}} -
issm/trunk-jpl/src/jl/solve/nodes.jl
r26652 r26658 95 95 elseif setenum==FsetEnum 96 96 for i=1:node.gsize 97 if node.fdoflist[i]!=-197 #if node.fdoflist[i]!=-1 98 98 count += 1 99 99 doflist[count] = node.fdoflist[i] 100 end100 #end 101 101 end 102 102 elseif setenum==SsetEnum 103 103 for i=1:node.gsize 104 if node.sdoflist[i]!=-1104 #if node.sdoflist[i]!=-1 105 105 count += 1 106 106 doflist[count] = node.sdoflist[i] 107 end107 #end 108 108 end 109 109 else … … 112 112 113 113 return count 114 115 end# }}} 116 function GetGlobalDofList(nodes::Vector{Node},ndofs::Int64,setenum::IssmEnum) #{{{ 117 118 #Allocate list 119 doflist = Vector{Int64}(undef,ndofs) 120 121 #Assign values 122 count = 0 123 for i in 1:length(nodes) 124 count = GetDofList(nodes[i],doflist,count,setenum) 125 end 126 println(count," ",ndofs) 127 @assert count==ndofs 128 129 return doflist 114 130 115 131 end# }}}
Note:
See TracChangeset
for help on using the changeset viewer.