//sets initial particle positions
    void setupInitialConditions()
    {
        //centrifugal acc. a=v^2/R;
        Mdouble R = 4.0;
        BaseParticle p;
        p.setSpecies(speciesHandler.getObject(0));
        p.setRadius(0.5);
        p.setPosition({R,0.5,0});
        particleHandler.copyAndAddObject(p);

        p.setRadius(0.5);
        p.setPosition({R,-0.5,0});
        //p.setVelocity({-sqrt(R)*s,sqrt(R)*c,0});
        p.setAngularVelocity({0,0,1});
        particleHandler.copyAndAddObject(p);
    }
    void setupInitialConditions()
	{
        relVelocity_ = 1e-1;
        setSystemDimensions(3);
        setParticleDimensions(3);
        setGravity(Vec3D(0,0,0));
        setTimeStep(5e-6 / 2.0);
        Mdouble R = 1e-3;
        setXMax( 2*R);
        setYMax(   R);
        setZMax(   R);
        setXMin(-2*R);
        setYMin(-R);
        setZMin(-R);

        species->setDensity(2000.0);
        species->setLoadingStiffness(1e2);
        species->setUnloadingStiffnessMax(1.5* species->getLoadingStiffness());
        species->setCohesionStiffness(species->getLoadingStiffness());
        species->setPenetrationDepthMax(0.05);
        species->setAdhesionStiffness(1e2);
        species->setAdhesionForceMax(1e-5*species->getAdhesionStiffness());
        species->setSlidingStiffness(1.2e1);
        species->setSlidingFrictionCoefficient(0.01);

        particleHandler.clear();
		BaseParticle P;
		P.setRadius(R);
        
		P.setPosition(Vec3D(-R-species->getInteractionDistance()/3,0,0));
		P.setVelocity(Vec3D(relVelocity_/2,0,0));
		particleHandler.copyAndAddObject(P);
		P.setPosition(Vec3D(R+species->getInteractionDistance()/3,0,0));
		P.setVelocity(Vec3D(-relVelocity_/2,0,0));
		particleHandler.copyAndAddObject(P);
        setName("AdhesiveForceUnitTest_ParticleParticleInteractionWithPlasticForces");
        setTimeMax(getTimeStep()*250*5);
        setFileType(FileType::ONE_FILE);
        setSaveCount(1);

    }
void AttackParticlePolicy::emitt()
{
    BaseParticle Particle = *this->emitter;
    Vec3 origPos = Particle.getPosition();

    float posX = origPos.x;
    float posY = origPos.y;
    float posZ = origPos.z;

    float dirX;
    float dirY;
    float dirZ;

    for(int i = 0; i < intensity; i++)
    {
        dirX = (float)rand() / (float)RAND_MAX -0.5f;
        dirY = (float)rand() / (float)RAND_MAX -0.5f;
        dirZ = (float)rand() / (float)RAND_MAX -0.5f;

        if(direction.x > 0)
        {
            direction.x += ((float)rand() / (float)RAND_MAX -0.1f);
        }
        else
        {
            direction.x -= ((float)rand() / (float)RAND_MAX -0.1f);
        }

        if(direction.z > 0)
        {
            direction.z += ((float)rand() / (float)RAND_MAX -0.1f);
        }
        else
        {
            direction.z -= ((float)rand() / (float)RAND_MAX -0.1f);
        }

        D3DXVec3Normalize(&direction, &direction);

        Particle.setDirection(direction);
        Particle.setPosition(Vec3(posX, posY, posZ));

        particles.insertLast(Particle);
    }
    recreateVertices = true;
}