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

Method clearGrid

SRC/element/PFEMElement/BackgroundMesh.cpp:785–832  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785void 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
834bool BackgroundMesh::inEle(const VDouble& N) {
835 // out

Callers

nothing calls this directly

Calls 9

removeCenterNodeMethod · 0.80
OPS_GetDomainFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
getTypeMethod · 0.45
sizeMethod · 0.45
removeNodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected