9 #include "determinant.hh" 10 #include "geometry.hh" 11 #include "allocation.hh" 33 double mini[3],maxi[3];
34 double xmin=0,xmax=
nx;
35 double ymin=0,ymax=
ny;
36 double zmin=0,zmax=
nz;
42 cout <<
"creating struts at cell vertices..." << endl;
45 for (i=0; i<sv; i++) {
46 if (
in_domain(vert[i][0],vert[i][1],vert[i][2])) {
48 for (j=0; j<incmax; j++) {
49 if (vinc[i][j] != -1) {
59 xx += pow(vert[vinc[i][l]][m]-vert[i][m],2);
66 tetra[svd][l][
m]=vert[i][
m] + \
67 dstrut/dist[l]*(vert[vinc[i][l]][
m]-\
70 tetra[svd][l][
m]=vert[vinc[i][l]][
m];
81 double **A0,**A1,**A2,**A3,**A4;
84 A0[i] =
new double[4];
87 A1[i] =
new double[4];
90 A2[i] =
new double[4];
93 A3[i] =
new double[4];
96 A4[i] =
new double[4];
97 for (i=0; i<svd; i++) {
98 mini[0]=2*xmax; maxi[0]=-2*xmax;
99 mini[1]=2*ymax; maxi[1]=-2*ymax;
100 mini[2]=2*zmax; maxi[2]=-2*zmax;
101 for (j=0; j<4; j++) {
102 for (k=0; k<3; k++) {
103 if (tetra[i][j][k]<mini[k]) mini[k]=tetra[i][j][k];
104 if (tetra[i][j][k]>maxi[k]) maxi[k]=tetra[i][j][k];
107 for (j=(
int) floor(mini[0]); j<=ceil(maxi[0]); j++)
108 for (k=(
int) floor(mini[1]); k<=ceil(maxi[1]); k++)
109 for (l=(
int) floor(mini[2]); l<=ceil(maxi[2]); l++) {
110 for (m=0; m<4; m++) {
111 for (n=0; n<3; n++) {
112 A0[
m][n]=tetra[i][
m][n];
113 A1[
m][n]=tetra[i][
m][n];
114 A2[
m][n]=tetra[i][
m][n];
115 A3[
m][n]=tetra[i][
m][n];
116 A4[
m][n]=tetra[i][
m][n];
119 for (m=0; m<4; m++) {
126 A1[0][0]=j; A1[0][1]=k; A1[0][2]=l;
127 A2[1][0]=j; A2[1][1]=k; A2[1][2]=l;
128 A3[2][0]=j; A3[2][1]=k; A3[2][2]=l;
129 A4[3][0]=j; A4[3][1]=k; A4[3][2]=l;
140 for (i=0; i<4; ++i)
delete [] A0[i];
142 for (i=0; i<4; ++i)
delete [] A1[i];
144 for (i=0; i<4; ++i)
delete [] A2[i];
146 for (i=0; i<4; ++i)
delete [] A3[i];
148 for (i=0; i<4; ++i)
delete [] A4[i];
double Determinant(double **a, int n)
Recursive function for calculation of determinant.
void makeNodeStruts(int ***amat, int sv, int incmax, int vmax, double **vert, int **vinc, bool report)
double *** alloc_3Ddmatrix(int nx, int ny, int nz)
allocate 3D double matrix
Defines global variables, macros, templates and namespace.
real(dp) dstrut
strut diameter
bool in_domain(double x, double y, double z)
True if the point is in the domain, False otherwise.
m
Bubble Growth Application Recipe.
#define CONFINEZ(x)
Periodic boundary conditions in z.
#define CONFINEY(x)
Periodic boundary conditions in y.
integer nz
spatial discretization
namespace with global variables
#define CONFINEX(x)
Periodic boundary conditions in x.
double *** free_3Ddmatrix(double ***amat)
free 3D double matrix