← Back to team overview

yade-dev team mailing list archive

[svn] r1473 - cosurgi

 

------------------------------------------------------------------------
r1473 | cosurgi | 2008-08-19 13:18:35 +0200 (wto, 19 sie 2008) | 4 lines
Changed paths:
   M /trunk/SConstruct
   M /trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
   M /trunk/pkg/lattice/PreProcessor/LatticeExample.hpp

small changes in Lattice
small bugfix in scons (by Vaclav)


------------------------------------------------------------------------
Index: pkg/lattice/PreProcessor/LatticeExample.cpp
===================================================================
--- pkg/lattice/PreProcessor/LatticeExample.cpp	(revision 1472)
+++ pkg/lattice/PreProcessor/LatticeExample.cpp	(revision 1473)
@@ -1714,10 +1714,10 @@
 }
 
 
-bool LatticeExample::isFibre(Vector3r a,Vector3r b)
+int LatticeExample::isFibre(Vector3r a,Vector3r b)
 {
-	bool A=false;
-	bool B=false;
+	int A=0;
+	int B=0;
 	for(int i = 0 ; i < fibre_count ; ++i)
         {
 		Vector3r pos = fibres[i].first;
@@ -1728,11 +1728,11 @@
 				pos[0] + 1.0*j*del[0],
 				pos[1] + 1.0*j*del[1],
 				pos[2] + 1.0*j*del[2] );
-			if(p == a) A=true;
-			if(p == b) B=true;
+			if(p == a) A=1;
+			if(p == b) B=1;
 		}
 	}
-	return A && B;
+	return A + B;
 }
 
 bool LatticeExample::fibreAllows(Vector3r a)
@@ -1770,8 +1770,9 @@
                                 continue; // skip non-beams
 
                         LatticeBeamParameters* beam     = static_cast<LatticeBeamParameters*>(body->physicalParameters.get());
-                        if(isFibre(       (*(rootBody->bodies))[beam->id1]->physicalParameters->se3.position
-                                         ,(*(rootBody->bodies))[beam->id2]->physicalParameters->se3.position))
+			int fibreNodes=isFibre(   (*(rootBody->bodies))[beam->id1]->physicalParameters->se3.position
+						 ,(*(rootBody->bodies))[beam->id2]->physicalParameters->se3.position);
+			if(fibreNodes==2) // fibre
 			{
 				beam->longitudalStiffness       = fibre_longStiffness_noUnit;
                         	beam->bendingStiffness          = fibre_bendStiffness_noUnit;
@@ -1784,6 +1785,14 @@
 				
 				fibres_total+=1.0;
 			}
+			if(fibreNodes==1) // bond
+			{
+                                beam->longitudalStiffness       = bond_longStiffness_noUnit;
+                                beam->bendingStiffness          = bond_bendStiffness_noUnit;
+                                beam->torsionalStiffness	= bond_torsStiffness_noUnit;
+                                beam->criticalTensileStrain     = bond_critTensileStrain;
+                                beam->criticalCompressiveStrain = bond_critCompressStrain;
+			}
                 }
         }
 }
Index: pkg/lattice/PreProcessor/LatticeExample.hpp
===================================================================
--- pkg/lattice/PreProcessor/LatticeExample.hpp	(revision 1472)
+++ pkg/lattice/PreProcessor/LatticeExample.hpp	(revision 1473)
@@ -93,7 +93,7 @@
 
                 void addAggregates(shared_ptr<MetaBody>& rootBody);
                 void makeFibreBeams(shared_ptr<MetaBody>& rootBody);
-		bool isFibre(Vector3r,Vector3r);
+		int isFibre(Vector3r,Vector3r);
 		bool fibreAllows(Vector3r);
 
 ////////////////////////////////////////////////////
Index: SConstruct
===================================================================
--- SConstruct	(revision 1472)
+++ SConstruct	(revision 1473)
@@ -79,7 +79,7 @@
 if ',' in env['profile']:
 	profiles=env['profile'].split(',')
 	import threading,subprocess
-	def runProfile(profile): subprocess.call([sys.argv[0],'-Q','profile='+p+'!'])
+	def runProfile(profile): subprocess.call([sys.argv[0],'-Q','profile='+profile+'!'])
 	profileThreads=[]
 	for arg in sys.argv[2:]:
 		print "WARNING: parallel-building, extra argument `%s' ignored!"%arg