| 783 | } |
| 784 | |
| 785 | void BackgroundMesh::clearGrid() { |
| 786 | Domain* domain = OPS_GetDomain(); |
| 787 | if (domain == 0) return; |
| 788 | |
| 789 | // remove cells |
| 790 | for (std::map<VInt, BNode>::iterator it = bnodes.begin(); |
| 791 | it != bnodes.end(); ++it) { |
| 792 | BNode& bnode = it->second; |
| 793 | const VInt& tags = bnode.getTags(); |
| 794 | int type = bnode.getType(); |
| 795 | |
| 796 | if (type == BACKGROUND_FLUID) { |
| 797 | for (int i = 0; i < (int)tags.size(); ++i) { |
| 798 | // remove node |
| 799 | Node* nd = domain->removeNode(tags[i]); |
| 800 | if (nd != 0) { |
| 801 | delete nd; |
| 802 | } |
| 803 | |
| 804 | // remove pc |
| 805 | Pressure_Constraint* pc = |
| 806 | domain->removePressure_Constraint(tags[i]); |
| 807 | if (pc != 0) { |
| 808 | delete pc; |
| 809 | } |
| 810 | } |
| 811 | } else if (type == BACKGROUND_FLUID_STRUCTURE) { |
| 812 | // remove node |
| 813 | Node* nd = domain->removeNode(tags[1]); |
| 814 | if (nd != 0) { |
| 815 | delete nd; |
| 816 | } |
| 817 | |
| 818 | // remove pc |
| 819 | Pressure_Constraint* pc = |
| 820 | domain->removePressure_Constraint(tags[1]); |
| 821 | if (pc != 0) { |
| 822 | delete pc; |
| 823 | } |
| 824 | } |
| 825 | } |
| 826 | for (auto& bcell : bcells) { |
| 827 | bcell.second.removeCenterNode(); |
| 828 | } |
| 829 | |
| 830 | bnodes.clear(); |
| 831 | bcells.clear(); |
| 832 | } |
| 833 | |
| 834 | bool BackgroundMesh::inEle(const VDouble& N) { |
| 835 | // out |
nothing calls this directly
no test coverage detected