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

Method getCells

SRC/material/section/repres/patch/QuadPatch.cpp:160–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160Cell **
161QuadPatch::getCells (void) const
162{
163 double deltaXi;
164 double deltaEta;
165 Matrix cellVertCoord(4,2);
166 Vector N(4);
167 double xi, eta;
168 int i, j, k, r, s;
169 int numCells;
170 Cell **cells;
171
172 if (nDivIJ > 0 && nDivJK > 0)
173 {
174 numCells = this->getNumCells();
175
176 cells = new Cell* [numCells];
177
178 if (!cells)
179 return 0;
180
181 deltaXi = 2.0 / nDivIJ;
182 deltaEta = 2.0 / nDivJK;
183
184 k = 0;
185 for (j = 0; j < nDivJK; j++)
186 for (i = 0; i < nDivIJ; i++)
187 {
188 // compute natural coordinates
189
190 cellVertCoord(0,0) = -1.0 + deltaXi * i;
191 cellVertCoord(0,1) = -1.0 + deltaEta * j;
192 cellVertCoord(1,0) = -1.0 + deltaXi * (i+1);
193 cellVertCoord(1,1) = cellVertCoord(0,1);
194 cellVertCoord(2,0) = cellVertCoord(1,0);
195 cellVertCoord(2,1) = -1.0 + deltaEta * (j+1);
196 cellVertCoord(3,0) = cellVertCoord(0,0);
197 cellVertCoord(3,1) = cellVertCoord(2,1);
198
199 // map to cartesian coordinates using bilinear
200 // shape functions
201
202 for (r = 0; r < 4; r++)
203 {
204 xi = cellVertCoord(r,0);
205 eta = cellVertCoord(r,1);
206
207 N(0) = (1.0 - xi)*(1.0 - eta)/4.0;
208 N(1) = (1.0 + xi)*(1.0 - eta)/4.0;
209 N(2) = (1.0 + xi)*(1.0 + eta)/4.0;
210 N(3) = (1.0 - xi)*(1.0 + eta)/4.0;
211
212 cellVertCoord(r,0) = 0.0;
213 cellVertCoord(r,1) = 0.0;
214
215 for (s = 0; s < 4; s++)
216 {
217 cellVertCoord(r,0) += N(s) * vertCoord(s,0);

Callers 6

OPS_PatchFunction · 0.45
ops_addPatchFunction · 0.45
buildSectionFunction · 0.45
buildSectionIntFunction · 0.45
buildSectionThermalFunction · 0.45
buildSectionAsymFunction · 0.45

Calls 1

getNumCellsMethod · 0.95

Tested by

no test coverage detected