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

Method gridFSInoDT

SRC/element/PFEMElement/BackgroundMesh.cpp:2057–2850  ·  view source on GitHub ↗

FSI without Delauney Triangulation

Source from the content-addressed store, hash-verified

2055
2056// FSI without Delauney Triangulation
2057int BackgroundMesh::gridFSInoDT() {
2058 Domain* domain = OPS_GetDomain();
2059 if (domain == 0) return 0;
2060 int ndm = OPS_GetNDM();
2061
2062 // store cells in a vector
2063 std::vector<BCell*> cells;
2064 for (auto& item : bcells) {
2065 auto& cell = item.second;
2066 if (cell.getType() == BACKGROUND_STRUCTURE) {
2067 cells.push_back(&cell);
2068 }
2069 }
2070
2071 // create elements in each cell
2072 int numele = 0;
2073 if (ndm == 2) {
2074 // numele = 2;
2075 numele = 4;
2076 } else if (ndm == 3) {
2077 // numele = 6;
2078 numele = 12;
2079 }
2080 VVInt elends(numele * cells.size());
2081 VInt gtags(numele * cells.size());
2082 VInt contact3Ddir(numele * cells.size(), -1);
2083 int ndtag = Mesh::nextNodeTag();
2084// #pragma omp parallel for
2085 for (int j = 0; j < (int)cells.size(); ++j) {
2086 // get indices
2087 auto& cindices = cells[j]->getIndices();
2088
2089 // get bnodes
2090 auto& cbnodes = cells[j]->getNodes();
2091
2092 // get types
2093 VInt types(cbnodes.size());
2094 for (int i = 0; i < (int)cbnodes.size(); ++i) {
2095 types[i] = cbnodes[i]->getType();
2096 }
2097
2098 // get fluid and structural local indices
2099 VInt flocal, slocal, fixlocal, fslocal;
2100 for (int i = 0; i < (int)types.size(); ++i) {
2101 int type = types[i];
2102 if (type == BACKGROUND_STRUCTURE) {
2103 slocal.push_back(i);
2104 } else if (type == BACKGROUND_FLUID_STRUCTURE) {
2105 fslocal.push_back(i);
2106 } else if (type == BACKGROUND_FLUID) {
2107 flocal.push_back(i);
2108 } else {
2109 fixlocal.push_back(i);
2110 }
2111 }
2112
2113 // FSI or SSI contact
2114 if ((ndm == 2 && slocal.size() + fslocal.size() == 4) ||

Callers

nothing calls this directly

Calls 15

OPS_getMeshFunction · 0.85
push_backMethod · 0.80
getNodesMethod · 0.80
getCrdsMethod · 0.80
emptyMethod · 0.80
getGroupTagMethod · 0.80
setCenterNodeMethod · 0.80
setEleNodesMethod · 0.80
newElementsMethod · 0.80
OPS_GetNDMFunction · 0.70
OPS_GetDomainFunction · 0.50
getTypeMethod · 0.45

Tested by

no test coverage detected