Beispiel #1
0
screw buoyancy::on()
{
    const Eigen::Vector3d f = q.conjugate() * Eigen::Vector3d(0, 0, -s);
    const Eigen::Vector3d t(x.cross(f));

    return screw(f, t);
}
Beispiel #2
0
screw drag::on()
{
    const double vs = (q.conjugate() * v + w.cross(x)).dot(n);
    // Fd = .5 * p * v^2 * c * a
    // assume p (mass density) of pool water is 1 g/cm^3
    // though who knows what might be in there...
    // the force should be opposite the direction of velocity
    double f = (vs > 0 ? -1 : 1) * 0.5 * 1000 * pow(vs, 2) * c * a;
    return screw(n * f, t * f);
}
Beispiel #3
0
char * ban_it(char *nick, char *user, char *host, char *ip)
{
static char banstr[BIG_BUFFER_SIZE/4+1];
char *t = user;
char *t1 = user;
char *tmp;
	
	*banstr = 0;
	while (strlen(t1)>9)
		t1++;
	t1 = clear_server_flags(t1);
	switch (defban) 
	{
		case 7:
			if (ip)
			{
				snprintf(banstr, sizeof banstr, "*!*@%s",
					cluster(ip));
				break;
			}
		case 2: /* Better 	*/
			snprintf(banstr, sizeof banstr, "*!*%s@%s", t1, 
				cluster(host));
			break;
		case 3: /* Host 	*/
			snprintf(banstr, sizeof banstr, "*!*@%s", host);
			break;
		case 4: /* Domain	*/
			tmp = strrchr(host, '.');
			if (tmp) {
				snprintf(banstr, sizeof banstr, "*!*@*%s",
					tmp);
			} else {
				snprintf(banstr, sizeof banstr, "*!*@%s", 
					host);
			}
			break;	
		case 5: /* User		*/
			snprintf(banstr, sizeof banstr, "*!%s@%s", t, 
				cluster(host));
			break;
		case 6: /* Screw 	*/
			snprintf(banstr, sizeof banstr, "*!*%s@%s", t1, host);
			screw(banstr);
			break;
		case 1:	/* Normal 	*/
		default:
			snprintf(banstr, sizeof banstr, "%s!*%s@%s", nick, t1,
				host);
			break;
	}
	return banstr;
}
Beispiel #4
0
screw turbulence::on(entity_id id)
{
    return screw(f, t);
}
Beispiel #5
0
screw gravity::on(entity_id id)
{
    return screw(Eigen::Vector3d(0, 0, w.get_entity(id).get_m() * 9.81), Eigen::Vector3d(0, 0, 0));
}
Beispiel #6
0
    void setupInitialConditions()
    {
        speciesHandler.copyAndAddObject(LinearViscoelasticSpecies());
		
        Coil coil(Vec3D(0.1, 0.2, 0.3), 0.4, 0.5, 0.6, 0.7, 0.8);
        
        CylindricalWall cylindricalWall;
        cylindricalWall.set(0.1);
        
        AxisymmetricIntersectionOfWalls axisymmetricIntersectionOfWalls;
        axisymmetricIntersectionOfWalls.setPosition(Vec3D(0.1,0.2,0.3));
        axisymmetricIntersectionOfWalls.setOrientation(Vec3D(0.4,0.5,0.6));
        axisymmetricIntersectionOfWalls.addObject(Vec3D(0.7,0.8,0.9),0.11*Vec3D(0.7,0.8,0.9));

        IntersectionOfWalls intersectionOfWalls;
        intersectionOfWalls.addObject(Vec3D(0.1, 0.2, 0.3), Vec3D(0.4, 0.5, 0.6));
        
        InfiniteWall infiniteWall;
        infiniteWall.set(Vec3D(0.1, 0.2, 0.3), 0.4*Vec3D(0.1, 0.2, 0.3));
        
        InfiniteWallWithHole infiniteWallWithHole;
        infiniteWallWithHole.set(Vec3D(0.1, 0.2, 0.3), 0.4, 0.5);
        
        Screw screw(Vec3D(0.1, 0.2, 0.3), 0.4, 0.5, 0.6, 0.7, 0.8);
        
        wallHandler.copyAndAddObject(coil);
        wallHandler.copyAndAddObject(cylindricalWall);
        wallHandler.copyAndAddObject(axisymmetricIntersectionOfWalls);
        wallHandler.copyAndAddObject(intersectionOfWalls);
        wallHandler.copyAndAddObject(infiniteWall);
        wallHandler.copyAndAddObject(infiniteWallWithHole);
        wallHandler.copyAndAddObject(screw);
        
        AngledPeriodicBoundary angledPeriodicBoundary;
        angledPeriodicBoundary.set(Vec3D(0.1, 0.2, 0.3), Vec3D(0.4, 0.5, 0.6), Vec3D(0.7, 0.8, 0.9));

        ChuteInsertionBoundary chuteInsertionBoundary;
        chuteInsertionBoundary.set(new BaseParticle, 13, Vec3D(0.1, 0.2, 0.3), Vec3D(0.4, 0.5, 0.6), 0.33, 0.44, 0.55, 1.1, 1.2);

        CubeInsertionBoundary cubeInsertionBoundary;
        cubeInsertionBoundary.set(new BaseParticle, 13, Vec3D(0.1, 0.2, 0.3), Vec3D(0.4, 0.5, 0.6), Vec3D(0.11, 0.22, 0.33), Vec3D(0.44, 0.55, 0.66), 0.77, 0.88);

        HopperInsertionBoundary hopperInsertionBoundary;
        hopperInsertionBoundary.set(new BaseParticle, 13, 0.2, 0.3, 0.66, 0.77, 3.1, 0.69, false, 3, 0.11, 0.21, 0.09, 2.31, 0.001, 30);

        PeriodicBoundary periodicBoundary;
        periodicBoundary.set(Vec3D(0.1, 0.2, 0.3), 1.1, 2.2, Vec3D(0.4, 0.5, 0.6));

        CircularPeriodicBoundary circularPeriodicBoundary(0.3);

        DeletionBoundary deletionBoundary;
        deletionBoundary.set(Vec3D(0.1, 0.2, 0.3), 3.14);
        
        LeesEdwardsBoundary leesEdwardsBoundary;
		leesEdwardsBoundary.set(
            [&] (double time UNUSED){
                return 0.1;},
            [&] (double time UNUSED) {
                return 0.2;},
            0.3,0.4,0.5,0.6);

        boundaryHandler.copyAndAddObject(angledPeriodicBoundary);
        boundaryHandler.copyAndAddObject(chuteInsertionBoundary);
        boundaryHandler.copyAndAddObject(cubeInsertionBoundary);
        boundaryHandler.copyAndAddObject(hopperInsertionBoundary);
        boundaryHandler.copyAndAddObject(periodicBoundary);
        boundaryHandler.copyAndAddObject(circularPeriodicBoundary);
        boundaryHandler.copyAndAddObject(deletionBoundary);
        boundaryHandler.copyAndAddObject(leesEdwardsBoundary);
        
        BaseParticle baseParticle;
        particleHandler.copyAndAddObject(baseParticle);
        
    }