openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
filament.h
Go to the documentation of this file.
1 #ifndef FILAMENT_H
2 #define FILAMENT_H
3 
4 #include "vect.h"
5 #include <vector>
6 #include "IGBheader.h"
7 
8 #define log_msg(F,L,O,...) fprintf( stderr, __VA_ARGS__ )
9 
10 /*
11  * This file is used for testing the local FEM routines
12  */
13 
17 
18 typedef struct _PS {
19  int type;
20  int eIndx;
22 } PS;
23 
24 typedef struct _FilSeg {
25  int type;
26  int eIndx;
30 
31 typedef union _singularity {
32  PS ps;
35 
36 
37 #define BLOCK_ALLOC 1000
38 class filament {
39  public:
40  void add_singularity( singularity *s, int );
41  int num_segs(){ return (int)s.size(); }
42  int num_pts(){ return numPts; }
43  int numPts=0;
44  std::vector<singularity> s;
45  void sort();
46 };
47 
48 typedef struct NodeList {
52 
53 struct Elem {
55  int Nnode;
56  int *N;
57 };
58 
59 typedef struct ElemList {
63 
65 // copied from CARP/ioutils.h
66 typedef struct {
67  const char *dname;
68  FILE *data;
69  float **d;
70  int dsize;
71  int numSamps;
72  int nodes;
73  int h_wdth;
74  int wdth;
75  int buffered;
76  float **dr;
77  int rwdth;
78  float rdist;
79  float t;
80  float dt_in;
81  bool filled;
83 } tbuffer;
84 
85 #ifdef __cplusplus
86 extern "C" {
87 #endif
88 
89 // prototypes
90 int init_filament_IO(const char *meshname, int numT, FILE *fh[]);
91 void write_filaments(filament *f, FILE *fh[],float t);
92 int write_connections(ElemList *elst,NodeList *nlst,filament *f,FILE *filHdls[],float t);
93 int write_elems_martin(ElemList *elst, NodeList *nlst, filament *f, FILE *filHdls[],float t);
94 void close_filament_IO(FILE *fh[]);
95 
96 void interpolateTBuffer(tbuffer *tbf);
97 void interpolate_vm(int numNodes,float **d,int M,float **rd,float rDist);
98 bool compute_filament(float *d0, float *d1, float vth, ElemList *elst,
99  NodeList *nlst, filament *f, SingularityDetector_t meth);
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif
int Integer
Definition: DataTypes.h:15
int numPts
Definition: filament.h:43
int num_segs()
Definition: filament.h:41
int num_pts()
Definition: filament.h:42
void sort()
Definition: filament.cc:253
void add_singularity(singularity *s, int)
Definition: filament.cc:244
std::vector< singularity > s
Definition: filament.h:44
SingularityDetector_t
Definition: filament.h:14
@ face_based
Definition: filament.h:14
@ vol_based
Definition: filament.h:14
int init_filament_IO(const char *meshname, int numT, FILE *fh[])
Definition: filament.cc:270
struct _FilSeg FilSeg
struct ElemList ElemList
int write_connections(ElemList *elst, NodeList *nlst, filament *f, FILE *filHdls[], float t)
Definition: filament.cc:309
void interpolate_vm(int numNodes, float **d, int M, float **rd, float rDist)
Definition: filament.cc:147
void interpolateTBuffer(tbuffer *tbf)
Definition: filament.cc:124
void close_filament_IO(FILE *fh[])
Definition: filament.cc:414
int write_elems_martin(ElemList *elst, NodeList *nlst, filament *f, FILE *filHdls[], float t)
void write_filaments(filament *f, FILE *fh[], float t)
Definition: filament.cc:348
bool compute_filament(float *d0, float *d1, float vth, ElemList *elst, NodeList *nlst, filament *f, SingularityDetector_t meth)
Definition: filament.cc:171
struct NodeList NodeList
struct _PS PS
union _singularity singularity
singularity_t
Definition: filament.h:15
@ FilamentSegment
Definition: filament.h:15
@ PhaseSingularity
Definition: filament.h:15
Elem_t
Definition: filament.h:16
@ PyramidBubble
Definition: filament.h:16
@ PrismBubble
Definition: filament.h:16
@ QuadBubble
Definition: filament.h:16
@ Line
Definition: filament.h:16
@ Quad
Definition: filament.h:16
@ TriP2
Definition: filament.h:16
@ HexaBubble
Definition: filament.h:16
@ TetraBubble
Definition: filament.h:16
@ TetP2
Definition: filament.h:16
@ Octa
Definition: filament.h:16
@ Prism
Definition: filament.h:16
@ TriBubble
Definition: filament.h:16
@ Pyramid
Definition: filament.h:16
@ Tri
Definition: filament.h:16
@ Tetra
Definition: filament.h:16
@ Hexa
Definition: filament.h:16
vec3< POINT_REAL > Point
Definition: vect.h:93
Integer NElems
number of elements (owned+ghost in case of LOCAL_ELEM)
Definition: filament.h:60
Elem * Ele
Definition: filament.h:61
Definition: filament.h:53
Elem_t type
Definition: filament.h:54
int Nnode
Definition: filament.h:55
int * N
Definition: filament.h:56
Point * Node
list of nodes*
Definition: filament.h:49
Integer NNodes
number of global nodes*
Definition: filament.h:50
Point p1
Definition: filament.h:28
Point p0
Definition: filament.h:27
int eIndx
Definition: filament.h:26
int type
Definition: filament.h:25
Definition: filament.h:18
int type
Definition: filament.h:19
Point p0
Definition: filament.h:21
int eIndx
Definition: filament.h:20
time slice buffer for post processing
Definition: filament.h:66
float ** dr
resampled data buffer
Definition: filament.h:76
int wdth
width of buffer, always 2*h_wdth+1
Definition: filament.h:74
int h_wdth
half width of sample buffer
Definition: filament.h:73
float t
time
Definition: filament.h:79
IGBheader * igb
IGB file reader.
Definition: filament.h:82
FILE * data
file hdl
Definition: filament.h:68
float dt_in
temporal sampling of input data
Definition: filament.h:80
int rwdth
width of resampling buffer
Definition: filament.h:77
int dsize
size of data tokens in bytes
Definition: filament.h:70
bool filled
is buffer fully loaded?
Definition: filament.h:81
const char * dname
name of data input file
Definition: filament.h:67
int numSamps
number of time slices in file
Definition: filament.h:71
float ** d
data buffer
Definition: filament.h:69
float rdist
rel dist of sample to center
Definition: filament.h:78
int nodes
number of nodes in time slice
Definition: filament.h:72
int buffered
number of samples in buffer
Definition: filament.h:75
FilSeg fs
Definition: filament.h:33