Surface NMR forward modelling
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

KernelV0.cpp 22KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /* This file is part of Lemma, a geophysical modelling and inversion API.
  2. * More information is available at http://lemmasoftware.org
  3. */
  4. /* This Source Code Form is subject to the terms of the Mozilla Public
  5. * License, v. 2.0. If a copy of the MPL was not distributed with this
  6. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. */
  8. /**
  9. * @file
  10. * @date 11/11/2016 01:47:25 PM
  11. * @version $Id$
  12. * @author Trevor Irons (ti)
  13. * @email tirons@egi.utah.edu
  14. * @copyright Copyright (c) 2016, University of Utah
  15. * @copyright Copyright (c) 2016, Lemma Software, LLC
  16. */
  17. #include "KernelV0.h"
  18. #include "FieldPoints.h"
  19. namespace Lemma {
  20. // ==================== FRIEND METHODS =====================
  21. std::ostream &operator << (std::ostream &stream, const KernelV0 &ob) {
  22. stream << ob.Serialize() << "\n---\n"; // End of doc ---
  23. return stream;
  24. }
  25. // ==================== LIFECYCLE =======================
  26. //--------------------------------------------------------------------------------------
  27. // Class: KernelV0
  28. // Method: KernelV0
  29. // Description: constructor (locked)
  30. //--------------------------------------------------------------------------------------
  31. KernelV0::KernelV0 (const ctor_key&) : LemmaObject( ) {
  32. } // ----- end of method KernelV0::KernelV0 (constructor) -----
  33. //--------------------------------------------------------------------------------------
  34. // Class: KernelV0
  35. // Method: KernelV0
  36. // Description: DeSerializing constructor (locked)
  37. //--------------------------------------------------------------------------------------
  38. KernelV0::KernelV0 (const YAML::Node& node, const ctor_key&) : LemmaObject(node) {
  39. } // ----- end of method KernelV0::KernelV0 (constructor) -----
  40. //--------------------------------------------------------------------------------------
  41. // Class: KernelV0
  42. // Method: NewSP()
  43. // Description: public constructor returing a shared_ptr
  44. //--------------------------------------------------------------------------------------
  45. std::shared_ptr< KernelV0 > KernelV0::NewSP() {
  46. return std::make_shared< KernelV0 >( ctor_key() );
  47. }
  48. //--------------------------------------------------------------------------------------
  49. // Class: KernelV0
  50. // Method: ~KernelV0
  51. // Description: destructor (protected)
  52. //--------------------------------------------------------------------------------------
  53. KernelV0::~KernelV0 () {
  54. } // ----- end of method KernelV0::~KernelV0 (destructor) -----
  55. //--------------------------------------------------------------------------------------
  56. // Class: KernelV0
  57. // Method: Serialize
  58. //--------------------------------------------------------------------------------------
  59. YAML::Node KernelV0::Serialize ( ) const {
  60. YAML::Node node = LemmaObject::Serialize();
  61. node.SetTag( GetName() );
  62. // Coils Transmitters & Receivers
  63. for ( auto txm : TxRx) {
  64. node[txm.first] = txm.second->Serialize();
  65. }
  66. // LayeredEarthEM
  67. node["SigmaModel"] = SigmaModel->Serialize();
  68. return node;
  69. } // ----- end of method KernelV0::Serialize -----
  70. //--------------------------------------------------------------------------------------
  71. // Class: KernelV0
  72. // Method: DeSerialize
  73. //--------------------------------------------------------------------------------------
  74. std::shared_ptr<KernelV0> KernelV0::DeSerialize ( const YAML::Node& node ) {
  75. if (node.Tag() != "KernelV0" ) {
  76. throw DeSerializeTypeMismatch( "KernelV0", node.Tag());
  77. }
  78. return std::make_shared< KernelV0 > ( node, ctor_key() );
  79. } // ----- end of method KernelV0::DeSerialize -----
  80. //--------------------------------------------------------------------------------------
  81. // Class: KernelV0
  82. // Method: DeSerialize
  83. //--------------------------------------------------------------------------------------
  84. void KernelV0::CalculateK0 (const std::vector< std::string>& Tx, const std::vector<std::string >& Rx,
  85. bool vtkOutput ) {
  86. // All EM calculations will share same field points
  87. cpoints = FieldPoints::NewSP();
  88. cpoints->SetNumberOfPoints(8);
  89. for (auto tx : Tx) {
  90. // Set up EMEarth
  91. EMEarths[tx] = EMEarth1D::NewSP();
  92. EMEarths[tx]->AttachWireAntenna(TxRx[tx]);
  93. EMEarths[tx]->AttachLayeredEarthEM(SigmaModel);
  94. EMEarths[tx]->AttachFieldPoints( cpoints );
  95. EMEarths[tx]->SetFieldsToCalculate(H);
  96. // TODO query for method, altough with flat antennae, this is fastest
  97. EMEarths[tx]->SetHankelTransformMethod(ANDERSON801);
  98. EMEarths[tx]->SetTxRxMode(TX);
  99. }
  100. for (auto rx : Rx) {
  101. if (EMEarths.count(rx)) {
  102. EMEarths[rx]->SetTxRxMode(TXRX);
  103. } else {
  104. EMEarths[rx] = EMEarth1D::NewSP();
  105. EMEarths[rx]->AttachWireAntenna(TxRx[rx]);
  106. EMEarths[rx]->AttachLayeredEarthEM(SigmaModel);
  107. EMEarths[rx]->AttachFieldPoints( cpoints );
  108. EMEarths[rx]->SetFieldsToCalculate(H);
  109. // TODO query for method, altough with flat antennae, this is fastest
  110. EMEarths[rx]->SetHankelTransformMethod(ANDERSON801);
  111. EMEarths[rx]->SetTxRxMode(RX);
  112. }
  113. }
  114. IntegrateOnOctreeGrid( 1e-13, vtkOutput );
  115. }
  116. //--------------------------------------------------------------------------------------
  117. // Class: KernelV0
  118. // Method: IntegrateOnOctreeGrid
  119. //--------------------------------------------------------------------------------------
  120. void KernelV0::IntegrateOnOctreeGrid( const Real& tolerance, bool vtkOutput) {
  121. this->tol = tolerance;
  122. //Vector3r Size;
  123. Size << 200,200,2;
  124. //Vector3r Origin;
  125. Origin << 0,0,5.0;
  126. Vector3r cpos; // centre position
  127. //cpos << 100,100,50;
  128. cpos = (Size-Origin).array() / 2.;
  129. int maxlevel;
  130. SUM = 0;
  131. VOLSUM = 0;
  132. nleaves = 0;
  133. if (!vtkOutput) {
  134. EvaluateKids( Size, 0, cpos, 1e6 );
  135. } else {
  136. #ifdef LEMMAUSEVTK
  137. vtkHyperOctree* oct = vtkHyperOctree::New();
  138. oct->SetDimension(3);
  139. oct->SetOrigin( Origin(0), Origin(1), Origin(2) );
  140. oct->SetSize( Size(0), Size(1), Size(2) );
  141. vtkHyperOctreeCursor* curse = oct->NewCellCursor();
  142. curse->ToRoot();
  143. EvaluateKids2( Size, 0, cpos, 1e6, oct, curse );
  144. // Fill in leaf data
  145. vtkDoubleArray* kr = vtkDoubleArray::New();
  146. kr->SetNumberOfComponents(1);
  147. kr->SetName("Re($K_0$)");
  148. kr->SetNumberOfTuples( oct->GetNumberOfLeaves() );
  149. vtkDoubleArray* ki = vtkDoubleArray::New();
  150. ki->SetNumberOfComponents(1);
  151. ki->SetName("Im($K_0$)");
  152. ki->SetNumberOfTuples( oct->GetNumberOfLeaves() );
  153. vtkDoubleArray* km = vtkDoubleArray::New();
  154. km->SetNumberOfComponents(1);
  155. km->SetName("mod($K_0$)");
  156. km->SetNumberOfTuples( oct->GetNumberOfLeaves() );
  157. vtkIntArray* kid = vtkIntArray::New();
  158. kid->SetNumberOfComponents(1);
  159. kid->SetName("ID");
  160. kid->SetNumberOfTuples( oct->GetNumberOfLeaves() );
  161. //vtkDoubleArray* kerr = vtkDoubleArray::New();
  162. // kerr->SetNumberOfComponents(1);
  163. // kerr->SetName("Error");
  164. for (auto leaf : LeafDict) {
  165. kr->InsertTuple1( leaf.first, std::real(leaf.second) );
  166. ki->InsertTuple1( leaf.first, std::imag(leaf.second) );
  167. kid->InsertTuple1( leaf.first, leaf.first );
  168. }
  169. //for (auto leaf : LeafDictErr) {
  170. // kerr->InsertTuple1( leaf.first, std::imag(leaf.second) );
  171. //}
  172. oct->GetLeafData()->AddArray(kr);
  173. oct->GetLeafData()->AddArray(ki);
  174. oct->GetLeafData()->AddArray(km);
  175. oct->GetLeafData()->AddArray(kid);
  176. //oct->GetLeafData()->AddArray(kerr);
  177. auto write = vtkXMLHyperOctreeWriter::New();
  178. //write.SetDataModeToAscii()
  179. write->SetInputData(oct);
  180. write->SetFileName("octree.vto");
  181. write->Write();
  182. write->Delete();
  183. //kerr->Delete();
  184. kid->Delete();
  185. kr->Delete();
  186. ki->Delete();
  187. km->Delete();
  188. curse->Delete();
  189. oct->Delete();
  190. #else
  191. throw std::runtime_error("IntegrateOnOctreeGrid with vtkOutput requires Lemma with VTK support");
  192. #endif
  193. }
  194. std::cout << "\nVOLSUM=" << VOLSUM << "\tActual=" << Size(0)*Size(1)*Size(2)
  195. << "\tDifference=" << VOLSUM - (Size(0)*Size(1)*Size(2)) << std::endl;
  196. std::cout << "nleaves\t" << nleaves << std::endl;
  197. std::cout << "KSUM\t" << SUM << std::endl;
  198. }
  199. //--------------------------------------------------------------------------------------
  200. // Class: KernelV0
  201. // Method: f
  202. //--------------------------------------------------------------------------------------
  203. Complex KernelV0::f( const Vector3r& r, const Real& volume, const Vector3cr& Ht, const Vector3cr& Hr ) {
  204. //return Complex(volume*Ht.dot(Hr));
  205. return ComputeV0Cell(MU0*Ht, MU0*Hr, volume, 1.0);
  206. }
  207. //--------------------------------------------------------------------------------------
  208. // Class: KernelV0
  209. // Method: ComputeV0Cell
  210. //--------------------------------------------------------------------------------------
  211. Complex KernelV0::ComputeV0Cell(const Vector3cr& Bt,
  212. const Vector3cr& Br, const Real& vol, const Real& phi) {
  213. // Compute the elliptic fields
  214. Vector3r B0hat = SigmaModel->GetMagneticFieldUnitVector();
  215. Vector3r B0 = SigmaModel->GetMagneticField();
  216. // Elliptic representation
  217. EllipticB EBT = EllipticFieldRep(Bt, B0hat);
  218. EllipticB EBR = EllipticFieldRep(Br, B0hat);
  219. // Compute Mn0
  220. Vector3r Mn0 = ComputeMn0(phi, B0);
  221. Real Mn0Abs = Mn0.norm();
  222. Real Taup = 0.020; // s
  223. Real Ip = 10; // A
  224. // Compute the tipping angle
  225. Real sintheta = std::sin(0.5*GAMMA*Ip*Taup*std::abs(EBT.alpha-EBT.beta));
  226. // Compute phase delay, TODO add transmiiter phase and delay time phase!
  227. Real phase = EBR.zeta+EBT.zeta;
  228. return ComputeV0Cell(EBT, EBR, sintheta, phase, Mn0Abs, vol);
  229. }
  230. //--------------------------------------------------------------------------------------
  231. // Class: KernelV0
  232. // Method: ComputeV0Cell
  233. //--------------------------------------------------------------------------------------
  234. Complex KernelV0::ComputeV0Cell(const EllipticB& EBT, const EllipticB& EBR,
  235. const Real& sintheta, const Real& phase, const Real& Mn0Abs,
  236. const Real& vol) {
  237. Vector3r B0hat = {1,0,0};
  238. Real Larmor = 2500.*2.*PI;
  239. // earth response of receiver adjoint field
  240. Complex ejztr = std::exp(Complex(0, EBR.zeta + EBT.zeta));
  241. Complex PhaseTerm = EBR.bhat.dot(EBT.bhat) +
  242. (B0hat.dot(EBR.bhat.cross(EBT.bhat) ));
  243. return -vol*Complex(0,Larmor)*Mn0Abs*(EBR.alpha+EBR.beta)*ejztr*sintheta*PhaseTerm;
  244. }
  245. //--------------------------------------------------------------------------------------
  246. // Class: KernelV0
  247. // Method: ComputeV0Cell
  248. //--------------------------------------------------------------------------------------
  249. Vector3r KernelV0::ComputeMn0(const Real& Porosity, const Vector3r& B0) {
  250. Real chi_n = NH2O*((GAMMA*GAMMA*HBAR*HBAR)/(4.*KB*Temperature));
  251. return chi_n*Porosity*B0;
  252. }
  253. //--------------------------------------------------------------------------------------
  254. // Class: KernelV0
  255. // Method: ComputeV0Cell
  256. //--------------------------------------------------------------------------------------
  257. EllipticB KernelV0::EllipticFieldRep (const Vector3cr& B, const Vector3r& B0hat) {
  258. EllipticB ElipB = EllipticB();
  259. Vector3cr Bperp = B.array() - B0hat.dot(B)*B0hat.array();
  260. Real BperpNorm = Bperp.norm();
  261. Complex Bp2 = Bperp.transpose() * Bperp;
  262. VectorXcr iB0 = Complex(0,1)*B0hat.cast<Complex>().array();
  263. ElipB.eizt = std::sqrt(Bp2 / std::abs(Bp2));
  264. ElipB.alpha = INVSQRT2*std::sqrt(BperpNorm*BperpNorm + std::abs(Bp2));
  265. ElipB.beta = sgn(std::real(iB0.dot(Bperp.cross(Bperp.conjugate())))) *
  266. (INVSQRT2)*std::sqrt(std::abs(BperpNorm*BperpNorm-std::abs(Bp2)));
  267. ElipB.bhat = ((Real)1./ElipB.alpha)*(((Real)1./ElipB.eizt)*Bperp.array()).real().array();
  268. ElipB.bhatp = B0hat.cross(ElipB.bhat);
  269. ElipB.zeta = std::real(std::log(ElipB.eizt)/Complex(0,1));
  270. return ElipB;
  271. }
  272. //--------------------------------------------------------------------------------------
  273. // Class: KernelV0
  274. // Method: EvaluateKids
  275. //--------------------------------------------------------------------------------------
  276. bool KernelV0::EvaluateKids( const Vector3r& size, const int& level, const Vector3r& cpos,
  277. const Complex& parentVal ) {
  278. std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
  279. std::cout.flush();
  280. // Next level step, interested in one level below
  281. // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
  282. Vector3r step = size.array() / (Real)(1 << (level+1) );
  283. Vector3r step2 = size.array() / (Real)(1 << (level+2) );
  284. Real vol = (step2(0)*step2(1)*step2(2)); // volume of each child
  285. Vector3r pos = cpos - step/2.;
  286. Eigen::Matrix<Real, 8, 3> posadd = (Eigen::Matrix<Real, 8, 3>() <<
  287. 0, 0, 0,
  288. step[0], 0, 0,
  289. 0, step[1], 0,
  290. step[0], step[1], 0,
  291. 0, 0, step[2],
  292. step[0], 0, step[2],
  293. 0, step[1], step[2],
  294. step[0], step[1], step[2] ).finished();
  295. VectorXcr kvals(8); // individual kernel vals
  296. cpoints->ClearFields();
  297. for (int ichild=0; ichild<8; ++ichild) {
  298. Vector3r cp = pos; // Eigen complains about combining these
  299. cp += posadd.row(ichild);
  300. cpoints->SetLocation( ichild, cp );
  301. }
  302. Eigen::Matrix<Complex, 3, 8> Ht = Eigen::Matrix<Complex, 3, 8>::Zero();
  303. Eigen::Matrix<Complex, 3, 8> Hr = Eigen::Matrix<Complex, 3, 8>::Zero();
  304. //Eigen::Matrix< Complex, 8, 3 > Bt;
  305. for ( auto EMCalc : EMEarths ) {
  306. //EMCalc->GetFieldPoints()->ClearFields();
  307. EMCalc.second->CalculateWireAntennaFields();
  308. switch (EMCalc.second->GetTxRxMode()) {
  309. case TX:
  310. Ht += EMCalc.second->GetFieldPoints()->GetHfield(0);
  311. break;
  312. case RX:
  313. Hr += EMCalc.second->GetFieldPoints()->GetHfield(0);
  314. break;
  315. case TXRX:
  316. Ht += EMCalc.second->GetFieldPoints()->GetHfield(0);
  317. Hr += EMCalc.second->GetFieldPoints()->GetHfield(0);
  318. break;
  319. default:
  320. break;
  321. }
  322. }
  323. for (int ichild=0; ichild<8; ++ichild) {
  324. Vector3r cp = pos; // Eigen complains about combining these
  325. cp += posadd.row(ichild);
  326. kvals(ichild) = f(cp, vol, Ht.col(ichild), Hr.col(ichild));
  327. }
  328. Complex ksum = kvals.sum(); // Kernel sum
  329. // Evaluate whether or not furthur splitting is needed
  330. if ( std::abs(ksum - parentVal) > tol || level < 2 ) {
  331. for (int ichild=0; ichild<8; ++ichild) {
  332. Vector3r cp = pos; // Eigen complains about combining these
  333. cp += posadd.row(ichild);
  334. bool isleaf = EvaluateKids( size, level+1, cp, kvals(ichild) );
  335. if (isleaf) { // Include result in final integral
  336. SUM += ksum;
  337. VOLSUM += 8.*vol;
  338. nleaves += 1;
  339. }
  340. }
  341. return false; // not leaf
  342. }
  343. // Save here instead?
  344. return true; // leaf
  345. }
  346. #ifdef LEMMAUSEVTK
  347. //--------------------------------------------------------------------------------------
  348. // Class: KernelV0
  349. // Method: EvaluateKids2 -- same as Evaluate Kids, but include VTK octree generation
  350. //--------------------------------------------------------------------------------------
  351. bool KernelV0::EvaluateKids2( const Vector3r& size, const int& level, const Vector3r& cpos,
  352. const Complex& parentVal, vtkHyperOctree* oct, vtkHyperOctreeCursor* curse) {
  353. std::cout << "\r" << (int)(1e2*VOLSUM/(Size[0]*Size[1]*Size[2])) << "\t" << nleaves;
  354. std::cout.flush();
  355. // Next level step, interested in one level below
  356. // bitshift requires one extra, faster than, and equivalent to std::pow(2, level+1)
  357. Vector3r step = size.array() / (Real)(1 << (level+1) );
  358. Vector3r step2 = size.array() / (Real)(1 << (level+2) );
  359. Real vol = (step2(0)*step2(1)*step2(2)); // volume of each child
  360. Vector3r pos = cpos - step/2.;
  361. Eigen::Matrix<Real, 8, 3> posadd = (Eigen::Matrix<Real, 8, 3>() <<
  362. 0, 0, 0,
  363. step[0], 0, 0,
  364. 0, step[1], 0,
  365. step[0], step[1], 0,
  366. 0, 0, step[2],
  367. step[0], 0, step[2],
  368. 0, step[1], step[2],
  369. step[0], step[1], step[2] ).finished();
  370. VectorXcr kvals(8); // individual kernel vals
  371. cpoints->ClearFields();
  372. for (int ichild=0; ichild<8; ++ichild) {
  373. Vector3r cp = pos; // Eigen complains about combining these
  374. cp += posadd.row(ichild);
  375. cpoints->SetLocation( ichild, cp );
  376. }
  377. Eigen::Matrix<Complex, 3, 8> Ht = Eigen::Matrix<Complex, 3, 8>::Zero();
  378. Eigen::Matrix<Complex, 3, 8> Hr = Eigen::Matrix<Complex, 3, 8>::Zero();
  379. for ( auto EMCalc : EMEarths ) {
  380. //EMCalc->GetFieldPoints()->ClearFields();
  381. EMCalc.second->CalculateWireAntennaFields();
  382. switch (EMCalc.second->GetTxRxMode()) {
  383. case TX:
  384. Ht += EMCalc.second->GetFieldPoints()->GetHfield(0);
  385. break;
  386. case RX:
  387. Hr += EMCalc.second->GetFieldPoints()->GetHfield(0);
  388. break;
  389. case TXRX:
  390. Ht += EMCalc.second->GetFieldPoints()->GetHfield(0);
  391. Hr += EMCalc.second->GetFieldPoints()->GetHfield(0);
  392. break;
  393. default:
  394. break;
  395. }
  396. }
  397. for (int ichild=0; ichild<8; ++ichild) {
  398. Vector3r cp = pos; // Eigen complains about combining these
  399. cp += posadd.row(ichild);
  400. kvals(ichild) = f(cp, vol, Ht.col(ichild), Hr.col(ichild));
  401. }
  402. Complex ksum = kvals.sum(); // Kernel sum
  403. // Evaluate whether or not furthur splitting is needed
  404. if ( std::abs(ksum - parentVal) > tol || level < 2 ) {
  405. oct->SubdivideLeaf(curse);
  406. for (int ichild=0; ichild<8; ++ichild) {
  407. curse->ToChild(ichild);
  408. Vector3r cp = pos; // Eigen complains about combining these
  409. cp += posadd.row(ichild);
  410. /* Test for position via alternative means
  411. Real p[3];
  412. GetPosition(curse, p);
  413. std::cout << cp[0] << "\t" << p[0] << "\t" << cp[1] << "\t" << p[1]
  414. << "\t" << cp[2] << "\t" << p[2] << "\t" << vol<< std::endl;
  415. */
  416. bool isleaf = EvaluateKids2( size, level+1, cp, kvals(ichild), oct, curse );
  417. if (isleaf) { // Include result in final integral
  418. LeafDict[curse->GetLeafId()] = kvals(ichild); // VTK
  419. SUM += ksum;
  420. VOLSUM += 8*vol;
  421. nleaves += 1;
  422. }
  423. curse->ToParent();
  424. }
  425. return false; // not leaf
  426. }
  427. return true; // leaf
  428. }
  429. //--------------------------------------------------------------------------------------
  430. // Class: KernelV0
  431. // Method: GetPosition
  432. //--------------------------------------------------------------------------------------
  433. void KernelV0::GetPosition( vtkHyperOctreeCursor* Cursor, Real* p ) {
  434. Real ratio=1.0/(1<<(Cursor->GetCurrentLevel()));
  435. //step = ((Size).array() / std::pow(2.,Cursor->GetCurrentLevel()));
  436. p[0]=(Cursor->GetIndex(0)+.5)*ratio*this->Size[0]+this->Origin[0] ;//+ .5*step[0];
  437. p[1]=(Cursor->GetIndex(1)+.5)*ratio*this->Size[1]+this->Origin[1] ;//+ .5*step[1];
  438. p[2]=(Cursor->GetIndex(2)+.5)*ratio*this->Size[2]+this->Origin[2] ;//+ .5*step[2];
  439. }
  440. #endif
  441. } // ---- end of namespace Lemma ----
  442. /* vim: set tabstop=4 expandtab */
  443. /* vim: set filetype=cpp */