| 2850 | } |
| 2851 | |
| 2852 | int BackgroundMesh::gridFSI() { |
| 2853 | Domain* domain = OPS_GetDomain(); |
| 2854 | if (domain == 0) return 0; |
| 2855 | int ndm = OPS_GetNDM(); |
| 2856 | |
| 2857 | TriangleMeshGenerator gen; |
| 2858 | TetMeshGenerator tetgen; |
| 2859 | |
| 2860 | // gather bnodes |
| 2861 | std::map<VInt, BNode*> fsibnodes; |
| 2862 | for (std::map<VInt, BCell>::iterator it = bcells.begin(); |
| 2863 | it != bcells.end(); ++it) { |
| 2864 | // only for structural cells |
| 2865 | BCell& bcell = it->second; |
| 2866 | if (bcell.getType() == BACKGROUND_FLUID) continue; |
| 2867 | |
| 2868 | // get bnode |
| 2869 | auto& bnodes = bcell.getNodes(); |
| 2870 | auto& bindices = bcell.getIndices(); |
| 2871 | for (int j = 0; j < (int)bnodes.size(); ++j) { |
| 2872 | BNode* bnode = bnodes[j]; |
| 2873 | VInt bindex = bindices[j]; |
| 2874 | if (bnode == 0) { |
| 2875 | opserr << "WARNING: failed to get bnode -- gridFSI\n"; |
| 2876 | return -1; |
| 2877 | } |
| 2878 | fsibnodes[bindex] = bnode; |
| 2879 | } |
| 2880 | } |
| 2881 | |
| 2882 | // add points |
| 2883 | VInt ndtags, ndtypes, ndsids; |
| 2884 | VVInt ndindex; |
| 2885 | VDouble min, max; |
| 2886 | for (std::map<VInt, BNode*>::iterator it = fsibnodes.begin(); |
| 2887 | it != fsibnodes.end(); ++it) { |
| 2888 | VInt bindex = it->first; |
| 2889 | BNode* bnode = it->second; |
| 2890 | |
| 2891 | const VInt& tags = bnode->getTags(); |
| 2892 | const VVDouble& crdsn = bnode->getCrds(); |
| 2893 | int type = bnode->getType(); |
| 2894 | const VInt& sid = bnode->getSid(); |
| 2895 | |
| 2896 | for (int i = -1; i < (int)tags.size(); ++i) { |
| 2897 | // -1 is only for fixed bnode |
| 2898 | if (i == -1 && type != BACKGROUND_FIXED) { |
| 2899 | continue; |
| 2900 | } |
| 2901 | if (i == -1) { |
| 2902 | ndtags.push_back(0); |
| 2903 | ndsids.push_back(0); |
| 2904 | } else { |
| 2905 | ndtags.push_back(tags[i]); |
| 2906 | ndsids.push_back(sid[i]); |
| 2907 | } |
| 2908 | ndtypes.push_back(type); |
| 2909 | ndindex.push_back(bindex); |
nothing calls this directly
no test coverage detected