2Copyright CEA (2014, 2017).
3Copyright Université Paris XI (2014).
5Contributor: Yann Leprince <yann.leprince@ylep.fr>.
6Contributor: Denis Rivière <denis.riviere@cea.fr>.
8This file is part of highres-cortex, a collection of software designed
9to process high-resolution magnetic resonance images of the cerebral
12This software is governed by the CeCILL licence under French law and
13abiding by the rules of distribution of free software. You can use,
14modify and/or redistribute the software under the terms of the CeCILL
15licence as circulated by CEA, CNRS and INRIA at the following URL:
16<http://www.cecill.info/>.
18As a counterpart to the access to the source code and rights to copy,
19modify and redistribute granted by the licence, users are provided only
20with a limited warranty and the software's author, the holder of the
21economic rights, and the successive licensors have only limited
24In this respect, the user's attention is drawn to the risks associated
25with loading, using, modifying and/or developing or reproducing the
26software by the user in light of its specific status of scientific
27software, that may mean that it is complicated to manipulate, and that
28also therefore means that it is reserved for developers and experienced
29professionals having in-depth computer knowledge. Users are therefore
30encouraged to load and test the software's suitability as regards their
31requirements in conditions enabling the security of their systems and/or
32data to be ensured and, more generally, to use and operate it in the
33same conditions as regards security.
35The fact that you are presently reading this means that you have had
36knowledge of the CeCILL licence and that you accept its terms.
45} // end of anonymous namespace
47template <class TVisitor>
50visitor_advection(TVisitor& visitor,
51 const Point3df& start_point) const
57 clog << "yl::Advection::visitor_advection starting at "
58 << start_point << endl;
61 unsigned int iter = 0;
62 Point3df point = start_point;
65 while(visitor.move_on(point)) {
66 if(iter >= m_max_iter) {
68 clog << " advection aborted after " << iter
69 << " iterations: too many iterations." << endl;
75 if(debug_output >= 3 && m_verbose >= 3) {
76 clog << " iteration " << iter << " at " << point << endl;
82 // Move along the field
85 m_vector_field.evaluate(point, local_field);
86 } catch(const Field::UndefinedField&) {
88 clog << " advection aborted after " << iter
89 << " iterations: vector field is undefined at " << point << endl;
97 move_one_step(point, local_field);
98 } catch(const AbnormalField&) {
100 clog << " advection aborted after " << iter
101 << " iterations: vector field is abnormal"
102 " (too small, infinite, or NaN) at "
111 visitor.finished(start_point);
114 clog << " advection finished after " << iter << " iterations" << endl;
116 return !visitor.aborted();