Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87758716
manifold_torus.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Oct 14, 19:41
Size
814 B
Mime Type
text/x-c
Expires
Wed, Oct 16, 19:41 (2 d)
Engine
blob
Format
Raw Data
Handle
21652139
Attached To
rLAMMPS lammps
manifold_torus.cpp
View Options
#include "manifold_torus.h"
#include <math.h>
using namespace LAMMPS_NS;
using namespace user_manifold;
manifold_torus::manifold_torus( LAMMPS *lmp, int argc, char **argv ) : manifold(lmp)
{}
double manifold_torus::g( const double *x )
{
double R = params[0];
double r = params[1];
if( R < r ){
error->all(FLERR,"Large radius < small radius!");
}
double rad = sqrt(x[0]*x[0] + x[1]*x[1]);
double c = R - rad;
return c*c + x[2]*x[2] - r*r;
}
void manifold_torus::n( const double *x, double *n )
{
double R = params[0];
double r = params[1];
if( R < r ){
error->all(FLERR,"Large radius < small radius!");
}
double rad = sqrt(x[0]*x[0] + x[1]*x[1]);
double c = R - rad;
double fac = c / rad;
n[0] = -2.0 * fac * x[0];
n[1] = -2.0 * fac * x[1];
n[2] = 2.0 * x[2];
}
Event Timeline
Log In to Comment