Пример #1
0
    // write out to MATLAB
	void writeout(REAL *npoints)
	{
	
		for (int k = 0; k < pcontainer.pcnt; k++)
		{
			Particle *p = &(pcontainer.particles[k]);
			npoints[attrcnt*k] = p->R.x;
			npoints[attrcnt*k+1] = p->R.y;
			npoints[attrcnt*k+2] = p->R.z;
			npoints[attrcnt*k+3] = p->N.x;
			npoints[attrcnt*k+4] = p->N.y;
			npoints[attrcnt*k+5] = p->N.z;
			npoints[attrcnt*k+6] = p->label;	
			npoints[attrcnt*k+7] = p->len;		
			npoints[attrcnt*k+8] = pcontainer.ID_2_index(p->mID);		
			npoints[attrcnt*k+9] = pcontainer.ID_2_index(p->pID);		
			npoints[attrcnt*k+10] = p->Di;
			npoints[attrcnt*k+11] = p->Da;
			npoints[attrcnt*k+12] = p->Dp;
			npoints[attrcnt*k+13] = p->w;
			npoints[attrcnt*k+14] = p->q;                    
                    

		}
	

	}
Пример #2
0
 void WriteOutParticles(float *npoints)
 {
   for (int k = 0; k < m_ParticleGrid.pcnt; k++)
   {
     Particle *p = &(m_ParticleGrid.particles[k]);
     npoints[m_NumAttributes*k] = p->R.GetX();
     npoints[m_NumAttributes*k+1] = p->R.GetY();
     npoints[m_NumAttributes*k+2] = p->R.GetZ();
     npoints[m_NumAttributes*k+3] = p->N.GetX();
     npoints[m_NumAttributes*k+4] = p->N.GetY();
     npoints[m_NumAttributes*k+5] = p->N.GetZ();
     npoints[m_NumAttributes*k+6] = p->cap;
     npoints[m_NumAttributes*k+7] = p->len;
     npoints[m_NumAttributes*k+8] = m_ParticleGrid.ID_2_index(p->mID);
     npoints[m_NumAttributes*k+9] = m_ParticleGrid.ID_2_index(p->pID);
   }
 }