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

Method doTriangulation

SRC/element/PFEMElement/PFEMMesher2D.cpp:847–907  ·  view source on GitHub ↗

linear elements

Source from the content-addressed store, hash-verified

845
846// linear elements
847int
848PFEMMesher2D::doTriangulation(int starteletag, double alpha, const ID& groups,
849 const ID& addgroups,Domain* theDomain,
850 double rho, double mu, double b1, double b2,
851 double thk, double kappa, int type, int& endele)
852{
853 if(theDomain == 0) {
854 opserr<<"WARNING: null domain";
855 opserr<<" -- PFEMMesher2D::doTriangulation\n";
856 return -1;
857 }
858
859 //Timer timer;
860 //timer.start();
861
862 // do triangulation
863 ID eles;
864 int res = 0;
865 res = doTriangulation(alpha,groups,addgroups,theDomain,eles);
866 if(res < 0) {
867 opserr<<"WARNING: failed to do triangulation --";
868 opserr<<"PFEMMesher2D::soTriangulation\n";
869 return res;
870 }
871
872 // add PFEM elements
873 int numeles = eles.Size()/3;
874 if(numeles == 0) return 0;
875 int etag = starteletag-1;
876 for(int i=0; i<numeles; i++) {
877 Element* theEle = 0;
878 if(type == 1) {
879 theEle = new PFEMElement2D(++etag, eles(3*i), eles(3*i+1), eles(3*i+2),rho, mu, b1, b2, thk);
880 } else if(type == 3) {
881 theEle = new PFEMElement2DCompressible(++etag, eles(3*i), eles(3*i+1), eles(3*i+2),rho, mu, b1, b2, thk, kappa);
882 } else if(type == 4) {
883 theEle = new PFEMElement2DBubble(++etag, eles(3*i), eles(3*i+1), eles(3*i+2),rho, mu, b1, b2, thk, kappa);
884 }
885
886 if(theEle == 0) {
887 opserr<<"WARNING: no enough memory -- ";
888 opserr<<" -- PFEMMesher2D::doTriangulation\n";
889 return -1;
890 }
891 if(theDomain->addElement(theEle) == false) {
892 opserr<<"WARNING: failed to add element to domain -- ";
893 opserr<<" -- PFEMMesher2D::doTriangulation\n";
894 delete theEle;
895 return -1;
896 }
897 }
898
899 // identify
900 identify(b2,theDomain);
901 //timer.pause();
902 //opserr<<"meshing :"<<timer.getCPU()<<"\n";
903
904 endele = etag;

Callers

nothing calls this directly

Calls 10

getCrdsMethod · 0.80
IDClass · 0.70
OPS_getNDMaterialFunction · 0.50
SizeMethod · 0.45
addElementMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getNodeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected