contains functions defining virtual vessels
More...
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <math.h>
#include <inttypes.h>
#include "global.h"
Go to the source code of this file.
contains functions defining virtual vessels
Definition in file vessel.c.
This functions builds a tube vessel from spheres.
Definition at line 38 of file vessel.c.
References cells, csize, lnc, MPIrank, nx, ny, nz, cellData::size, x, cellData::x, cellData::y, and cellData::z.
55 startPoint[0] =
nx / 2.0;
56 startPoint[1] =
ny / 2.0;
57 startPoint[2] = 0.05 *
nz;
63 t = sqrt(direction[0] * direction[0] + direction[1] * direction[1] +
64 direction[2] * direction[2]);
66 direction[0] /= t * 2 *
csize * (1.0 - intersect);
67 direction[1] /= t * 2 *
csize * (1.0 - intersect);
68 direction[2] /= t * 2 *
csize * (1.0 - intersect);
75 (2 *
csize * (1.0 - intersect)) / (2 *
77 (
double) nEndothelial));
78 printf(
"circumradius=%f\n", circumradius);
80 nRings = lenght / (2 *
csize * (1.0 - intersect));
82 printf(
"nRings=%d\n", nRings);
83 printf(
"lnc=%" PRId64
"\n",
lnc);
85 angle = (360 / nEndothelial) * (M_PI / 180);
93 for (i = 0; i < nRings; i++) {
94 point[0] = startPoint[0];
95 point[1] = startPoint[1];
96 point[2] = startPoint[2];
97 for (j = 0; j < nEndothelial; j++) {
103 radius[0] = x * cos(alpha) - y * sin(alpha);
104 radius[1] = x * sin(alpha) + y * cos(alpha);
106 t = sqrt(pow(radius[0], 2) + pow(radius[1], 2) +
111 radius[2] = i *
csize * (1.0 - intersect);
112 cells[
lnc].
x = point[0] + circumradius * radius[0];
113 cells[
lnc].
y = point[1] + circumradius * radius[1];