MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / setMatIDs

Method setMatIDs

SRC/system_of_eqn/linearSOE/sparseGEN/PFEMGeneralLinSOE.cpp:59–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59int
60PFEMGeneralLinSOE::setMatIDs(Graph& theGraph, int Ssize, int Fsize,
61 int Isize, int Psize, int Pisize)
62{
63 // dimension
64 N = Ssize+Fsize+Isize+Psize+Pisize;
65 rowInd.clear();
66 colPtr.clear();
67 A.clear();
68
69 // dof type
70 const ID& dofType = this->getDofType();
71 newDofID = this->getDofID();
72 int index = 0;
73 for(int i=0; i<newDofID.Size(); i++) {
74 int type = dofType(i);
75 if(type < 0) continue;
76 newDofID(i) = index++;
77 // if(type == 2) newDofID(i) += Ssize;
78 // else if(type == 1) newDofID(i) += Ssize+Isize;
79 // else if(type == 3) newDofID(i) += Ssize+Isize+Fsize;
80 // else if(type == 4) newDofID(i) += Ssize+Isize+Fsize+Psize;
81 }
82
83 // first column
84 colPtr.push_back(0);
85
86 // for each column
87 Vertex* theVertex = 0;
88 for(int j=0; j<dofType.Size(); j++) {
89 theVertex = theGraph.getVertexPtr(j);
90 if(theVertex == 0) {
91 opserr<<"WARNING: vertex "<<j<<" not in graph -- PFEMGeneralLinSOE::setSize\n";
92 return -1;
93 }
94
95 // start and end index of current column
96 int start = colPtr.back();
97 int end = start;
98
99 // column number
100 int col = theVertex->getTag();
101
102 // column type
103 int coltype = dofType(col);
104 if(coltype < 0) {
105 continue;
106 }
107 int colid = newDofID(col);
108
109 // diagonal term
110 rowInd.push_back(colid);
111 end++;
112
113 // off diagonal terms
114 const ID& theAdjacency = theVertex->getAdjacency();
115 for(int i=0; i<theAdjacency.Size(); i++) {
116 int row = theAdjacency(i);

Callers

nothing calls this directly

Calls 8

push_backMethod · 0.80
clearMethod · 0.45
SizeMethod · 0.45
getVertexPtrMethod · 0.45
getTagMethod · 0.45
beginMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected