JEMRIS 2.9.2
open-source MRI simulations
Loading...
Searching...
No Matches
TrajectoryDiffusion.h
1/*
2 * TrajectoryDiffusion.h
3 *
4 * Created on: Dec 10, 2009
5 * Author: dpflug
6 */
7
8
9/*
10 * JEMRIS Copyright (C)
11 * 2006-2025 Tony Stoecker
12 * 2007-2018 Kaveh Vahedipour
13 * 2009-2019 Daniel Pflugfelder
14 *
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#ifndef TRAJECTORYDIFFUSION_H_
32#define TRAJECTORYDIFFUSION_H_
33
34#include "TrajectoryInterface.h"
35#include "rng.h"
36#include "XMLIO.h"
37
38
39enum modes{BOTH, INTERNAL, EXTERNAL};
40
41using namespace std;
42
43class Microstructure;
44
46struct triple {
47 double x,y,z;
48};
49
52public:
54 virtual ~TrajectoryDiffusion();
55
56//load diffusion definition file
57 virtual void LoadFile(string filename) ;
58
59 virtual void GetValueDerived(double time, double *pos);
60
61 virtual void UpdateTrajectory(bool init);
62
63 void DumpTrajectory(string filename);
64
65private:
66
67 // xml access functions
68 string GetAttr (DOMElement* element, string key);
69 DOMElement* GetElem (string name);
70
71 void GenerateDiffusionTrajectory();
72 void CalcY(); // calc information for cubic spline interpolation.
73
74 void SetSeed(long seed);
75
76 Microstructure *m_microstruct;
77
78 vector<triple> m_pos;
79 // vector for cubic splines interpolation:
80 vector<triple> m_y;
81
82 unsigned long m_seed;
83 RNG* m_rng;
84
85 double m_timestep;
86 long m_max_timesteps;
87
88 // mode ==0 simulate internal and external, mode ==1 only internal, mode == 2 only external
89 modes m_mode;
90
91 vector<int> m_dump_index; //dump the trajectory of these spins
92
93 int m_diff_dimension; // flag for 3-dimensional, 2-dim or 1-dim diffusion; default: 3-dim
94 void ProjectPosition(triple &pos, triple dir);
95
96 // variables for xml reader:
97 DOMTreeErrorReporter* m_domtree_error_rep;
98 XMLIO* m_xio;
99 DOMDocument* m_dom_doc;
100
101
102};
103
104#endif /* TRAJECTORYDIFFUSION_H_ */
Implementation of JEMRIS TrajectoryInterface.
Implementation of JEMRIS XMLIO.
Microsructure base class.
Definition Microstructure.h:55
Diffusion trajectory of a spin.
Definition TrajectoryDiffusion.h:51
virtual void LoadFile(string filename)
load trajectory from file
Definition TrajectoryDiffusion.cpp:78
virtual void GetValueDerived(double time, double *pos)
retrieve value at given time-point
Definition TrajectoryDiffusion.cpp:569
pure virtual base class for all Trajectories
Definition TrajectoryInterface.h:48
XML file-IO class.
Definition XMLIO.h:61
Cartesians positions for diffusion trajectory of a spin.
Definition TrajectoryDiffusion.h:46

-- last change 03.01.2025 | Tony Stoecker | Imprint | Data Protection --