예제 #1
0
void EmbeddedGMap3::sewVolumes(Dart d, Dart e, bool withBoundary)
{
    // topological sewing
    GMap3::sewVolumes(d, e, withBoundary);

    // embed the vertex orbits from the oriented face with dart e
    // with vertex orbits value from oriented face with dart d
    if (isOrbitEmbedded<VERTEX>())
    {
        Dart it = d ;
        do
        {
            setOrbitEmbedding<VERTEX>(it, getEmbedding<VERTEX>(it)) ;
            it = phi1(it) ;
        } while(it != d) ;
    }

    // embed the new edge orbit with the old edge orbit value
    // for all the face
    if (isOrbitEmbedded<EDGE>())
    {
        Dart it = d ;
        do
        {
            setOrbitEmbedding<EDGE>(it, getEmbedding<EDGE>(it)) ;
            it = phi1(it) ;
        } while(it != d) ;
    }

    // embed the face orbit from the volume sewn
    if (isOrbitEmbedded<FACE>())
    {
        setOrbitEmbedding<FACE>(e, getEmbedding<FACE>(d)) ;
    }
}
예제 #2
0
void
EBSDAccessFunctorsTest::test()
{
  RealVectorValue reference_angle(0.1, 0.2, 0.3);
  Point reference_point1 = Point(9.0, 10.0, 11.0);
  Point reference_point2 = Point(6.0, 7.0, 8.0);

  // Test point data access
  {
    EBSDPointDataPhi1 phi1;
    CPPUNIT_ASSERT( phi1(_point) == _point._phi1 );
    EBSDPointDataPhi phi;
    CPPUNIT_ASSERT( phi(_point) == _point._Phi );
    EBSDPointDataPhi2 phi2;
    CPPUNIT_ASSERT( phi2(_point) == _point._phi2 );

    EBSDPointDataPhase phase;
    CPPUNIT_ASSERT( phase(_point) == _point._phase );
    EBSDPointDataSymmetry symmetry;
    CPPUNIT_ASSERT( symmetry(_point) == _point._symmetry );
    EBSDPointDataGrain grain;
    CPPUNIT_ASSERT( grain(_point) == _point._grain );
    EBSDPointDataOp op;
    CPPUNIT_ASSERT( op(_point) == _point._op );

    for (unsigned int i = 0; i < 3; ++i)
    {
      EBSDPointDataCustom custom(i);
      CPPUNIT_ASSERT( custom(_point) == _point._custom[i] );
    }
  }

  // Test average data access
  {
    RealVectorValue angle = *(_avg._angles);
    CPPUNIT_ASSERT( (angle - reference_angle).size() == 0 );

    EBSDAvgDataPhi1 phi1;
    CPPUNIT_ASSERT( phi1(_avg) == angle(0) );
    EBSDAvgDataPhi phi;
    CPPUNIT_ASSERT( phi(_avg) == angle(1) );
    EBSDAvgDataPhi2 phi2;
    CPPUNIT_ASSERT( phi2(_avg) == angle(2) );

    EBSDAvgDataPhase phase;
    CPPUNIT_ASSERT( phase(_avg) == _avg._phase );
    EBSDAvgDataSymmetry symmetry;
    CPPUNIT_ASSERT( symmetry(_avg) == _avg._symmetry );
    EBSDAvgDataGrain grain;
    CPPUNIT_ASSERT( grain(_avg) == _avg._grain );
    EBSDAvgDataLocalID local;
    CPPUNIT_ASSERT( local(_avg) == _avg._local );

    for (unsigned int i = 0; i < 3; ++i)
    {
      EBSDAvgDataCustom custom(i);
      CPPUNIT_ASSERT( custom(_avg) == _avg._custom[i] );
    }
  }
}
예제 #3
0
Dart EmbeddedGMap2::cutEdge(Dart d)
{
	Dart nd = GMap2::cutEdge(d) ;

	if(isOrbitEmbedded<VERTEX>())
	{
		Algo::Topo::initOrbitEmbeddingOnNewCell<VERTEX>(*this, nd) ;
	}

	if (isOrbitEmbedded<EDGE>())
	{
		unsigned int eEmb = getEmbedding<EDGE>(d) ;
		setDartEmbedding<EDGE>(phi2(d), eEmb) ;
		setDartEmbedding<EDGE>(beta0(d), eEmb) ;
		Algo::Topo::setOrbitEmbeddingOnNewCell<EDGE>(*this, nd) ;
		Algo::Topo::copyCellAttributes<EDGE>(*this, nd, d) ;
	}

	if(isOrbitEmbedded<FACE>())
	{
		unsigned int f1Emb = getEmbedding<FACE>(d) ;
		setDartEmbedding<FACE>(phi1(d), f1Emb) ;
		setDartEmbedding<FACE>(beta0(d), f1Emb) ;
		Dart e = phi2(nd) ;
		unsigned int f2Emb = getEmbedding<FACE>(d) ;
		setDartEmbedding<FACE>(phi1(e), f2Emb) ;
		setDartEmbedding<FACE>(beta0(e), f2Emb) ;
	}

	return nd ;
}
예제 #4
0
bool EmbeddedGMap2::flipBackEdge(Dart d)
{
	if(GMap2::flipBackEdge(d))
	{
		Dart e = phi2(d) ;

		if (isOrbitEmbedded<VERTEX>())
		{
			unsigned int v1Emb = getEmbedding<VERTEX>(beta1(d)) ;
			setDartEmbedding<VERTEX>(d, v1Emb) ;
			setDartEmbedding<VERTEX>(beta2(d), v1Emb) ;
			unsigned int v2Emb = getEmbedding<VERTEX>(beta1(e)) ;
			setDartEmbedding<VERTEX>(e, v2Emb) ;
			setDartEmbedding<VERTEX>(beta2(e), v2Emb) ;
		}

		if (isOrbitEmbedded<FACE>())
		{
			unsigned int f1Emb = getEmbedding<FACE>(d) ;
			setDartEmbedding<FACE>(phi1(d), f1Emb) ;
			setDartEmbedding<FACE>(beta0(phi1(d)), f1Emb) ;
			unsigned int f2Emb = getEmbedding<FACE>(e) ;
			setDartEmbedding<FACE>(phi1(e), f2Emb) ;
			setDartEmbedding<FACE>(beta0(phi1(e)), f2Emb) ;
		}
		return true ;
	}
	return false ;
}
예제 #5
0
void EmbeddedMap2::unsewFaces(Dart d)
{
	Dart e = phi2(d) ;
	Map2::unsewFaces(d) ;

	if (isOrbitEmbedded<VERTEX>())
	{
		Dart ee = phi1(e) ;
		if(!sameVertex(d, ee))
		{
			embedNewCell<VERTEX>(ee);
			copyCell<VERTEX>(ee, d);
		}

		Dart dd = phi1(d) ;
		if(!sameVertex(e, dd))
		{
			embedNewCell<VERTEX>(dd);
			copyCell<VERTEX>(dd, e);
		}
	}

	if (isOrbitEmbedded<EDGE>())
	{
		embedNewCell<EDGE>(e);
		copyCell<EDGE>(e, d);
	}
}
예제 #6
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
void GMap1<MAP_IMPL>::deleteCycle(Dart d)
{
	Dart e = phi1(d);
	while (e != d)
	{
		Dart f = phi1(e);
		this->deleteEdge(e);
		e = f;
	}
	this->deleteEdge(d);
}
예제 #7
0
void GMap1::deleteCycle(Dart d)
{
	Dart e = phi1(d);
	while (e != d)
	{
		Dart f = phi1(e);
		deleteEdge(e);
		e = f;
	}
	deleteEdge(d);
}
예제 #8
0
파일: ihm2.cpp 프로젝트: mhdsedighi/SOFA
bool ImplicitHierarchicalMap2::faceIsSubdivided(Dart d)
{
	assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
	unsigned int fLevel = faceLevel(d) ;
	if(fLevel < m_curLevel)
		return false ;

	bool subd = false ;
	++m_curLevel ;
	if(m_dartLevel[phi1(d)] == m_curLevel && m_edgeId[phi1(d)] != m_edgeId[d])
		subd = true ;
	--m_curLevel ;
	return subd ;
}
예제 #9
0
파일: ihm2.cpp 프로젝트: mhdsedighi/SOFA
bool ImplicitHierarchicalMap2::edgeIsSubdivided(Dart d)
{
	assert(m_dartLevel[d] <= m_curLevel || !"Access to a dart introduced after current level") ;
//	Dart d2 = phi2(d) ;
	Dart d1 = phi1(d) ;
	++m_curLevel ;
//	Dart d2_l = phi2(d) ;
	Dart d1_l = phi1(d) ;
	--m_curLevel ;
	if(d1 != d1_l)
		return true ;
	else
		return false ;
}
예제 #10
0
Dart EmbeddedGMap3::cutEdge(Dart d)
{
    Dart nd = GMap3::cutEdge(d);

    if(isOrbitEmbedded<EDGE>())
    {
        // embed the new darts created in the cut edge
        unsigned int eEmb = getEmbedding<EDGE>(d) ;
        Dart e = d ;
        do
        {
            setDartEmbedding<EDGE>(beta0(e), eEmb) ;
            e = alpha2(e) ;
        } while(e != d) ;

        // embed a new cell for the new edge and copy the attributes' line (c) Lionel
        setOrbitEmbeddingOnNewCell<EDGE>(phi1(d)) ;
        copyCell<EDGE>(phi1(d), d) ;
    }

    if(isOrbitEmbedded<FACE>())
    {
        Dart f = d;
        do
        {
            unsigned int fEmb = getEmbedding<FACE>(f) ;
            setDartEmbedding<FACE>(beta0(f), fEmb);
            setDartEmbedding<FACE>(phi1(f), fEmb);
            setDartEmbedding<FACE>(phi3(f), fEmb);
            setDartEmbedding<FACE>(beta1(phi3(f)), fEmb);
            f = alpha2(f);
        } while(f != d);
    }

    if(isOrbitEmbedded<VOLUME>())
    {
        Dart f = d;
        do
        {
            unsigned int vEmb = getEmbedding<VOLUME>(f) ;
            setDartEmbedding<VOLUME>(beta0(f), vEmb);
            setDartEmbedding<VOLUME>(phi1(f), vEmb);
            setDartEmbedding<VOLUME>(phi2(f), vEmb);
            setDartEmbedding<VOLUME>(beta1(phi2(f)), vEmb);
            f = alpha2(f);
        } while(f != d);
    }

    return nd ;
}
예제 #11
0
bool EmbeddedGMap2::edgeCanCollapse(Dart d)
{
	if(isBoundaryVertex(d) || isBoundaryVertex(phi1(d)))
		return false ;

	unsigned int val_v1 = vertexDegree(d) ;
	unsigned int val_v2 = vertexDegree(phi1(d)) ;

	if(val_v1 + val_v2 < 8 || val_v1 + val_v2 > 14)
		return false ;

	if(faceDegree(d) == 3)
	{
		if(vertexDegree(phi_1(d)) < 4)
			return false ;
	}

	Dart dd = phi2(d) ;
	if(faceDegree(dd) == 3)
	{
		if(vertexDegree(phi_1(dd)) < 4)
			return false ;
	}

	// Check vertex sharing condition
	std::vector<unsigned int> vu1 ;
	vu1.reserve(32) ;
	Dart vit1 = alpha1(alpha1(d)) ;
	Dart end = phi1(dd) ;
	do
	{
		unsigned int ve = getEmbedding<VERTEX>(phi2(vit1)) ;
		vu1.push_back(ve) ;
		vit1 = alpha1(vit1) ;
	} while(vit1 != end) ;
	end = phi1(d) ;
	Dart vit2 = alpha1(alpha1(dd)) ;
	do
	{
		unsigned int ve = getEmbedding<VERTEX>(phi2(vit2)) ;
		std::vector<unsigned int>::iterator it = std::find(vu1.begin(), vu1.end(), ve) ;
		if(it != vu1.end())
			return false ;
		vit2 = alpha1(vit2) ;
	} while(vit2 != end) ;

	return true ;
}
예제 #12
0
unsigned int EmbeddedGMap2::closeHole(Dart d, bool forboundary)
{
	unsigned int nbE = GMap2::closeHole(d, forboundary) ;
	Dart dd = phi2(d) ;
	Dart it = dd ;
	do
	{
		if (isOrbitEmbedded<VERTEX>())
		{
			copyDartEmbedding<VERTEX>(it, beta2(it)) ;
			copyDartEmbedding<VERTEX>(beta0(it), phi2(it)) ;
		}
		if (isOrbitEmbedded<EDGE>())
		{
			unsigned int eEmb = getEmbedding<EDGE>(beta2(it)) ;
			setDartEmbedding<EDGE>(it, eEmb) ;
			setDartEmbedding<EDGE>(beta0(it), eEmb) ;
		}
		it = phi1(it) ;
	} while(it != dd) ;

	if(isOrbitEmbedded<FACE>())
	{
		Algo::Topo::initOrbitEmbeddingOnNewCell<FACE>(*this, dd) ;
	}

	return nbE ;
}
예제 #13
0
bool EmbeddedMap2::check()
{
	bool topo = Map2::check() ;
	if (!topo)
		return false ;

	CGoGNout << "Check: embedding begin" << CGoGNendl ;
	for(Dart d = begin(); d != end(); next(d))
	{
		if (isOrbitEmbedded<VERTEX>())
		{
			if (getEmbedding<VERTEX>(d) != getEmbedding<VERTEX>(alpha1(d)))
			{
				CGoGNout << "Check: different embeddings on vertex" << CGoGNendl ;
				return false ;
			}
		}

		if (isOrbitEmbedded<EDGE>())
		{
			if (getEmbedding<EDGE>(d) != getEmbedding<EDGE>(phi2(d)))
			{
				CGoGNout << "Check: different embeddings on edge" << CGoGNendl ;
				return false ;
			}
		}

//		if (isOrbitEmbedded(ORIENTED_FACE))
//		{
//			if (getEmbedding(ORIENTED_FACE, d) != getEmbedding(ORIENTED_FACE, phi1(d)))
//		{
//				CGoGNout << "Check: different embeddings on oriented face" << CGoGNendl ;
//				return false ;
//			}
//		}

		if (isOrbitEmbedded<FACE>())
		{
			if (getEmbedding<FACE>(d) != getEmbedding<FACE>(phi1(d)))
			{
				CGoGNout << "Check: different embeddings on face" << CGoGNendl ;
				return false ;
			}
		}
	}

	CGoGNout << "Check: embedding ok" << CGoGNendl ;

    std::cout << "nb vertex orbits : " << getNbOrbits<VERTEX>() << std::endl ;
    std::cout << "nb vertex cells : " << m_attribs[VERTEX].size() << std::endl ;

    std::cout << "nb edge orbits : " << getNbOrbits<EDGE>() << std::endl ;
    std::cout << "nb edge cells : " << m_attribs[EDGE].size() << std::endl ;

    std::cout << "nb face orbits : " << getNbOrbits<FACE>() << std::endl ;
    std::cout << "nb face cells : " << m_attribs[FACE].size() << std::endl ;

	return true ;
}
예제 #14
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline Dart GMap1<MAP_IMPL>::phi(Dart d) const
{
	assert((N > 0) || !"negative parameters not allowed in template multi-phi");
	if (N < 10)
	{
		switch(N)
		{
		case 1 : return phi1(d) ;
		default : assert(!"Wrong multi-phi relation value") ; return d ;
		}
	}
	switch(N%10)
	{
	case 1 : return phi1(phi<N/10>(d)) ;
	default : assert(!"Wrong multi-phi relation value") ; return d ;
	}
}
예제 #15
0
void EmbeddedGMap2::splitVertex(Dart d, Dart e)
{
	Dart dd = phi2(d) ;
	Dart ee = phi2(e) ;

	GMap2::splitVertex(d, e) ;

	if (isOrbitEmbedded<VERTEX>())
	{
		unsigned int vEmb = getEmbedding<VERTEX>(d) ;
		setDartEmbedding<VERTEX>(phi1(dd), vEmb) ;
		setDartEmbedding<VERTEX>(beta2(phi1(dd)), vEmb) ;
		setDartEmbedding<VERTEX>(beta0(dd), vEmb) ;

		setOrbitEmbeddingOnNewCell<VERTEX>(e) ;
		copyCell<VERTEX>(e, d) ;
	}

	if(isOrbitEmbedded<EDGE>())
	{
		initOrbitEmbeddingNewCell<EDGE>(phi1(dd)) ;
	}

	if(isOrbitEmbedded<FACE>())
	{
		unsigned int f1Emb = getEmbedding<FACE>(dd) ;
        copyDartEmbedding<FACE>(phi1(dd), Dart::create(f1Emb)) ;
        copyDartEmbedding<FACE>(beta0(phi1(dd)), Dart::create(f1Emb)) ;
		unsigned int f2Emb = getEmbedding<FACE>(ee) ;
        copyDartEmbedding<FACE>(phi1(ee), Dart::create(f2Emb)) ;
        copyDartEmbedding<FACE>(beta0(phi1(ee)), Dart::create(f2Emb)) ;
	}
}
예제 #16
0
void EmbeddedGMap2::splitVertex(Dart d, Dart e)
{
	Dart dd = phi2(d) ;
	Dart ee = phi2(e) ;

	GMap2::splitVertex(d, e) ;

	if (isOrbitEmbedded<VERTEX>())
	{
		unsigned int vEmb = getEmbedding<VERTEX>(d) ;
		setDartEmbedding<VERTEX>(phi1(dd), vEmb) ;
		setDartEmbedding<VERTEX>(beta2(phi1(dd)), vEmb) ;
		setDartEmbedding<VERTEX>(beta0(dd), vEmb) ;

		Algo::Topo::setOrbitEmbeddingOnNewCell<VERTEX>(*this, e) ;
		Algo::Topo::copyCellAttributes<VERTEX>(*this, e, d) ;
	}

	if(isOrbitEmbedded<EDGE>())
	{
		Algo::Topo::initOrbitEmbeddingOnNewCell<EDGE>(*this, phi1(dd)) ;
	}

	if(isOrbitEmbedded<FACE>())
	{
		unsigned int f1Emb = getEmbedding<FACE>(dd) ;
		setDartEmbedding<FACE>(phi1(dd), f1Emb) ;
		setDartEmbedding<FACE>(beta0(phi1(dd)), f1Emb) ;
		unsigned int f2Emb = getEmbedding<FACE>(ee) ;
		setDartEmbedding<FACE>(phi1(ee), f2Emb) ;
		setDartEmbedding<FACE>(beta0(phi1(ee)), f2Emb) ;
	}
}
예제 #17
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline void GMap1<MAP_IMPL>::foreach_dart_of_oriented_cc(Dart d, FUNC& f) const
{
	Dart it = d ;
	do
	{
		f(it);
		it = phi1(it) ;
	} while (it != d) ;
}
예제 #18
0
void EmbeddedMap2::splitSurface(std::vector<Dart>& vd, bool firstSideClosed, bool secondSideClosed)
{
	std::vector<Dart> darts ;
	darts.reserve(vd.size());

	// save the edge neighbors darts
	for(std::vector<Dart>::iterator it = vd.begin() ; it != vd.end() ; ++it)
	{
		darts.push_back(phi2(*it));
	}

	assert(darts.size() == vd.size());

	Map2::splitSurface(vd, firstSideClosed, secondSideClosed);

	// follow the edge path a second time to embed the vertex, edge and volume orbits
	for(unsigned int i = 0; i < vd.size(); ++i)
	{
		Dart dit = vd[i];
		Dart dit2 = darts[i];

		// embed the vertex embedded from the origin volume to the new darts
		if(isOrbitEmbedded<VERTEX>())
		{
			copyDartEmbedding<VERTEX>(phi2(dit), phi1(dit));
			copyDartEmbedding<VERTEX>(phi2(dit2), phi1(dit2));
		}

		// embed the edge embedded from the origin volume to the new darts
		if(isOrbitEmbedded<EDGE>())
		{
			unsigned int eEmb = getEmbedding<EDGE>(dit) ;
			setDartEmbedding<EDGE>(phi2(dit), eEmb);
			setDartEmbedding<EDGE>(phi2(dit2), eEmb);
		}

		// embed the volume embedded from the origin volume to the new darts
		if(isOrbitEmbedded<VOLUME>())
		{
			copyDartEmbedding<VOLUME>(phi2(dit), dit);
			copyDartEmbedding<VOLUME>(phi2(dit2), dit2);
		}
	}
}
예제 #19
0
int main() 
{
// Primary Operators
  AnnihilationOperator A1(0);  // 1st freedom
  NumberOperator N1(0);
  IdentityOperator Id1(0);
  AnnihilationOperator A2(1);  // 2nd freedom
  NumberOperator N2(1);
  IdentityOperator Id2(1);
  SigmaPlus Sp(2);             // 3rd freedom
  IdentityOperator Id3(2);
  Operator Sm = Sp.hc();       // Hermitian conjugate
  Operator Ac1 = A1.hc();
  Operator Ac2 = A2.hc();
// Hamiltonian
  double E = 20.0;           
  double chi = 0.4;      
  double omega = -0.7;       
  double eta = 0.001;
  Complex I(0.0,1.0);
  Operator H = (E*I)*(Ac1-A1)
             + (0.5*chi*I)*(Ac1*Ac1*A2 - A1*A1*Ac2)
             + omega*Sp*Sm + (eta*I)*(A2*Sp-Ac2*Sm);
// Lindblad operators
  double gamma1 = 1.0;       
  double gamma2 = 1.0;       
  double kappa = 0.1;        
  const int nL = 3;
  Operator L[nL]={sqrt(2*gamma1)*A1,sqrt(2*gamma2)*A2,sqrt(2*kappa)*Sm};
// Initial state
  State phi1(50,FIELD);       // see paper Section 4.2
  State phi2(50,FIELD);
  State phi3(2,SPIN);
  State stateList[3] = {phi1,phi2,phi3};
  State psiIni(3,stateList);
// Trajectory
  double dt = 0.01;    // basic time step                            
  int numdts = 100;    // time interval between outputs = numdts*dt  
  int numsteps = 5;    // total integration time = numsteps*numdts*dt
  int nOfMovingFreedoms = 2;
  double epsilon = 0.01;     // cutoff probability
  int nPad = 2;              // pad size
  //ACG gen(38388389);            // random number generator with seed
  //ComplexNormal rndm(&gen);     // Complex Gaussian random numbers
  ComplexNormalTest rndm(899101); // Simple portable random number generator
  AdaptiveStep stepper(psiIni, H, nL, L);       // see paper Section 5
// Output
  const int nOfOut = 3;
  Operator outlist[nOfOut]={ Sp*A2*Sm*Sp, Sm*Sp*A2*Sm, A2 };
  char *flist[nOfOut]={"X1.out","X2.out","A2.out"};
  int pipe[] = {1,5,9,11}; // controls standard output (see `onespin.cc')
// Simulate one trajectory (for several trajectories see `onespin.cc')
  Trajectory traj(psiIni, dt, stepper, &rndm);  // see paper Section 5
  traj.plotExp( nOfOut, outlist, flist, pipe, numdts, numsteps,
                nOfMovingFreedoms, epsilon, nPad );
}
예제 #20
0
//Hermite
void Hermite() 
{ 
    float passot=0.0001,tg,tc,cx,cy; 
    int i=1; 
    Derivata_x_rapp_incr();//calcola la derivata in x dei punti
    Derivata_y_rapp_incr();//calcola la derivata in y dei punti
  
    if(mod_der==1)//checkbox spuntato -> modifico il valore della derivata in un punto
    { 
        dx[ip]=val_der_x;
        dy[ip]=val_der_y; 
    } 
  
    for (tg=0;tg<=1;tg=tg+passot) //nell'intervallo [0,1] disegno punti variando 0.0001 ogni volta
    { 
          
        //localizziamo l'intervallo iesimo [t(i),t(i+1)] a cui il valore del parametro tg appartiene 
        //all'inizio i=1,parto quindi dal primo intervallo...ogni volta che supero l'intervallo incremento la i,spostandomi quindi nell'intervallo successivo
		if (tg>t[i+1]) 
            i++; 

        // mappare il punto tg appartenente all'intervallo [t(i),t(i+1)] in un punto tcappello in [0,1] 
        tc=(tg-t[i])/(t[i+1]-t[i]); 

        // valutiamo le coordinate del punto sulla curva con le formule di interpolazione di hermite 
        cx=Punti[i].x*phi0(tc)+
			dx[i]*phi1(tc)*(t[i+1]-t[i])+
			Punti[i+1].x*psi0(tc)+
			dx[i+1]*psi1(tc)*(t[i+1]-t[i]);

        cy=Punti[i].y*phi0(tc)+
			dy[i]*phi1(tc)*(t[i+1]-t[i])+
			Punti[i+1].y*psi0(tc)+
			dy[i+1]*psi1(tc)*(t[i+1]-t[i]);
  
		//disegno il punto ottenuto sullo schermo
        glBegin(GL_POINTS);
            glVertex2f(cx,cy); 
        glEnd(); 
    } 
    glFlush(); 
} 
예제 #21
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline unsigned int GMap1<MAP_IMPL>::cycleDegree(Dart d) const
{
	unsigned int count = 0 ;
	Dart it = d ;
	do
	{
		++count ;
		it = phi1(it) ;
	} while (it != d) ;
	return count ;
}
예제 #22
0
bool EmbeddedMap2::flipBackEdge(Dart d)
{
	if(Map2::flipBackEdge(d))
	{
		Dart e = phi2(d) ;

		if (isOrbitEmbedded<VERTEX>())
		{
			copyDartEmbedding<VERTEX>(d, phi1(e)) ;
			copyDartEmbedding<VERTEX>(e, phi1(d)) ;
		}
		if (isOrbitEmbedded<FACE>())
		{
			copyDartEmbedding<FACE>(phi1(d), d) ;
			copyDartEmbedding<FACE>(phi1(e), e) ;
		}
		return true ;
	}
	return false ;
}
예제 #23
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline void GMap1<MAP_IMPL>::uncutEdge(Dart d)
{
	Dart d0 = this->beta0(d) ;
	Dart d1 = phi1(d) ;
	Dart d10 = this->beta0(d1) ;
	this->beta0unsew(d) ;
	this->beta0unsew(d10) ;
	this->beta0sew(d, d10) ;
	this->deleteDart(d0) ;
	this->deleteDart(d1) ;
}
예제 #24
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline bool GMap1<MAP_IMPL>::sameOrientedCycle(Dart d, Dart e) const
{
	Dart it = d ;
	do
	{
		if (it == e)
			return true ;
		it = phi1(it) ;
	} while (it != d) ;
	return false ;
}
예제 #25
0
void EmbeddedMap2::splitVertex(Dart d, Dart e)
{
	Dart dd = phi2(d) ;
	Dart ee = phi2(e) ;

	Map2::splitVertex(d, e) ;

	if (isOrbitEmbedded<VERTEX>())
	{
		copyDartEmbedding<VERTEX>(phi1(dd), d) ;
		copyDartEmbedding<VERTEX>(phi1(ee), e) ;
		embedNewCell<VERTEX>(e) ;
		copyCell<VERTEX>(e, d) ;
	}

	if(isOrbitEmbedded<FACE>())
	{
		copyDartEmbedding<FACE>(phi1(dd), dd) ;
		copyDartEmbedding<FACE>(phi1(ee), ee) ;
	}
}
예제 #26
0
inline Dart Map3::phi(Dart d)
{
	assert( (N >0) || !"negative parameters not allowed in template multi-phi");
	if (N<10)
	{
		switch(N)
		{
		case 1 : return phi1(d) ;
		case 2 : return phi2(d) ;
		case 3 : return phi3(d) ;
		default : assert(!"Wrong multi-phi relation value") ; return d ;
		}
	}
	switch(N%10)
	{
	case 1 : return phi1(phi<N/10>(d)) ;
	case 2 : return phi2(phi<N/10>(d)) ;
	case 3 : return phi3(phi<N/10>(d)) ;
	default : assert(!"Wrong multi-phi relation value") ; return d ;
	}
}
예제 #27
0
파일: gmap1.hpp 프로젝트: Peiffert/CGoGN
inline int GMap1<MAP_IMPL>::checkCycleDegree(Dart d, unsigned int degree) const
{
	unsigned int count = 0 ;
	Dart it = d ;
	do
	{
		++count ;
		it = phi1(it) ;
	} while ((count<=degree) && (it != d)) ;

	return count-degree;
}
예제 #28
0
void Disegna_Funzioni_Base() 
{ 
    float fbasephi0[1000],fbasephi1[1000],fbasepsi0[1000],fbasepsi1[1000],tf,vt[1000]; 
    int n_pti_val=900,i=1; 
    float passo=1.0/(n_pti_val-1); 
  
    for(tf=0;tf<=1;tf+=passo) 
    { 
        vt[i]=tf; 
        fbasephi0[i]=phi0(tf); 
        fbasephi1[i]=phi1(tf); 
        fbasepsi0[i]=psi0(tf); 
        fbasepsi1[i]=psi1(tf); 
        i++; 
    } 
    //definiamo le coordinate della finestra reale(sul mondo) 
    glMatrixMode(GL_PROJECTION);   
    glLoadIdentity();   
    gluOrtho2D(0.0, 1.0, -0.8, 1.0); 
  
    //il contenuto della finestra reale prima definita verrà mappato nella viewport sullo schermo che ha origine in (0,500),h 150 e largh 150 
    glViewport(0,500,150,150); 
      
    glColor3f(0.0,0.0,1.0); 
    glBegin(GL_POINTS); 
        for(i=1;i<=n_pti_val;i++) 
            glVertex2f(vt[i],fbasephi0[i]);  
        glEnd(); 
  
    glColor3f(0.0,1.0,1.0); 
    glBegin(GL_POINTS); 
        for(i=1;i<=n_pti_val;i++) 
            glVertex2f(vt[i],fbasephi1[i]);  
        glEnd(); 
  
    glColor3f(0.0,1.0,0.0); 
    glBegin(GL_POINTS); 
    for(i=1;i<=n_pti_val;i++) 
        glVertex2f(vt[i],fbasepsi0[i]);  
    glEnd(); 
  
    glColor3f(1.0,0.0,0.0); 
    glBegin(GL_POINTS); 
    for(i=1;i<=n_pti_val;i++) 
        glVertex2f(vt[i],fbasepsi1[i]);  
    glEnd(); 
    glFlush(); 
  
    glMatrixMode(GL_PROJECTION);   
    glLoadIdentity();   
    gluOrtho2D(0.0, WINH, 0.0, WINH); 
    glViewport(0,0,WINH,WINH); 
} 
예제 #29
0
파일: model.cpp 프로젝트: ALPSCore/ALPSCore
    model_error_case()
        : acc_(2)
        , model_()
    {
        Eigen::VectorXd phi0(2), veps(2);
        Eigen::MatrixXd phi1(2,2);

        phi0 << 2, 3;
        phi1 << .80, 0, 0, .64;
        veps << 1.0, 0.25;
        model_ = alps::alea::util::var1_model<double>(phi0, phi1, veps);
    }
  Vector7d manipulablityG(const Vector7d& phi, const double m0, const double ks) {
	  const double h = 0.0000001;
	  Vector7d tau;
	  Vector7d phi0;
	  Vector7d phi1;
	  for (unsigned int i = 0; i < 7; i++) {
		  phi0 = phi1 = phi;
		  phi0(i) -= h;
		  phi1(i) += h;
		  tau(i) = (manipulablityV(phi1, m0, ks) - manipulablityV(phi0, m0, ks))/(2.0*h);
	  }
	  return tau;
  }