openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
trace.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) NumeriCor GmbH
2 // SPDX-License-Identifier: LicenseRef-APL-1.1
3 
4 #ifndef TRACE_H
5 #define TRACE_H
6 
7 namespace limpet {
8 
10 struct trace {
11  int N;
12  double *t;
13  float *s;
14  double dur;
15  double dt;
16  bool eqdist;
17 };
18 
19 // trailing underscore added to avoid clash with bidomain.h
20 // Stimulation.c needs to be modified to make use of traces as used in here
22 
23  int read_trace(trace *tr, const char *name );
24  void free_trace(trace *tr);
25  int mk_RRC_trace(trace *tr, float st, float delay, float clamp, float dur);
26  void resample_trace(trace *tr, double dt );
27  void interp1(const double *x, const float *y, int N, double *xi, float *yi, int NI, double dxi, IpMeth_t);
28  double trace_duration(trace *tr, const char* f);
29  void set_trace_amp(trace *tr, float val, float t0=0 );
30 
31 } // namespace limpet
32 
33 #endif
34 
V clamp(const V val, const W start, const W end)
Clamp a value into an interval [start, end].
Definition: kdpart.hpp:117
int mk_RRC_trace(trace *tr, float st, float delay, float clamp, float dur)
make a trace for a repolarization reserve current calculation
Definition: trace.cc:48
double trace_duration(trace *tr, const char *f)
Definition: trace.cc:179
void resample_trace(trace *tr, double dt)
Definition: trace.cc:147
void free_trace(trace *tr)
Definition: trace.cc:108
void set_trace_amp(trace *tr, float val, float whenceforth)
change the amplitude of part of a trace
Definition: trace.cc:28
void interp1(const double *x, const float *y, int N, double *xi, float *yi, int NI, double dxi, IpMeth_t meth)
Definition: trace.cc:221
int read_trace(trace *tr, const char *name)
Definition: trace.cc:75
enum limpet::ip_method IpMeth_t
ip_method
Definition: trace.h:21
@ _NEAREST_IP
Definition: trace.h:21
@ _LINEAR_IP
Definition: trace.h:21
manage input, output, resampling of traces
Definition: trace.h:10
double dt
sampling interval if equidistant samples
Definition: trace.h:15
double dur
duration
Definition: trace.h:14
bool eqdist
sampling intervals are equidistant
Definition: trace.h:16
float * s
samples
Definition: trace.h:13
int N
number of samples
Definition: trace.h:11
double * t
time vector
Definition: trace.h:12