← Back to team overview

yade-dev team mailing list archive

[svn] r1777 - in trunk: extra extra/usct gui/py

 

Author: eudoxos
Date: 2009-05-24 12:53:29 +0200 (Sun, 24 May 2009)
New Revision: 1777

Modified:
   trunk/extra/Brefcom.cpp
   trunk/extra/Brefcom.hpp
   trunk/extra/BrefcomTestGen.cpp
   trunk/extra/usct/UniaxialStrainControlledTest.cpp
   trunk/gui/py/PythonUI_rc.py
   trunk/gui/py/_eudoxos.cpp
Log:
Getting rid of the Brefcom name, classes renamed as follows (moving files around  will follow)

BrefcomMakeContact             Ip2_CpmMat_CpmMat_CpmPhys
BrefcomContact                 CpmPhys
BrefcomPhysParams              CpmMat
ef2_Spheres_Brefcom_BrefcomLaw Law2_Dem3DofGeom_CpmPhys_Cpm
GLDrawBrefcomContact           GLDrawCpmPhys
BrefcomDamageColorizer         CpmPhysDamageColorizer
BrefcomGlobalCharacteristics   CpmGlobalCharacteristics



Modified: trunk/extra/Brefcom.cpp
===================================================================
--- trunk/extra/Brefcom.cpp	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/extra/Brefcom.cpp	2009-05-24 10:53:29 UTC (rev 1777)
@@ -7,20 +7,18 @@
 #include<yade/lib-opengl/GLUtils.hpp>
 #include<yade/pkg-dem/DemXDofGeom.hpp>
 
+YADE_PLUGIN("Ip2_CpmMat_CpmMat_CpmPhys","CpmPhys","GLDrawCpmPhys","CpmPhysDamageColorizer", "CpmMat", "CpmGlobalCharacteristics", "Law2_Dem3DofGeom_CpmPhys_Cpm");
 
+CREATE_LOGGER(CpmGlobalCharacteristics);
 
-YADE_PLUGIN("BrefcomMakeContact","BrefcomContact"/*,"BrefcomLaw"*/,"GLDrawBrefcomContact","BrefcomDamageColorizer", "BrefcomPhysParams", "BrefcomGlobalCharacteristics", "ef2_Spheres_Brefcom_BrefcomLaw" /* ,"BrefcomStiffnessComputer"*/ );
-
-CREATE_LOGGER(BrefcomGlobalCharacteristics);
-
-void BrefcomGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
+void CpmGlobalCharacteristics::compute(MetaBody* rb, bool useMaxForce){
 	rb->bex.sync();
 
 	// 1. reset volumetric strain (cummulative in the next loop)
 	// 2. get maximum force on a body and sum of all forces (for averaging)
 	Real sumF=0,maxF=0,currF;
 	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-	BrefcomPhysParams* bpp(YADE_CAST<BrefcomPhysParams*>(b->physicalParameters.get()));
+	CpmMat* bpp(YADE_CAST<CpmMat*>(b->physicalParameters.get()));
 		bpp->epsVolumetric=0;
 		bpp->numContacts=0;
 		currF=rb->bex.getForce(b->id).Length(); maxF=max(currF,maxF); sumF+=currF;
@@ -32,10 +30,10 @@
 	Real maxContactF=0;
 	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
 		if(!I->isReal) continue;
-		shared_ptr<BrefcomContact> BC=YADE_PTR_CAST<BrefcomContact>(I->interactionPhysics); assert(BC);
+		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
 		maxContactF=max(maxContactF,max(BC->Fn,BC->Fs.Length()));
-		BrefcomPhysParams* bpp1(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId1())->physicalParameters.get()));
-		BrefcomPhysParams* bpp2(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId2())->physicalParameters.get()));
+		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
+		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
 		bpp1->epsVolumetric+=BC->epsN; bpp1->numContacts+=1;
 		bpp2->epsVolumetric+=BC->epsN; bpp2->numContacts+=1;
 	}
@@ -43,9 +41,9 @@
 
 	FOREACH(const shared_ptr<Interaction>& I, *rb->interactions){
 		if(!I->isReal) continue;
-		shared_ptr<BrefcomContact> BC=YADE_PTR_CAST<BrefcomContact>(I->interactionPhysics); assert(BC);
-		BrefcomPhysParams* bpp1(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId1())->physicalParameters.get()));
-		BrefcomPhysParams* bpp2(YADE_CAST<BrefcomPhysParams*>(Body::byId(I->getId2())->physicalParameters.get()));
+		shared_ptr<CpmPhys> BC=YADE_PTR_CAST<CpmPhys>(I->interactionPhysics); assert(BC);
+		CpmMat* bpp1(YADE_CAST<CpmMat*>(Body::byId(I->getId1())->physicalParameters.get()));
+		CpmMat* bpp2(YADE_CAST<CpmMat*>(Body::byId(I->getId2())->physicalParameters.get()));
 		Real epsVolAvg=.5*((3./bpp1->numContacts)*bpp1->epsVolumetric+(3./bpp2->numContacts)*bpp2->epsVolumetric);
 		BC->epsTrans=(epsVolAvg-BC->epsN)/2.;
 		//TRVAR5(I->getId1(),I->getId2(),BC->epsTrans,(3./bpp1->numContacts)*bpp1->epsVolumetric,(3./bpp2->numContacts)*bpp2->epsVolumetric);
@@ -53,7 +51,7 @@
 	}
 	#if 0
 		FOREACH(const shared_ptr<Body>& b, *rb->bodies){
-			BrefcomPhysParams* bpp(YADE_PTR_CAST<BrefcomPhysParams>(b->physicalParameters.get()));
+			CpmMat* bpp(YADE_PTR_CAST<CpmMat>(b->physicalParameters.get()));
 			bpp->epsVolumeric*=3/bpp->numContacts;
 		}
 	#endif
@@ -62,11 +60,11 @@
 }
 
 
-/********************** BrefcomMakeContact ****************************/
-CREATE_LOGGER(BrefcomMakeContact);
+/********************** Ip2_CpmMat_CpmMat_CpmPhys ****************************/
+CREATE_LOGGER(Ip2_CpmMat_CpmMat_CpmPhys);
 
 
-void BrefcomMakeContact::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
+void Ip2_CpmMat_CpmMat_CpmPhys::go(const shared_ptr<PhysicalParameters>& pp1, const shared_ptr<PhysicalParameters>& pp2, const shared_ptr<Interaction>& interaction){
 	Dem3DofGeom* contGeom=YADE_CAST<Dem3DofGeom*>(interaction->interactionGeometry.get());
 
 	assert(contGeom); // for now, don't handle anything other than SpheresContactGeometry and Dem3DofGeom
@@ -87,7 +85,7 @@
 
 		if(!neverDamage) { assert(!isnan(sigmaT)); }
 
-		shared_ptr<BrefcomContact> contPhys(new BrefcomContact());
+		shared_ptr<CpmPhys> contPhys(new CpmPhys());
 
 		contPhys->E=E12;
 		contPhys->G=E12*G_over_E;
@@ -117,17 +115,17 @@
 
 
 
-/********************** BrefcomContact ****************************/
-CREATE_LOGGER(BrefcomContact);
+/********************** CpmPhys ****************************/
+CREATE_LOGGER(CpmPhys);
 
 // !! at least one virtual function in the .cpp file
-BrefcomContact::~BrefcomContact(){};
+CpmPhys::~CpmPhys(){};
 
-CREATE_LOGGER(ef2_Spheres_Brefcom_BrefcomLaw);
+CREATE_LOGGER(Law2_Dem3DofGeom_CpmPhys_Cpm);
 
-long BrefcomContact::cummBetaIter=0, BrefcomContact::cummBetaCount=0;
+long CpmPhys::cummBetaIter=0, CpmPhys::cummBetaCount=0;
 
-Real BrefcomContact::solveBeta(const Real c, const Real N){
+Real CpmPhys::solveBeta(const Real c, const Real N){
 	#ifdef YADE_DEBUG
 		cummBetaCount++;
 	#endif
@@ -145,10 +143,10 @@
 		ret-=f/df;
 	}
 	LOG_FATAL("No convergence after "<<maxIter<<" iters; c="<<c<<", N="<<N<<", ret="<<ret<<", f="<<f);
-	throw runtime_error("ef2_Spheres_Brefcom_BrefcomLaw::solveBeta failed to converge.");
+	throw runtime_error("Law2_Dem3DofGeom_CpmPhys_Cpm::solveBeta failed to converge.");
 }
 
-Real BrefcomContact::computeDmgOverstress(Real dt){
+Real CpmPhys::computeDmgOverstress(Real dt){
 	if(dmgStrain>=epsN*omega){ // unloading, no viscous stress
 		dmgStrain=epsN*omega;
 		LOG_TRACE("Elastic/unloading, no viscous overstress");
@@ -163,7 +161,7 @@
 	return (epsN*omega-dmgStrain)*E;
 }
 
-Real BrefcomContact::computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt){
+Real CpmPhys::computeViscoplScalingFactor(Real sigmaTNorm, Real sigmaTYield,Real dt){
 	if(sigmaTNorm<sigmaTYield) return 1.;
 	Real c=undamagedCohesion*pow(plTau/(G*dt),plRateExp)*pow(sigmaTNorm-sigmaTYield,plRateExp-1.);
 	Real beta=solveBeta(c,plRateExp);
@@ -171,16 +169,16 @@
 	return 1.-exp(beta)*(1-sigmaTYield/sigmaTNorm);
 }
 
-Real ef2_Spheres_Brefcom_BrefcomLaw::minStrain_moveBody2=1.; /* deactivated if > 0 */
-Real ef2_Spheres_Brefcom_BrefcomLaw::yieldLogSpeed=1.;
-Real ef2_Spheres_Brefcom_BrefcomLaw::yieldEllipseShift=0.;
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::minStrain_moveBody2=1.; /* deactivated if > 0 */
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed=1.;
+Real Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift=0.;
 
-void ef2_Spheres_Brefcom_BrefcomLaw::go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody){
+void Law2_Dem3DofGeom_CpmPhys_Cpm::go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody){
 	//timingDeltas->start();
 	Dem3DofGeom* contGeom=static_cast<Dem3DofGeom*>(_geom.get());
-	BrefcomContact* BC=static_cast<BrefcomContact*>(_phys.get());
+	CpmPhys* BC=static_cast<CpmPhys*>(_phys.get());
 
-	/* kept fully damaged contacts; note that normally the contact is deleted _after_ the BREFCOM_MATERIAL_MODEL,
+	/* kept fully damaged contacts; note that normally the contact is deleted _after_ the CPM_MATERIAL_MODEL,
 	 * i.e. if it is 1.0 here, omegaThreshold is >= 1.0 for sure.
 	 * &&'ing that just to make sure anyway ...
 	 */
@@ -190,8 +188,8 @@
 	Real& epsN(BC->epsN); Vector3r& epsT(BC->epsT); Real& kappaD(BC->kappaD); Real& epsPlSum(BC->epsPlSum); const Real& E(BC->E); const Real& undamagedCohesion(BC->undamagedCohesion); const Real& tanFrictionAngle(BC->tanFrictionAngle); const Real& G(BC->G); const Real& crossSection(BC->crossSection); const Real& omegaThreshold(BC->omegaThreshold); const Real& epsCrackOnset(BC->epsCrackOnset); Real& relResidualStrength(BC->relResidualStrength); const Real& dt=Omega::instance().getTimeStep();  const Real& epsFracture(BC->epsFracture); const bool& neverDamage(BC->neverDamage); const Real& dmgTau(BC->dmgTau); const Real& plTau(BC->plTau); const bool& isCohesive(BC->isCohesive);
 	/* const Real& transStrainCoeff(BC->transStrainCoeff); const Real& epsTrans(BC->epsTrans); const Real& xiShear(BC->xiShear); */
 	Real& omega(BC->omega); Real& sigmaN(BC->sigmaN);  Vector3r& sigmaT(BC->sigmaT); Real& Fn(BC->Fn); Vector3r& Fs(BC->Fs); // for python access
-	const Real& yieldLogSpeed(ef2_Spheres_Brefcom_BrefcomLaw::yieldLogSpeed); const int& yieldSurfType(ef2_Spheres_Brefcom_BrefcomLaw::yieldSurfType);
-	const Real& yieldEllipseShift(ef2_Spheres_Brefcom_BrefcomLaw::yieldEllipseShift); 
+	const Real& yieldLogSpeed(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed); const int& yieldSurfType(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType);
+	const Real& yieldEllipseShift(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift); 
 
 	#define YADE_VERIFY(condition) if(!(condition)){LOG_FATAL("Verification `"<<#condition<<"' failed!"); throw;}
 	
@@ -201,11 +199,13 @@
 	//timingDeltas->checkpoint("setup");
 	// if(contGeom->refR1<0) contGeom->refLength=contGeom->refR2; // make facet-sphere contact always at equilibrium when touching exactly (and not the initial distance)
 	epsN=contGeom->strainN(); epsT=contGeom->strainT();
-	if(isnan(epsN)){
-		LOG_FATAL("refLength="<<contGeom->refLength<<"; pos1="<<contGeom->se31.position<<"; pos2="<<contGeom->se32.position<<"; displacementN="<<contGeom->displacementN());
-		throw runtime_error("!! epsN==NaN !!");
-	}
-	NNAN(epsN); NNANV(epsT);
+	#ifdef YADE_DEBUG
+		if(isnan(epsN)){
+			LOG_FATAL("refLength="<<contGeom->refLength<<"; pos1="<<contGeom->se31.position<<"; pos2="<<contGeom->se32.position<<"; displacementN="<<contGeom->displacementN());
+			throw runtime_error("!! epsN==NaN !!");
+		}
+		NNAN(epsN); NNANV(epsT);
+	#endif
 	// already in SpheresContactGeometry:
 	// contGeom->relocateContactPoints(); // allow very large mutual rotations
 	if(logStrain && epsN<0){
@@ -217,17 +217,17 @@
 
 	epsN+=BC->isoPrestress/E;
 	//TRVAR1(epsN);
-	#ifdef BREFCOM_MATERIAL_MODEL
-		BREFCOM_MATERIAL_MODEL
+	#ifdef CPM_MATERIAL_MODEL
+		CPM_MATERIAL_MODEL
 	#else
 		sigmaN=E*epsN;
 		sigmaT=G*epsT;
 	#endif
 	sigmaN-=BC->isoPrestress;
-	if(contGeom->refR1<0 && ef2_Spheres_Brefcom_BrefcomLaw::minStrain_moveBody2<=0 && epsN<ef2_Spheres_Brefcom_BrefcomLaw::minStrain_moveBody2){
+	if(contGeom->refR1<0 && Law2_Dem3DofGeom_CpmPhys_Cpm::minStrain_moveBody2<=0 && epsN<Law2_Dem3DofGeom_CpmPhys_Cpm::minStrain_moveBody2){
 		/* move Body2 (the sphere) so that minStrain is satisfied */
-		rootBody->bex.addMove(I->getId2(),contGeom->normal*(ef2_Spheres_Brefcom_BrefcomLaw::minStrain_moveBody2-epsN)*contGeom->refLength);
-		LOG_TRACE("Moving by "<<contGeom->normal*(ef2_Spheres_Brefcom_BrefcomLaw::minStrain_moveBody2-epsN)*contGeom->refLength);
+		rootBody->bex.addMove(I->getId2(),contGeom->normal*(Law2_Dem3DofGeom_CpmPhys_Cpm::minStrain_moveBody2-epsN)*contGeom->refLength);
+		LOG_TRACE("Moving by "<<contGeom->normal*(Law2_Dem3DofGeom_CpmPhys_Cpm::minStrain_moveBody2-epsN)*contGeom->refLength);
 	}
 	NNAN(kappaD); NNAN(epsCrackOnset); NNAN(epsFracture); NNAN(omega);
 	NNAN(sigmaN); NNANV(sigmaT); NNAN(crossSection);
@@ -240,7 +240,7 @@
 		rootBody->interactions->requestErase(I->getId1(),I->getId2());
 		if(isCohesive){
 			const shared_ptr<Body>& body1=Body::byId(I->getId1(),rootBody), body2=Body::byId(I->getId2(),rootBody); assert(body1); assert(body2);
-			const shared_ptr<BrefcomPhysParams>& rbp1=YADE_PTR_CAST<BrefcomPhysParams>(body1->physicalParameters), rbp2=YADE_PTR_CAST<BrefcomPhysParams>(body2->physicalParameters);
+			const shared_ptr<CpmMat>& rbp1=YADE_PTR_CAST<CpmMat>(body1->physicalParameters), rbp2=YADE_PTR_CAST<CpmMat>(body2->physicalParameters);
 			if(BC->isCohesive){rbp1->numBrokenCohesive+=1; rbp2->numBrokenCohesive+=1; rbp1->epsPlBroken+=epsPlSum; rbp2->epsPlBroken+=epsPlSum;}
 			LOG_DEBUG("Contact #"<<I->getId1()<<"=#"<<I->getId2()<<" is damaged over thershold ("<<omega<<">"<<omegaThreshold<<") and will be deleted.");
 		}
@@ -255,24 +255,24 @@
 }
 
 
-/********************** GLDrawBrefcomContact ****************************/
+/********************** GLDrawCpmPhys ****************************/
 
 #include<yade/lib-opengl/OpenGLWrapper.hpp>
 
-CREATE_LOGGER(GLDrawBrefcomContact);
+CREATE_LOGGER(GLDrawCpmPhys);
 
-bool GLDrawBrefcomContact::contactLine=true;
-bool GLDrawBrefcomContact::dmgLabel=true;
-bool GLDrawBrefcomContact::dmgPlane=false;
-bool GLDrawBrefcomContact::epsNLabel=true;
-bool GLDrawBrefcomContact::epsT=false;
-bool GLDrawBrefcomContact::epsTAxes=false;
-bool GLDrawBrefcomContact::normal=false;
-bool GLDrawBrefcomContact::colorStrain=false;
+bool GLDrawCpmPhys::contactLine=true;
+bool GLDrawCpmPhys::dmgLabel=true;
+bool GLDrawCpmPhys::dmgPlane=false;
+bool GLDrawCpmPhys::epsNLabel=true;
+bool GLDrawCpmPhys::epsT=false;
+bool GLDrawCpmPhys::epsTAxes=false;
+bool GLDrawCpmPhys::normal=false;
+bool GLDrawCpmPhys::colorStrain=false;
 
 
-void GLDrawBrefcomContact::go(const shared_ptr<InteractionPhysics>& ip, const shared_ptr<Interaction>& i, const shared_ptr<Body>& b1, const shared_ptr<Body>& b2, bool wireFrame){
-	const shared_ptr<BrefcomContact>& BC=static_pointer_cast<BrefcomContact>(ip);
+void GLDrawCpmPhys::go(const shared_ptr<InteractionPhysics>& ip, const shared_ptr<Interaction>& i, const shared_ptr<Body>& b1, const shared_ptr<Body>& b2, bool wireFrame){
+	const shared_ptr<CpmPhys>& BC=static_pointer_cast<CpmPhys>(ip);
 	const shared_ptr<Dem3DofGeom>& geom=YADE_PTR_CAST<Dem3DofGeom>(i->interactionGeometry);
 
 	//Vector3r lineColor(BC->omega,1-BC->omega,0.0); /* damaged links red, undamaged green */
@@ -328,14 +328,14 @@
 
 struct BodyStats{ short nCohLinks; Real dmgSum; Real epsPlSum; BodyStats(): nCohLinks(0), dmgSum(0), epsPlSum(0.){} };
 
-/********************** BrefcomDamageColorizer ****************************/
-void BrefcomDamageColorizer::action(MetaBody* rootBody){
+/********************** CpmPhysDamageColorizer ****************************/
+void CpmPhysDamageColorizer::action(MetaBody* rootBody){
 	//vector<pair<short,Real> > bodyDamage; /* number of cohesive interactions per body; cummulative damage of interactions */
 	//vector<pair<short,
 	vector<BodyStats> bodyStats; bodyStats.resize(rootBody->bodies->size());
 	assert(bodyStats[0].nCohLinks==0); // should be initialized by dfault ctor
 	FOREACH(const shared_ptr<Interaction>& I, *rootBody->interactions){
-		shared_ptr<BrefcomContact> BC=dynamic_pointer_cast<BrefcomContact>(I->interactionPhysics);
+		shared_ptr<CpmPhys> BC=dynamic_pointer_cast<CpmPhys>(I->interactionPhysics);
 		if(!BC || !BC->isCohesive) continue;
 		const body_id_t id1=I->getId1(), id2=I->getId2();
 		bodyStats[id1].nCohLinks++; bodyStats[id1].dmgSum+=(1-BC->relResidualStrength); bodyStats[id1].epsPlSum+=BC->epsPlSum;
@@ -347,7 +347,7 @@
 	FOREACH(shared_ptr<Body> B, *rootBody->bodies){
 		body_id_t id=B->getId();
 		// add damaged contacts that have already been deleted
-		BrefcomPhysParams* bpp=dynamic_cast<BrefcomPhysParams*>(B->physicalParameters.get());
+		CpmMat* bpp=dynamic_cast<CpmMat*>(B->physicalParameters.get());
 		if(!bpp) continue;
 		short cohLinksWhenever=bodyStats[id].nCohLinks+bpp->numBrokenCohesive;
 		if(cohLinksWhenever>0){

Modified: trunk/extra/Brefcom.hpp
===================================================================
--- trunk/extra/Brefcom.hpp	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/extra/Brefcom.hpp	2009-05-24 10:53:29 UTC (rev 1777)
@@ -21,29 +21,29 @@
  *
  * May be extended in the future to compute global stiffness etc as well.
  */
-class BrefcomGlobalCharacteristics: public PeriodicEngine{
+class CpmGlobalCharacteristics: public PeriodicEngine{
 	public:
 		bool useMaxForce; // use maximum unbalanced force instead of mean unbalanced force
 		Real unbalancedForce;
 		void compute(MetaBody* rb, bool useMax=false);
 		virtual void action(MetaBody* rb){compute(rb,useMaxForce);}
-		BrefcomGlobalCharacteristics(){};
+		CpmGlobalCharacteristics(){};
 	REGISTER_ATTRIBUTES(PeriodicEngine,
 		(unbalancedForce)
 		(useMaxForce)
 	);
 	DECLARE_LOGGER;
-	REGISTER_CLASS_AND_BASE(BrefcomGlobalCharacteristics,PeriodicEngine);
+	REGISTER_CLASS_AND_BASE(CpmGlobalCharacteristics,PeriodicEngine);
 };
-REGISTER_SERIALIZABLE(BrefcomGlobalCharacteristics);
+REGISTER_SERIALIZABLE(CpmGlobalCharacteristics);
 
-/*! @brief representation of a single interaction of the brefcom type: storage for relevant parameters.
+/*! @brief representation of a single interaction of the CPM type: storage for relevant parameters.
  *
- * Evolution of the contact is governed by BrefcomLaw:
- * that includes damage effects and chages of parameters inside BrefcomContact.
+ * Evolution of the contact is governed by Law2_Dem3DofGeom_CpmPhys_Cpm:
+ * that includes damage effects and chages of parameters inside CpmPhys.
  *
  */
-class BrefcomContact: public NormalShearInteraction {
+class CpmPhys: public NormalShearInteraction {
 	private:
 	public:
 		/*! Fundamental parameters (constants) */
@@ -95,7 +95,7 @@
 		//! debugging, to see convergence rate
 		static long cummBetaIter, cummBetaCount;
 
-		/*! auxiliary variable for visualization, recalculated in BrefcomLaw at every iteration */
+		/*! auxiliary variable for visualization, recalculated in Law2_Dem3DofGeom_CpmPhys_Cpm at every iteration */
 		// FIXME: Fn and Fs are stored as Vector3r normalForce, shearForce in NormalShearInteraction 
 		Real omega, Fn, sigmaN, epsN, relResidualStrength; Vector3r epsT, sigmaT, Fs;
 
@@ -106,8 +106,8 @@
 
 
 
-		BrefcomContact(): NormalShearInteraction(),E(0), G(0), tanFrictionAngle(0), undamagedCohesion(0), crossSection(0), xiShear(0), dmgTau(-1), dmgRateExp(0), dmgStrain(0), plTau(-1), plRateExp(0), isoPrestress(0.), kappaD(0.), epsTrans(0.), epsPlSum(0.) { createIndex(); epsT=Vector3r::ZERO; isCohesive=false; neverDamage=false; omega=0; Fn=0; Fs=Vector3r::ZERO; epsPlSum=0; dmgOverstress=0; }
-		virtual ~BrefcomContact();
+		CpmPhys(): NormalShearInteraction(),E(0), G(0), tanFrictionAngle(0), undamagedCohesion(0), crossSection(0), xiShear(0), dmgTau(-1), dmgRateExp(0), dmgStrain(0), plTau(-1), plRateExp(0), isoPrestress(0.), kappaD(0.), epsTrans(0.), epsPlSum(0.) { createIndex(); epsT=Vector3r::ZERO; isCohesive=false; neverDamage=false; omega=0; Fn=0; Fs=Vector3r::ZERO; epsPlSum=0; dmgOverstress=0; }
+		virtual ~CpmPhys();
 
 		REGISTER_ATTRIBUTES(NormalShearInteraction,
 			(E)
@@ -147,13 +147,13 @@
 			(sigmaT)
 			(relResidualStrength)
 		);
-	REGISTER_CLASS_AND_BASE(BrefcomContact,NormalShearInteraction);
+	REGISTER_CLASS_AND_BASE(CpmPhys,NormalShearInteraction);
 	DECLARE_LOGGER;
 };
-REGISTER_SERIALIZABLE(BrefcomContact);
+REGISTER_SERIALIZABLE(CpmPhys);
 
 /* This class holds information associated with each body */
-class BrefcomPhysParams: public BodyMacroParameters {
+class CpmMat: public BodyMacroParameters {
 	public:
 		//! volumetric strain around this body
 		Real epsVolumetric;
@@ -167,13 +167,13 @@
 		Real epsPlBroken;
 		//! sum of plastic strains normalized by number of contacts
 		Real normEpsPl;
-		BrefcomPhysParams(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.), epsPlBroken(0.), normEpsPl(0.) {createIndex();};
+		CpmMat(): epsVolumetric(0.), numBrokenCohesive(0), numContacts(0), normDmg(0.), epsPlBroken(0.), normEpsPl(0.) {createIndex();};
 		REGISTER_ATTRIBUTES(BodyMacroParameters, (epsVolumetric) (numBrokenCohesive) (numContacts) (normDmg) (epsPlBroken) (normEpsPl));
-		REGISTER_CLASS_AND_BASE(BrefcomPhysParams,BodyMacroParameters);
+		REGISTER_CLASS_AND_BASE(CpmMat,BodyMacroParameters);
 };
-REGISTER_SERIALIZABLE(BrefcomPhysParams);
+REGISTER_SERIALIZABLE(CpmMat);
 
-class ef2_Spheres_Brefcom_BrefcomLaw: public ConstitutiveLaw{
+class Law2_Dem3DofGeom_CpmPhys_Cpm: public ConstitutiveLaw{
 	public:
 	/*! Damage evolution law */
 	static Real funcG(const Real& kappaD, const Real& epsCrackOnset, const Real& epsFracture, const bool& neverDamage) {
@@ -188,43 +188,19 @@
 		static Real yieldEllipseShift;
 		//! HACK: limit strain on some contacts by moving body #2 in the contact; only if refR1<0 (facet); deactivated if > 0
 		static Real minStrain_moveBody2;
-		ef2_Spheres_Brefcom_BrefcomLaw(): logStrain(false), yieldSurfType(0) { /*timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas);*/ }
+		Law2_Dem3DofGeom_CpmPhys_Cpm(): logStrain(false), yieldSurfType(0) { /*timingDeltas=shared_ptr<TimingDeltas>(new TimingDeltas);*/ }
 		void go(shared_ptr<InteractionGeometry>& _geom, shared_ptr<InteractionPhysics>& _phys, Interaction* I, MetaBody* rootBody);
-	FUNCTOR2D(Dem3DofGeom,BrefcomContact);
-	REGISTER_CLASS_AND_BASE(ef2_Spheres_Brefcom_BrefcomLaw,ConstitutiveLaw);
+	FUNCTOR2D(Dem3DofGeom,CpmPhys);
+	REGISTER_CLASS_AND_BASE(Law2_Dem3DofGeom_CpmPhys_Cpm,ConstitutiveLaw);
 	REGISTER_ATTRIBUTES(ConstitutiveLaw,(logStrain)(yieldSurfType)(yieldLogSpeed)(yieldEllipseShift)(minStrain_moveBody2));
 	DECLARE_LOGGER;
 };
-REGISTER_SERIALIZABLE(ef2_Spheres_Brefcom_BrefcomLaw);
+REGISTER_SERIALIZABLE(Law2_Dem3DofGeom_CpmPhys_Cpm);
 
-// obsolete
-#if 0
-class BrefcomLaw: public InteractionSolver{
-	private:
-		shared_ptr<ef2_Spheres_Brefcom_BrefcomLaw> functor;
-		shared_ptr<BrefcomContact> BC;
-		shared_ptr<SpheresContactGeometry> contGeom;
-		MetaBody* rootBody;
-		//! aplly calculated force on both particles (applied in the inverse sense on B)
-		void applyForce(const Vector3r&, const body_id_t&, const body_id_t&);
-		/*! Damage evolution law */
-		Real funcG(const Real& kappaD, const Real& epsCrackOnset, const Real& epsFracture, const bool& neverDamage) const{ return ef2_Spheres_Brefcom_BrefcomLaw::funcG(kappaD,epsCrackOnset,epsFracture,neverDamage); }
-		
-	public:
-		bool logStrain;
-		BrefcomLaw(): logStrain(false) { };
-		void action(MetaBody*);
-	protected: 
-	REGISTER_CLASS_AND_BASE(BrefcomLaw,InteractionSolver);
-	REGISTER_ATTRIBUTES(InteractionSolver,(logStrain));
-	DECLARE_LOGGER;
-};
-REGISTER_SERIALIZABLE(BrefcomLaw);
-#endif 
-/*! @brief Convert macroscopic properties to BrefcomContact with corresponding parameters.
+/*! @brief Convert macroscopic properties to CpmPhys with corresponding parameters.
  *
  * */
-class BrefcomMakeContact: public InteractionPhysicsEngineUnit{
+class Ip2_CpmMat_CpmMat_CpmPhys: public InteractionPhysicsEngineUnit{
 	private:
 	public:
 		/* nonelastic material parameters */
@@ -237,10 +213,10 @@
 		Real sigmaT, epsCrackOnset, relDuctility, G_over_E, tau, expDmgRate, omegaThreshold, dmgTau, dmgRateExp, plTau, plRateExp, isoPrestress;
 		//! Should new contacts be cohesive? They will before this iter#, they will not be afterwards. If 0, they will never be. If negative, they will always be created as cohesive.
 		long cohesiveThresholdIter;
-		//! Create contacts that don't receive any damage (BrefcomContact::neverDamage=true); defaults to false
+		//! Create contacts that don't receive any damage (CpmPhys::neverDamage=true); defaults to false
 		bool neverDamage;
 
-		BrefcomMakeContact(){
+		Ip2_CpmMat_CpmMat_CpmPhys(){
 			// init to signaling_NaN to force crash if not initialized (better than unknowingly using garbage values)
 			sigmaT=epsCrackOnset=relDuctility=G_over_E=std::numeric_limits<Real>::signaling_NaN();
 			neverDamage=false;
@@ -266,31 +242,31 @@
 			(isoPrestress)
 		);
 
-		FUNCTOR2D(BrefcomPhysParams,BrefcomPhysParams);
-		REGISTER_CLASS_AND_BASE(BrefcomMakeContact,InteractionPhysicsEngineUnit);
+		FUNCTOR2D(CpmMat,CpmMat);
+		REGISTER_CLASS_AND_BASE(Ip2_CpmMat_CpmMat_CpmPhys,InteractionPhysicsEngineUnit);
 		DECLARE_LOGGER;
 };
-REGISTER_SERIALIZABLE(BrefcomMakeContact);
+REGISTER_SERIALIZABLE(Ip2_CpmMat_CpmMat_CpmPhys);
 
-class GLDrawBrefcomContact: public GLDrawInteractionPhysicsFunctor {
+class GLDrawCpmPhys: public GLDrawInteractionPhysicsFunctor {
 	public: virtual void go(const shared_ptr<InteractionPhysics>&,const shared_ptr<Interaction>&,const shared_ptr<Body>&,const shared_ptr<Body>&,bool wireFrame);
-	virtual ~GLDrawBrefcomContact() {};
+	virtual ~GLDrawCpmPhys() {};
 	REGISTER_ATTRIBUTES(/*no base*/,(contactLine)(dmgLabel)(dmgPlane)(epsT)(epsTAxes)(normal)(colorStrain)(epsNLabel));
-	RENDERS(BrefcomContact);
-	REGISTER_CLASS_AND_BASE(GLDrawBrefcomContact,GLDrawInteractionPhysicsFunctor);
+	RENDERS(CpmPhys);
+	REGISTER_CLASS_AND_BASE(GLDrawCpmPhys,GLDrawInteractionPhysicsFunctor);
 	DECLARE_LOGGER;
 	static bool contactLine,dmgLabel,dmgPlane,epsT,epsTAxes,normal,colorStrain,epsNLabel;
 };
-REGISTER_SERIALIZABLE(GLDrawBrefcomContact);
+REGISTER_SERIALIZABLE(GLDrawCpmPhys);
 
-class BrefcomDamageColorizer: public PeriodicEngine {
+class CpmPhysDamageColorizer: public PeriodicEngine {
 	public:
 		//! maximum damage over all contacts
 		Real maxOmega;
-		BrefcomDamageColorizer(){maxOmega=0; /* run at the very beginning */ initRun=true;}
+		CpmPhysDamageColorizer(){maxOmega=0; /* run at the very beginning */ initRun=true;}
 		virtual void action(MetaBody*);
 	REGISTER_ATTRIBUTES(PeriodicEngine,(maxOmega));
-	REGISTER_CLASS_AND_BASE(BrefcomDamageColorizer,PeriodicEngine);
+	REGISTER_CLASS_AND_BASE(CpmPhysDamageColorizer,PeriodicEngine);
 };
-REGISTER_SERIALIZABLE(BrefcomDamageColorizer);
+REGISTER_SERIALIZABLE(CpmPhysDamageColorizer);
 

Modified: trunk/extra/BrefcomTestGen.cpp
===================================================================
--- trunk/extra/BrefcomTestGen.cpp	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/extra/BrefcomTestGen.cpp	2009-05-24 10:53:29 UTC (rev 1777)
@@ -56,14 +56,14 @@
 	rootBody->engines.push_back(igeomDispatcher);
 
 	shared_ptr<InteractionPhysicsMetaEngine> iphysDispatcher(new InteractionPhysicsMetaEngine);
-		shared_ptr<BrefcomMakeContact> bmc(new BrefcomMakeContact);
+		shared_ptr<Ip2_CpmMat_CpmMat_CpmPhys> bmc(new Ip2_CpmMat_CpmMat_CpmPhys);
 		bmc->cohesiveThresholdIter=-1; bmc->G_over_E=1; bmc->sigmaT=3e9; bmc->neverDamage=true; bmc->epsCrackOnset=1e-4; bmc->relDuctility=5;
 		//bmc->calibratedEpsFracture=.5; /* arbitrary, but large enough */
 		iphysDispatcher->add(bmc);
 	rootBody->engines.push_back(iphysDispatcher);
 
 	shared_ptr<ConstitutiveLawDispatcher> clDisp(new ConstitutiveLawDispatcher);
-		clDisp->add(shared_ptr<ConstitutiveLaw>(new ef2_Spheres_Brefcom_BrefcomLaw));
+		clDisp->add(shared_ptr<ConstitutiveLaw>(new Law2_Dem3DofGeom_CpmPhys_Cpm));
 	rootBody->engines.push_back(clDisp);
 
 	shared_ptr<PhysicalActionApplier> applyActionDispatcher(new PhysicalActionApplier);
@@ -79,7 +79,7 @@
 	orientationIntegrator->add(new LeapFrogOrientationIntegrator);
 	rootBody->engines.push_back(orientationIntegrator);
 
-	shared_ptr<BrefcomDamageColorizer> dmg(new BrefcomDamageColorizer);
+	shared_ptr<CpmPhysDamageColorizer> dmg(new CpmPhysDamageColorizer);
 	rootBody->engines.push_back(dmg);
 
 #if 0

Modified: trunk/extra/usct/UniaxialStrainControlledTest.cpp
===================================================================
--- trunk/extra/usct/UniaxialStrainControlledTest.cpp	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/extra/usct/UniaxialStrainControlledTest.cpp	2009-05-24 10:53:29 UTC (rev 1777)
@@ -198,9 +198,9 @@
 		Real r=I->second;
 		shared_ptr<Body> S=Shop::sphere(C,r);
 
-		// replace BodyMacroParameters by BrefcomPhysParams
+		// replace BodyMacroParameters by CpmMat
 		shared_ptr<BodyMacroParameters> bmp=YADE_PTR_CAST<BodyMacroParameters>(S->physicalParameters);
-		shared_ptr<BrefcomPhysParams> bpp(new BrefcomPhysParams);
+		shared_ptr<CpmMat> bpp(new CpmMat);
 		#define _CP(attr) bpp->attr=bmp->attr;
 		_CP(acceleration); _CP(angularVelocity); _CP(blockedDOFs); _CP(frictionAngle); _CP(inertia); _CP(mass); _CP(poisson); _CP(refSe3); _CP(se3); _CP(young); _CP(velocity);
 		#undef _CP
@@ -278,14 +278,14 @@
 		rootBody->engines.push_back(igeomDispatcher);
 
 	shared_ptr<InteractionPhysicsMetaEngine> iphysDispatcher(new InteractionPhysicsMetaEngine);
-		shared_ptr<BrefcomMakeContact> bmc(new BrefcomMakeContact);
+		shared_ptr<Ip2_CpmMat_CpmMat_CpmPhys> bmc(new Ip2_CpmMat_CpmMat_CpmPhys);
 		bmc->cohesiveThresholdIter=cohesiveThresholdIter;
 		bmc->cohesiveThresholdIter=-1; bmc->G_over_E=1;bmc->sigmaT=3e9; bmc->neverDamage=true; bmc->epsCrackOnset=1e-4; bmc->relDuctility=5;
 		iphysDispatcher->add(bmc);
 	rootBody->engines.push_back(iphysDispatcher);
 
 	shared_ptr<ConstitutiveLawDispatcher> clDisp(new ConstitutiveLawDispatcher);
-		clDisp->add(shared_ptr<ConstitutiveLaw>(new ef2_Spheres_Brefcom_BrefcomLaw));
+		clDisp->add(shared_ptr<ConstitutiveLaw>(new Law2_Dem3DofGeom_CpmPhys_Cpm));
 	rootBody->engines.push_back(clDisp);
 
 
@@ -313,7 +313,7 @@
 		orientationIntegrator->add(new LeapFrogOrientationIntegrator);
 		rootBody->engines.push_back(orientationIntegrator);
 
-	rootBody->engines.push_back(shared_ptr<BrefcomDamageColorizer>(new BrefcomDamageColorizer));
+	rootBody->engines.push_back(shared_ptr<CpmPhysDamageColorizer>(new CpmPhysDamageColorizer));
 
 }
 

Modified: trunk/gui/py/PythonUI_rc.py
===================================================================
--- trunk/gui/py/PythonUI_rc.py	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/gui/py/PythonUI_rc.py	2009-05-24 10:53:29 UTC (rev 1777)
@@ -40,13 +40,22 @@
 ### end wrappers
 
 #### HANDLE RENAMED CLASSES ####
-renamed={'ef2_Spheres_Brefcom_BrefcomLaw':'ef2_Dem3Dof_Cpm_Cpm'}
+renamed={
+	'BrefcomMakeContact':'Ip2_CpmMat_CpmMat_CpmPhys',
+	'BrefcomContact':'CpmPhys',
+	'BrefcomPhysParams':'CpmMat',
+	'ef2_Spheres_Brefcom_BrefcomLaw':'Law2_Dem3DofGeom_CpmPhys_Cpm',
+	'GLDrawBrefcomContact':'GLDrawCpmPhys',
+	'BrefcomDamageColorizer':'CpmPhysDamageColorizer',
+	'BrefcomGlobalCharacteristics':'CpmGlobalCharacteristics'
+}
+
 for oldName in renamed:
 	class warnWrap:
 		def __init__(self,_old,_new): self.old,self.new=_old,_new
-		def __call__(self,*args):
+		def __call__(self,*args,**kw):
 			import warnings; warnings.warn("Class `%s' was renamed to `%s', update your code!"%(self.old,self.new),DeprecationWarning,stacklevel=2);
-			return _dd[self.new](*args)
+			return _dd[self.new](*args,**kw)
 	_dd[oldName]=warnWrap(oldName,renamed[oldName])
 
 

Modified: trunk/gui/py/_eudoxos.cpp
===================================================================
--- trunk/gui/py/_eudoxos.cpp	2009-05-24 10:34:22 UTC (rev 1776)
+++ trunk/gui/py/_eudoxos.cpp	2009-05-24 10:53:29 UTC (rev 1777)
@@ -14,7 +14,7 @@
 	Real E=0;
 	FOREACH(const shared_ptr<Interaction>&i, *rb->transientInteractions){
 		if(!i->interactionPhysics) continue;
-		shared_ptr<BrefcomContact> bc=dynamic_pointer_cast<BrefcomContact>(i->interactionPhysics); if(!bc) continue;
+		shared_ptr<CpmPhys> bc=dynamic_pointer_cast<CpmPhys>(i->interactionPhysics); if(!bc) continue;
 		const shared_ptr<Body>& b1=Body::byId(i->getId1(),rb), b2=Body::byId(i->getId2(),rb);
 		bool isIn1=isInBB(b1->physicalParameters->se3.position,bbMin,bbMax), isIn2=isInBB(b2->physicalParameters->se3.position,bbMin,bbMax);
 		if(!isIn1 && !isIn2) continue;
@@ -32,9 +32,9 @@
 }
 #endif
 
-/* yield surface for the brefcom concrete model; this is used only to make yield surface plot from python, for debugging */
+/* yield surface for the CPM model; this is used only to make yield surface plot from python, for debugging */
 Real yieldSigmaTMagnitude(Real sigmaN, int yieldSurfType=0){
-	#ifdef BREFCOM_YIELD_SIGMA_T_MAGNITUDE
+	#ifdef CPM_YIELD_SIGMA_T_MAGNITUDE
 		/* find first suitable interaction */
 		MetaBody* rootBody=Omega::instance().getRootBody().get();
 		shared_ptr<Interaction> I;
@@ -43,14 +43,14 @@
 		}
 		Real nan=std::numeric_limits<Real>::quiet_NaN();
 		if(!I->isReal) {LOG_ERROR("No real interaction found, returning NaN!"); return nan; }
-		BrefcomContact* BC=dynamic_cast<BrefcomContact*>(I->interactionPhysics.get());
-		if(!BC) {LOG_ERROR("Interaction physics is not BrefcomContact instance, returning NaN!"); return nan;}
+		CpmPhys* BC=dynamic_cast<CpmPhys*>(I->interactionPhysics.get());
+		if(!BC) {LOG_ERROR("Interaction physics is not CpmPhys instance, returning NaN!"); return nan;}
 		const Real &omega(BC->omega); const Real& undamagedCohesion(BC->undamagedCohesion); const Real& tanFrictionAngle(BC->tanFrictionAngle);
-		const Real& yieldLogSpeed(ef2_Spheres_Brefcom_BrefcomLaw::yieldLogSpeed); // const int& yieldSurfType(ef2_Spheres_Brefcom_BrefcomLaw::yieldSurfType);
-		const Real& yieldEllipseShift(ef2_Spheres_Brefcom_BrefcomLaw::yieldEllipseShift);
-		return BREFCOM_YIELD_SIGMA_T_MAGNITUDE(sigmaN);
+		const Real& yieldLogSpeed(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldLogSpeed); // const int& yieldSurfType(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldSurfType);
+		const Real& yieldEllipseShift(Law2_Dem3DofGeom_CpmPhys_Cpm::yieldEllipseShift);
+		return CPM_YIELD_SIGMA_T_MAGNITUDE(sigmaN);
 	#else
-		LOG_FATAL("Brefcom model not available in this build.");
+		LOG_FATAL("CPM model not available in this build.");
 		throw;
 	#endif
 }