← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3650: Fix some more compilation warnings.

 

------------------------------------------------------------
revno: 3650
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2015-05-04 18:59:30 +0200
message:
  Fix some more compilation warnings.
modified:
  pkg/dem/ConcretePM.hpp
  pkg/pfv/FlowEngine.hpp.in
  pkg/pfv/FlowEngine.ipp.in
  py/pack/_packPredicates.cpp


--
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/dem/ConcretePM.hpp'
--- pkg/dem/ConcretePM.hpp	2014-10-15 06:44:01 +0000
+++ pkg/dem/ConcretePM.hpp	2015-05-04 16:59:30 +0000
@@ -140,7 +140,7 @@
 		static long cummBetaIter, cummBetaCount;
 		/*! auxiliary variable for visualization, recalculated in Law2_ScGeom_CpmPhys_Cpm at every iteration */
 		// Fn and Fs are also stored as Vector3r normalForce, shearForce in NormShearPhys 
-		Real omega, Fn, sigmaN, epsN, relResidualStrength, kappaD, epsNPl;
+		Real omega = 0, Fn = 0, sigmaN, epsN = 0, relResidualStrength, kappaD = 0, epsNPl = 0;
 		Vector3r sigmaT, Fs, epsTPl, epsT;
 
 		static Real solveBeta(const Real c, const Real N);
@@ -181,7 +181,7 @@
 			((bool,isCohesive,false,,"if not cohesive, interaction is deleted when distance is greater than zero."))
 			, // ctors
 			createIndex();
-			Fn = omega = kappaD = epsN = kappaD = epsNPl = 0;
+			epsN = 0;
 			_ZERO_VECTOR3R(epsT); _ZERO_VECTOR3R(Fs); _ZERO_VECTOR3R(epsTPl);
 			,
 			.def_readonly("omega",&CpmPhys::omega,"Damage internal variable |yupdate|")

=== modified file 'pkg/pfv/FlowEngine.hpp.in'
--- pkg/pfv/FlowEngine.hpp.in	2015-02-27 17:05:27 +0000
+++ pkg/pfv/FlowEngine.hpp.in	2015-05-04 16:59:30 +0000
@@ -98,7 +98,7 @@
 
 		void imposeFlux(Vector3r pos, Real flux);
 		unsigned int imposePressure(Vector3r pos, Real p);
-		unsigned int imposePressureFromId(long id, Real p);
+		unsigned int imposePressureFromId(unsigned long id, Real p);
 		void setImposedPressure(unsigned int cond, Real p);
 		void clearImposedPressure();
 		void clearImposedFlux();
@@ -167,7 +167,7 @@
 		Real volumeCell (Cellhandle cell);
 		template<class Cellhandle>
 		Vector3r cellBarycenterFromHandle (Cellhandle cell) {return makeVector3r(solver->cellBarycenter(cell));}
-		Vector3r cellBarycenterFromId (long id) {
+		Vector3r cellBarycenterFromId (unsigned long id) {
 			if (id>=solver->T[solver->currentTes].cellHandles.size()) {LOG_ERROR("id out of range, max value is "<<solver->T[solver->currentTes].cellHandles.size()); return Vector3r(0,0,0);}
 			else return cellBarycenterFromHandle(solver->T[solver->currentTes].cellHandles[id]);}
 		void Oedometer_Boundary_Conditions();

=== modified file 'pkg/pfv/FlowEngine.ipp.in'
--- pkg/pfv/FlowEngine.ipp.in	2015-02-27 17:05:27 +0000
+++ pkg/pfv/FlowEngine.ipp.in	2015-05-04 16:59:30 +0000
@@ -31,9 +31,9 @@
 }
 
 template< class _CellInfo, class _VertexInfo, class _Tesselation, class solverT >
-unsigned int TemplateFlowEngine_@TEMPLATE_FLOW_NAME@<_CellInfo,_VertexInfo,_Tesselation,solverT>::imposePressureFromId(long id, Real p)
+unsigned int TemplateFlowEngine_@TEMPLATE_FLOW_NAME@<_CellInfo,_VertexInfo,_Tesselation,solverT>::imposePressureFromId(unsigned long id, Real p)
 {
-	imposePressure(cellBarycenterFromId(id),p);
+	return imposePressure(cellBarycenterFromId(id),p);
 }
 
 template< class _CellInfo, class _VertexInfo, class _Tesselation, class solverT >

=== modified file 'py/pack/_packPredicates.cpp'
--- py/pack/_packPredicates.cpp	2014-10-15 06:44:01 +0000
+++ py/pack/_packPredicates.cpp	2015-05-04 16:59:30 +0000
@@ -29,29 +29,11 @@
 		Vector3r dim() const { Vector3r mn,mx; ttuple2vvec(aabb(),mn,mx); return (mx-mn).eval(); }
 		Vector3r center() const { Vector3r mn,mx; ttuple2vvec(aabb(),mn,mx); return .5*(mn+mx); }
 };
-// make the pad parameter optional
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(PredicateCall_overloads,operator(),1,2);
-
-/* Since we want to make Predicate::operator() and Predicate::aabb() callable from c++ on py::object
-with the right virtual method resolution, we have to wrap the class in the following way. See 
-http://www.boost.org/doc/libs/1_38_0/libs/python/doc/tutorial/doc/html/python/exposing.html for documentation
-on exposing virtual methods.
-
-This makes it possible to derive a python class from Predicate, override its aabb() method, for instance,
-and use it in PredicateUnion, which will call the python implementation of aabb() as it should. This
-approach is used in the inGtsSurface class defined in pack.py.
-
-See scripts/test/gts-operators.py for an example.
-
-NOTE: you still have to call base class ctor in your class' ctor derived in python, e.g.
-super(inGtsSurface,self).__init__() so that virtual methods work as expected.
-*/
+
 struct PredicateWrap: Predicate, py::wrapper<Predicate>{
 	bool operator()(const Vector3r& pt, Real pad=0.) const { return this->get_override("__call__")(pt,pad);}
 	py::tuple aabb() const { return this->get_override("aabb")(); }
 };
-// make the pad parameter optional
-BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(PredicateWrapCall_overloads,operator(),1,2);
 
 /*********************************************************************************
 ****************** Boolean operations on predicates ******************************