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

Function OPS_RectPatch

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

Source from the content-addressed store, hash-verified

60}
61
62void* OPS_RectPatch()
63{
64 if(OPS_GetNumRemainingInputArgs() < 7) {
65 opserr<<"insufficient arguments for RectPatch\n";
66 return 0;
67 }
68
69 // get idata
70 int numData = 3;
71 int idata[3];
72 if(OPS_GetIntInput(&numData,&idata[0]) < 0) return 0;
73
74 // get data
75 static Matrix vertexCoords(4,2);
76 double data[4];
77 numData = 4;
78 if(OPS_GetDoubleInput(&numData,&data[0]) < 0) return 0;
79 double dyOverdz = (data[2]-data[0])/(data[3]-data[1]);
80 if (dyOverdz < 0) {
81 // Swap coordinates so we get all positive areas
82 double tmp = data[1];
83 data[1] = data[3];
84 data[3] = tmp;
85 }
86 vertexCoords(0,0) = data[0];
87 vertexCoords(0,1) = data[1];
88 vertexCoords(1,0) = data[2];
89 vertexCoords(1,1) = data[1];
90 vertexCoords(2,0) = data[2];
91 vertexCoords(2,1) = data[3];
92 vertexCoords(3,0) = data[0];
93 vertexCoords(3,1) = data[3];
94
95 return new QuadPatch(idata[0],idata[1],idata[2],vertexCoords);
96}
97
98
99QuadPatch::QuadPatch():

Callers 2

OPS_PatchFunction · 0.85
ops_addPatchFunction · 0.85

Calls 3

OPS_GetIntInputFunction · 0.50
OPS_GetDoubleInputFunction · 0.50

Tested by

no test coverage detected