← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 4075: Move Ip2_*_CapillaryPhys. into CapillaryPhys.

 

------------------------------------------------------------
revno: 4075
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Mon 2014-07-14 22:08:34 +0200
message:
  Move Ip2_*_CapillaryPhys. into CapillaryPhys.
removed:
  pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.cpp
  pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.hpp
modified:
  pkg/dem/CapillaryPhys.cpp
  pkg/dem/CapillaryPhys.hpp
  pkg/dem/CapillaryTriaxialTest.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/CapillaryPhys.cpp'
--- pkg/dem/CapillaryPhys.cpp	2010-11-12 08:03:16 +0000
+++ pkg/dem/CapillaryPhys.cpp	2014-07-14 20:08:34 +0000
@@ -1,8 +1,39 @@
 #include <yade/pkg/dem/CapillaryPhys.hpp>
-
-CapillaryPhys::~CapillaryPhys()
+#include <yade/pkg/dem/ScGeom.hpp>
+
+YADE_PLUGIN((CapillaryPhys)(Ip2_FrictMat_FrictMat_CapillaryPhys));
+
+// The following code was moved from Ip2_FrictMat_FrictMat_CapillaryPhys.cpp
+
+void Ip2_FrictMat_FrictMat_CapillaryPhys::go( const shared_ptr<Material>& b1 //FrictMat
+					, const shared_ptr<Material>& b2 // FrictMat
+					, const shared_ptr<Interaction>& interaction)
 {
-}
-
-YADE_PLUGIN((CapillaryPhys));
-
+	ScGeom* geom = YADE_CAST<ScGeom*>(interaction->geom.get());
+	if(geom)
+	{
+		if(!interaction->phys)
+		{
+ 			const shared_ptr<FrictMat>& sdec1 = YADE_PTR_CAST<FrictMat>(b1);
+ 			const shared_ptr<FrictMat>& sdec2 = YADE_PTR_CAST<FrictMat>(b2);
+
+ 			if (!interaction->phys) interaction->phys = shared_ptr<CapillaryPhys>(new CapillaryPhys());
+			const shared_ptr<CapillaryPhys>& contactPhysics = YADE_PTR_CAST<CapillaryPhys>(interaction->phys);
+
+			Real Ea 	= sdec1->young;
+			Real Eb 	= sdec2->young;
+			Real Va 	= sdec1->poisson;
+			Real Vb 	= sdec2->poisson;
+			Real Da 	= geom->radius1; // FIXME - multiply by factor of sphere interaction distance (so sphere interacts at bigger range that its geometrical size)
+			Real Db 	= geom->radius2; // FIXME - as above
+			Real fa 	= sdec1->frictionAngle;
+			Real fb 	= sdec2->frictionAngle;
+			Real Kn = 2*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
+			Real Ks = 2*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Va);//harmonic average of two stiffnesses with ks=V*kn for each sphere
+
+			contactPhysics->tangensOfFrictionAngle = std::tan(std::min(fa,fb));
+			contactPhysics->kn = Kn;
+			contactPhysics->ks = Ks;
+		}
+	}
+};

=== modified file 'pkg/dem/CapillaryPhys.hpp'
--- pkg/dem/CapillaryPhys.hpp	2013-05-30 20:17:45 +0000
+++ pkg/dem/CapillaryPhys.hpp	2014-07-14 20:08:34 +0000
@@ -7,13 +7,15 @@
 *************************************************************************/
 #pragma once
 #include<yade/pkg/dem/FrictPhys.hpp>
+#include<yade/pkg/common/ElastMat.hpp>
+#include<yade/pkg/common/Dispatching.hpp>
 
 class CapillaryPhys : public FrictPhys
 {
 	public :
 		int currentIndexes [4]; // used for faster interpolation (stores previous positions in tables)
 		
-		virtual ~CapillaryPhys();
+		virtual ~CapillaryPhys() {};
 
 	YADE_CLASS_BASE_DOC_ATTRS_DEPREC_INIT_CTOR_PY(CapillaryPhys,FrictPhys,"Physics (of interaction) for Law2_ScGeom_CapillaryPhys_Capillarity.",
 				 ((bool,meniscus,false,,"Presence of a meniscus if true"))
@@ -36,5 +38,16 @@
 REGISTER_SERIALIZABLE(CapillaryPhys);
 
 
+class Ip2_FrictMat_FrictMat_CapillaryPhys : public IPhysFunctor
+{
+	public :
+		virtual void go(	const shared_ptr<Material>& b1,
+					const shared_ptr<Material>& b2,
+					const shared_ptr<Interaction>& interaction);
 
+	FUNCTOR2D(FrictMat,FrictMat);
+	YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ip2_FrictMat_FrictMat_CapillaryPhys,IPhysFunctor, "RelationShips to use with Law2_ScGeom_CapillaryPhys_Capillarity\n\n In these RelationShips all the interaction attributes are computed. \n\n.. warning::\n\tas in the others :yref:`Ip2 functors<IPhysFunctor>`, most of the attributes are computed only once, when the interaction is new.",,;);
+	
+};
+REGISTER_SERIALIZABLE(Ip2_FrictMat_FrictMat_CapillaryPhys);
 

=== modified file 'pkg/dem/CapillaryTriaxialTest.cpp'
--- pkg/dem/CapillaryTriaxialTest.cpp	2014-07-03 17:20:40 +0000
+++ pkg/dem/CapillaryTriaxialTest.cpp	2014-07-14 20:08:34 +0000
@@ -12,7 +12,7 @@
 #include<yade/pkg/dem/ElasticContactLaw.hpp>
 #include <yade/pkg/dem/Law2_ScGeom_CapillaryPhys_Capillarity.hpp>
 // #include<yade/pkg/dem/Ip2_FrictMat_FrictMat_FrictPhys.hpp>
-#include<yade/pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.hpp>
+#include<yade/pkg/dem/CapillaryPhys.hpp>
 #include<yade/pkg/common/ElastMat.hpp>
 #include<yade/pkg/dem/GlobalStiffnessTimeStepper.hpp>
 

=== removed file 'pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.cpp'
--- pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.cpp	2010-12-31 14:35:21 +0000
+++ pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.cpp	1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno CHAREYRE                                 *
-*  bruno.chareyre@xxxxxxxxxxx                                        *
-*                                                                        *
-*  This program is free software; it is licensed under the terms of the  *
-*  GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#include"Ip2_FrictMat_FrictMat_CapillaryPhys.hpp"
-#include<yade/pkg/dem/ScGeom.hpp>
-#include<yade/pkg/dem/CapillaryPhys.hpp>
-#include<yade/pkg/dem/FrictPhys.hpp>
-#include<yade/pkg/common/ElastMat.hpp>
-#include<yade/pkg/common/Dispatching.hpp>
-
-#include<yade/core/Omega.hpp>
-#include<yade/core/Scene.hpp>
-
-YADE_PLUGIN((Ip2_FrictMat_FrictMat_CapillaryPhys));
-
-void Ip2_FrictMat_FrictMat_CapillaryPhys::go( const shared_ptr<Material>& b1 //FrictMat
-					, const shared_ptr<Material>& b2 // FrictMat
-					, const shared_ptr<Interaction>& interaction)
-{
-	ScGeom* geom = YADE_CAST<ScGeom*>(interaction->geom.get());
-	if(geom)
-	{
-		if(!interaction->phys)
-		{
- 			const shared_ptr<FrictMat>& sdec1 = YADE_PTR_CAST<FrictMat>(b1);
- 			const shared_ptr<FrictMat>& sdec2 = YADE_PTR_CAST<FrictMat>(b2);
-
- 			if (!interaction->phys) interaction->phys = shared_ptr<CapillaryPhys>(new CapillaryPhys());
-			const shared_ptr<CapillaryPhys>& contactPhysics = YADE_PTR_CAST<CapillaryPhys>(interaction->phys);
-
-			Real Ea 	= sdec1->young;
-			Real Eb 	= sdec2->young;
-			Real Va 	= sdec1->poisson;
-			Real Vb 	= sdec2->poisson;
-			Real Da 	= geom->radius1; // FIXME - multiply by factor of sphere interaction distance (so sphere interacts at bigger range that its geometrical size)
-			Real Db 	= geom->radius2; // FIXME - as above
-			Real fa 	= sdec1->frictionAngle;
-			Real fb 	= sdec2->frictionAngle;
-			Real Kn = 2*Ea*Da*Eb*Db/(Ea*Da+Eb*Db);//harmonic average of two stiffnesses
-			Real Ks = 2*Ea*Da*Va*Eb*Db*Vb/(Ea*Da*Va+Eb*Db*Va);//harmonic average of two stiffnesses with ks=V*kn for each sphere
-
-			contactPhysics->tangensOfFrictionAngle = std::tan(std::min(fa,fb));
-			contactPhysics->kn = Kn;
-			contactPhysics->ks = Ks;
-		}
-	}
-};
-
-
-
-

=== removed file 'pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.hpp'
--- pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.hpp	2012-03-27 22:07:35 +0000
+++ pkg/dem/Ip2_FrictMat_FrictMat_CapillaryPhys.hpp	1970-01-01 00:00:00 +0000
@@ -1,29 +0,0 @@
-/*************************************************************************
-*  Copyright (C) 2007 by Bruno CHAREYRE                                  *
-*  bruno.chareyre@xxxxxxxxxxx                                            *
-*                                                                        *
-*  This program is free software; it is licensed under the terms of the  *
-*  GNU General Public License v2 or later. See file LICENSE for details. *
-*************************************************************************/
-
-#pragma once
-
-#include<yade/pkg/common/Dispatching.hpp>
-#include<yade/pkg/common/ElastMat.hpp>
-
-
-class Ip2_FrictMat_FrictMat_CapillaryPhys : public IPhysFunctor
-{
-	public :
-		virtual void go(	const shared_ptr<Material>& b1,
-					const shared_ptr<Material>& b2,
-					const shared_ptr<Interaction>& interaction);
-
-	FUNCTOR2D(FrictMat,FrictMat);
-	YADE_CLASS_BASE_DOC_ATTRS_CTOR(Ip2_FrictMat_FrictMat_CapillaryPhys,IPhysFunctor, "RelationShips to use with Law2_ScGeom_CapillaryPhys_Capillarity\n\n In these RelationShips all the interaction attributes are computed. \n\n.. warning::\n\tas in the others :yref:`Ip2 functors<IPhysFunctor>`, most of the attributes are computed only once, when the interaction is new.",,;);
-	
-};
-REGISTER_SERIALIZABLE(Ip2_FrictMat_FrictMat_CapillaryPhys);
-
-
-