https://github.com/geodynamics/citcoms
Tip revision: c59234914a80773a2b9b69b63279df4dddff34ad authored by Eh Tan on 26 April 2007, 01:19:04 UTC
Move branches/CitcomS/ to tags/pre-2.0 since no development will be done in this branch.
Move branches/CitcomS/ to tags/pre-2.0 since no development will be done in this branch.
Tip revision: c592349
Geometry_cartesian.c
#include <math.h>
#include "element_definitions.h"
#include "global_defs.h"
void set_2dc_defaults(E)
struct All_variables *E;
{
E->mesh.nsd = 2;
E->mesh.dof = 2;
}
void set_2pt5dc_defaults(E)
struct All_variables *E;
{
E->mesh.nsd = 2;
E->mesh.dof = 3;
}
void set_3dc_defaults(E)
struct All_variables *E;
{
E->mesh.nsd = 3;
E->mesh.dof = 3;
}
void set_3dsphere_defaults(E)
struct All_variables *E;
{
int i,j;
double offset;
int m=E->parallel.me;
E->mesh.nsd = 3;
E->mesh.dof = 3;
E->sphere.caps = 12;
E->sphere.max_connections = 6;
input_double("radius_outer",&(E->sphere.ro),"essential",m);
input_double("radius_inner",&(E->sphere.ri),"essential",m);
offset = 10.0/180.0*M_PI;
for (i=1;i<=4;i++) {
E->sphere.cap[(i-1)*3+1].theta[1] = 0.0;
E->sphere.cap[(i-1)*3+1].theta[2] = M_PI/4.0+offset;
E->sphere.cap[(i-1)*3+1].theta[3] = M_PI/2.0;
E->sphere.cap[(i-1)*3+1].theta[4] = M_PI/4.0+offset;
E->sphere.cap[(i-1)*3+1].fi[1] = 0.0;
E->sphere.cap[(i-1)*3+1].fi[2] = (i-1)*M_PI/2.0;
E->sphere.cap[(i-1)*3+1].fi[3] = (i-1)*M_PI/2.0 + M_PI/4.0;
E->sphere.cap[(i-1)*3+1].fi[4] = i*M_PI/2.0;
E->sphere.cap[(i-1)*3+2].theta[1] = M_PI/4.0+offset;
E->sphere.cap[(i-1)*3+2].theta[2] = M_PI/2.0;
E->sphere.cap[(i-1)*3+2].theta[3] = 3*M_PI/4.0-offset;
E->sphere.cap[(i-1)*3+2].theta[4] = M_PI/2.0;
E->sphere.cap[(i-1)*3+2].fi[1] = i*M_PI/2.0;
E->sphere.cap[(i-1)*3+2].fi[2] = i*M_PI/2.0 - M_PI/4.0;
E->sphere.cap[(i-1)*3+2].fi[3] = i*M_PI/2.0;
E->sphere.cap[(i-1)*3+2].fi[4] = i*M_PI/2.0 + M_PI/4.0;
}
for (i=1;i<=4;i++) {
j = (i-1)*3;
if (i==1) j=12;
E->sphere.cap[j].theta[1] = M_PI/2.0;
E->sphere.cap[j].theta[2] = 3*M_PI/4.0-offset;
E->sphere.cap[j].theta[3] = M_PI;
E->sphere.cap[j].theta[4] = 3*M_PI/4.0-offset;
E->sphere.cap[j].fi[1] = (i-1)*M_PI/2.0 + M_PI/4.0;
E->sphere.cap[j].fi[2] = (i-1)*M_PI/2.0;
E->sphere.cap[j].fi[3] = 0.0;
E->sphere.cap[j].fi[4] = i*M_PI/2.0;
}
return;
}