← Back to team overview

yade-dev team mailing list archive

[svn] r1760 - in trunk: core pkg/dem/Engine/StandAloneEngine pkg/lattice/PreProcessor pkg/lattice/RenderingEngine/GLDrawLineSegment

 

Author: cosurgi
Date: 2009-05-01 16:10:37 +0200 (Fri, 01 May 2009)
New Revision: 1760

Modified:
   trunk/core/Omega.cpp
   trunk/pkg/dem/Engine/StandAloneEngine/SQLiteRecorder.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
   trunk/pkg/lattice/PreProcessor/LatticeExample.hpp
   trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp
Log:
add option for horizontal or vertical wires in fibre reinforced concrete.



Modified: trunk/core/Omega.cpp
===================================================================
--- trunk/core/Omega.cpp	2009-04-23 15:50:23 UTC (rev 1759)
+++ trunk/core/Omega.cpp	2009-05-01 14:10:37 UTC (rev 1760)
@@ -213,7 +213,7 @@
 void Omega::loadSimulation(){
 
 	if(Omega::instance().getSimulationFileName().size()==0) throw yadeBadFile("Simulation filename to load has zero length");
-	if(!filesystem::exists(simulationFileName) && !algorithm::starts_with(simulationFileName,":memory")) throw yadeBadFile("Simulation file to load doesn't exist");
+	if(!filesystem::exists(simulationFileName) && !algorithm::starts_with(simulationFileName,":memory")) throw yadeBadFile((std::string("Simulation file to load doesn't exist")+simulationFileName).c_str());
 	
 	LOG_INFO("Loading file " + simulationFileName);
 

Modified: trunk/pkg/dem/Engine/StandAloneEngine/SQLiteRecorder.cpp
===================================================================
--- trunk/pkg/dem/Engine/StandAloneEngine/SQLiteRecorder.cpp	2009-04-23 15:50:23 UTC (rev 1759)
+++ trunk/pkg/dem/Engine/StandAloneEngine/SQLiteRecorder.cpp	2009-05-01 14:10:37 UTC (rev 1760)
@@ -5,6 +5,8 @@
 #include<boost/filesystem/convenience.hpp>
 #include<boost/algorithm/string/join.hpp>
 #include<yade/core/MetaBody.hpp>
+#include<boost/algorithm/string/join.hpp>
+
 using namespace boost;
 CREATE_LOGGER(SQLiteRecorder);
 

Modified: trunk/pkg/lattice/PreProcessor/LatticeExample.cpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExample.cpp	2009-04-23 15:50:23 UTC (rev 1759)
+++ trunk/pkg/lattice/PreProcessor/LatticeExample.cpp	2009-05-01 14:10:37 UTC (rev 1760)
@@ -249,6 +249,9 @@
 	movSupp_D_pos=Vector3r(0,0,0);
 	movSupp_D_range=0;
 	movSupp_D_dir=-1;
+
+	fibres_horizontal = false;
+	fibres_vertical = false;
 }
 
 
@@ -441,6 +444,9 @@
         REGISTER_ATTRIBUTE(fibre_bond_torsStiffness_noUnit);  // k_t fibre bond
         REGISTER_ATTRIBUTE(fibre_bond_critCompressStrain);    // E.c fibre bond
         REGISTER_ATTRIBUTE(fibre_bond_critTensileStrain);     // E.l fibre bond
+
+	REGISTER_ATTRIBUTE(fibres_horizontal);
+	REGISTER_ATTRIBUTE(fibres_vertical);
 }
 
 bool LatticeExample::generate()
@@ -1644,12 +1650,62 @@
                 Vector3r cc;
 		Vector3r del;
                 cc[0]=random1()*AGGREGATES_X, cc[1]=random1()*AGGREGATES_Y, cc[2]=((AGGREGATES_Z==0)?(0):(random1()*AGGREGATES_Z));
-                del[0]=random1()-0.5, del[1]=random1()-0.5, del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+
+                //del[0]=random1()-0.5, del[1]=random1()-0.5, del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+
+		if(fibres_horizontal || fibres_vertical)
+		{
+			if(fibres_horizontal)
+			{
+				std::cerr << "fibres_horizontal\n";
+
+				del[0]=0;
+				while(del[0]*del[0] < 0.15) del[0]=random1()-0.5;
+
+				del[1]=(random1()-0.5)*0.2;
+
+				del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+			}
+			else
+			{
+				std::cerr << "fibres_vertical\n";
+
+				del[0]=(random1()-0.5)*0.2;
+
+				del[1]=0;
+				while(del[1]*del[1] < 0.15) del[1]=random1()-0.5;
+
+				del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+			}
+		}
+		else
+		{
+			del[0]=random1()-0.5;
+			del[1]=random1()-0.5;
+			del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+		}
+
 		del.Normalize();
 		del=cellsizeUnit_in_meters * del;
 		fibres.push_back(std::make_pair(cc,del));
         }
+/*
+	   for(int i = 0 ; i < fibre_count ; ++i)
+	   {
+		   Vector3r cc;
+		   Vector3r del;
+		   cc[0]=random1()*AGGREGATES_X, cc[1]=random1()*AGGREGATES_Y, cc[2]=((AGGREGATES_Z==0)?(0):(random1()*AGGREGATES_Z));
 
+		   del[0]=random1()-0.5;
+		   del[1]=random1()-0.5;
+		   del[2]=((AGGREGATES_Z==0)?(0):(random1()-0.5));
+
+		   del.Normalize();
+		   del=cellsizeUnit_in_meters * del;
+		   fibres.push_back(std::make_pair(cc,del));
+	   }
+*/
+
 // repulsion !!
 	for(int frame=0; frame < fibre_balancing_iterations ; ++frame)
 	{
@@ -1658,7 +1714,13 @@
 		for(unsigned int i = 0 ; i < fibres.size() ; ++i )
 		{
 			Vector3r d(0,0,0);
-			Vector3r c1 = fibres[i].first + fibres[i].second*beams_per_fibre*0.5;
+
+			////Vector3r c1 = fibres[i].first + fibres[i].second*beams_per_fibre*0.5;
+
+		for(float PART_1 = 0 ; PART_1 <= 1.0 ; PART_1 += 0.2 )
+		{
+			Vector3r c1 = fibres[i].first + fibres[i].second*beams_per_fibre*PART_1;
+
 			//emulate periodic boundary
 			for(int px = -1 ; px < 2 ; ++px )
 			for(int py = -1 ; py < 2 ; ++py )
@@ -1668,7 +1730,14 @@
 				for(unsigned int j = 0 ; j < fibres.size() ; ++j )
 					if(i != j)
 					{
-						Vector3r c2 = fibres[j].first + fibres[j].second*beams_per_fibre*0.5 + PERIODIC_DELTA;
+						////Vector3r c2 = fibres[j].first + fibres[j].second*beams_per_fibre*0.5 + PERIODIC_DELTA;
+
+
+					for(float PART_2 = 0 ; PART_2 <= 1.0 ; PART_2 += 0.2 )
+					{
+						Vector3r c2 = fibres[j].first + fibres[j].second*beams_per_fibre*PART_2 + PERIODIC_DELTA;
+
+
 						Vector3r dir=c1-c2;
 						Real r = dir.Normalize(); // dir is unit vector, r is a distance
 						if(r < cellsizeUnit_in_meters)
@@ -1700,6 +1769,8 @@
 								d += (dir * 1/(r*r))*10;
 						}
 					}
+
+					}
 			}
 			// repulsion from walls.
 			Vector3r MAX(AGGREGATES_X, AGGREGATES_Y, AGGREGATES_Z);
@@ -1712,7 +1783,10 @@
 			}
 			moves.push_back(d);
 		}
-		assert(moves.size() == fibres.size() );
+
+		}
+
+		assert(moves.size() == fibres.size()*6 );
 		Real maxl=0;
 		for(unsigned int i = 0 ; i < moves.size() ; ++i )
 			maxl = std::max(moves[i].Length(),maxl);
@@ -1720,8 +1794,11 @@
 		for(unsigned int i = 0 ; i < moves.size() ; ++i )
 			moves[i] = cellsizeUnit_in_meters*moves[i]/maxl;
 	
-		for(unsigned int i = 0 ; i < fibres.size() ; ++i )
-			fibres[i].first+=moves[i];
+//		for(unsigned int i = 0 ; i < fibres.size() ; ++i )
+//			fibres[i].first+=moves[i];
+		for(unsigned int i = 0 ; i < moves.size() ; ++i )
+			fibres[std::floor(((float)(i))/6.0f)].first+=moves[i];
+
 	
 		for(unsigned int i = 0 ; i < fibres.size() ; ++i )
 		{

Modified: trunk/pkg/lattice/PreProcessor/LatticeExample.hpp
===================================================================
--- trunk/pkg/lattice/PreProcessor/LatticeExample.hpp	2009-04-23 15:50:23 UTC (rev 1759)
+++ trunk/pkg/lattice/PreProcessor/LatticeExample.hpp	2009-05-01 14:10:37 UTC (rev 1760)
@@ -254,6 +254,10 @@
 
                                  
                 std::vector< std::vector< unsigned int > > connections; // which node is in touch with what beams.
+
+		bool             fibres_horizontal
+				,fibres_vertical;
+
                                 
         public : 
 		LatticeExample();

Modified: trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp
===================================================================
--- trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp	2009-04-23 15:50:23 UTC (rev 1759)
+++ trunk/pkg/lattice/RenderingEngine/GLDrawLineSegment/GLDrawLineSegment.cpp	2009-05-01 14:10:37 UTC (rev 1760)
@@ -21,6 +21,9 @@
 	glColor3v(gm->diffuseColor);
 	
 	Real len = (static_cast<LineSegment*>(gm.get()))->length;
+	if(len >1.0)
+		return;
+
 	maxLen = std::max(len,maxLen);
 
 	// FIXME - there must be a way to tell this from outside