← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3767: remove postLoad function as not used, this fixes as well serialization problem in --test

 

------------------------------------------------------------
revno: 3767
committer: Klaus Thoeni <klaus.thoeni@xxxxxxxxx>
timestamp: Mon 2015-12-21 21:50:07 +1100
message:
  remove postLoad function as not used, this fixes as well serialization problem in --test
modified:
  pkg/common/Grid.cpp
  pkg/common/Grid.hpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/common/Grid.cpp'
--- pkg/common/Grid.cpp	2015-12-15 12:57:49 +0000
+++ pkg/common/Grid.cpp	2015-12-21 10:50:07 +0000
@@ -49,36 +49,7 @@
 
 PFacet::~PFacet(){}
 YADE_PLUGIN((PFacet));
-void PFacet::postLoad(PFacet&)
-{	
-	vector<Vector3r> vertices;
-	vertices.push_back(node1->state->pos);
-	vertices.push_back(node2->state->pos);
-	vertices.push_back(node3->state->pos);
-	
-	Vector3r center;
-	center=vertices[0]+((vertices[2]-vertices[0])*(vertices[1]-vertices[0]).norm()+(vertices[1]-vertices[0])*(vertices[2]-vertices[0]).norm())/((vertices[1]-vertices[0]).norm()+(vertices[2]-vertices[1]).norm()+(vertices[0]-vertices[2]).norm());
-	
-	vertices[0]=vertices[0]-center;
-	vertices[1]=vertices[1]-center;
-	vertices[2]=vertices[2]-center;
-	if(vertices.size()!=3){ throw runtime_error(("Facet must have exactly 3 vertices (not "+boost::lexical_cast<string>(vertices.size())+")").c_str()); }
-	if(isnan(vertices[0][0])) return;  // not initialized, nothing to do
-	Vector3r e[3] = {vertices[1]-vertices[0] ,vertices[2]-vertices[1] ,vertices[0]-vertices[2]};
-	#define CHECK_EDGE(i) if(e[i].squaredNorm()==0){LOG_FATAL("Facet has coincident vertices "<<i<<" ("<<vertices[i]<<") and "<<(i+1)%3<<" ("<<vertices[(i+1)%3]<<")!");}
-		CHECK_EDGE(0); CHECK_EDGE(1);CHECK_EDGE(2);
-	#undef CHECK_EDGE
-	normal = e[0].cross(e[1]);
-	area = .5*normal.norm();
-	normal /= 2*area;
-	for(int i=0; i<3; ++i){
-		ne[i]=e[i].cross(normal); ne[i].normalize();
-		vl[i]=vertices[i].norm();
-		vu[i]=vertices[i]/vl[i];
-	}
-	Real p = e[0].norm()+e[1].norm()+e[2].norm();
-	icr = e[0].norm()*ne[0].dot(e[2])/p;
-}
+
 
 //!##################	IGeom Functors   #####################
 

=== modified file 'pkg/common/Grid.hpp'
--- pkg/common/Grid.hpp	2015-12-15 12:57:49 +0000
+++ pkg/common/Grid.hpp	2015-12-21 10:50:07 +0000
@@ -83,11 +83,10 @@
 	Vector3r ne[3];
 	/// Inscribing cirle radius
 	Real icr;
-      /// Length of the vertice vectors 
+	/// Length of the vertice vectors 
 	Real vl[3];
 	/// Unit vertice vectors
 	Vector3r vu[3];
-	void postLoad(PFacet&);
 
 	YADE_CLASS_BASE_DOC_ATTRS_CTOR(PFacet,Shape,"PFacet (particle facet) geometry.",
 		((shared_ptr<Body> , node1 , ,,"First :yref:`Body` the Pfacet is connected to."))
@@ -100,10 +99,6 @@
 		((Real,radius,-1,,"PFacet's radius"))
 		((Real,area,NaN,(Attr::readonly | Attr::noSave),"PFacet's area"))
 		((Vector3i , cellDist , Vector3i(0,0,0),,"missing doc :("))
-		#ifdef FACET_TOPO
-		((vector<Body::id_t>,edgeAdjIds,vector<Body::id_t>(3,Body::ID_NONE),,"PFacet id's that are adjacent to respective edges [experimental]"))
-		((vector<Real>,edgeAdjHalfAngle,vector<Real>(3,0),,"half angle between normals of this facet and the adjacent facet [experimental]"))
-		#endif
 		,
 		/* ctor */ createIndex();
 	);