Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

kernel-precession.c

Go to the documentation of this file.
00001 /************************************************************************* 00002 * $Id: kernel-precession.c,v 1.5 2005/09/07 07:31:50 yougz Exp $ 00003 ************************************************************************** 00004 This software is governed by the CeCILL license under French law and 00005 abiding by the rules of distribution of free software. You can use, 00006 modify and/ or redistribute the software under the terms of the CeCILL 00007 license as circulated by CEA, CNRS and INRIA at the following URL 00008 "http://www.cecill.info". 00009 00010 As a counterpart to the access to the source code and rights to copy, 00011 modify and redistribute granted by the license, users are provided only 00012 with a limited warranty and the software's author, the holder of the 00013 economic rights, and the successive licensors have only limited 00014 liability. 00015 00016 In this respect, the user's attention is drawn to the risks associated 00017 with loading, using, modifying and/or developing or reproducing the 00018 software by the user in light of its specific status of free software, 00019 that may mean that it is complicated to manipulate, and that also 00020 therefore means that it is reserved for developers and experienced 00021 professionals having in-depth computer knowledge. Users are therefore 00022 encouraged to load and test the software's suitability as regards their 00023 requirements in conditions enabling the security of their systems and/or 00024 data to be ensured and, more generally, to use and operate it in the 00025 same conditions as regards security. 00026 00027 The fact that you are presently reading this means that you have had 00028 knowledge of the CeCILL license and that you accept its terms. 00029 00030 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00031 l'Image). All rights reserved. See License.txt for details. 00032 00033 Version 1.0 05/09/2005 00034 *************************************************************************/ 00035 #include "kernel-precession.h" 00036 00045 void KernelPrecession(EXPERIENCE3D * expr, EVENT * event) 00046 { 00047 double x, y, z,edw,dw; 00048 double p6x, p6y, p6z, p9x, p9y, p9z; 00049 double e1, e2, teta, rmnx, r1, r2; 00050 int ix, iy, iz; 00051 int xmin; 00052 int xmax; 00053 00054 #ifdef HAVE_MPI 00055 if (expr->mpi_slice_x0 == -1) { 00056 xmin = 0; 00057 xmax = expr->nfovx; 00058 } else { 00059 xmin = expr->mpi_slice_x0; 00060 xmax = xmin+mpi_get_slice_width(expr, xmin); 00061 } 00062 #else 00063 xmin = 0; 00064 xmax = expr->nfovx; 00065 #endif 00066 00067 /* 00068 * waiting a acq_delay time 00069 */ 00070 if (event->acq_delay) { 00071 expr->to =(expr->to + event->acq_delay); 00072 p6x = G * event->ax; 00073 p9x = expr->xf + expr->obx - event->axoff; 00074 p6y = G * event->ay; 00075 p9y = expr->yf + expr->oby - event->ayoff; 00076 p6z = G * event->az; 00077 p9z = expr->zf + expr->obz - event->azoff; 00078 00079 for (ix = xmin; ix < xmax; ix++) { 00080 for (iy = expr->nfovy - 1; iy >= 0; iy--) { 00081 for (iz = expr->nfovz - 1; iz >= 0; iz--) { 00082 x = expr->px * ix - p9x; 00083 y = expr->py * iy - p9y; 00084 z = expr->pz * iz - p9z; 00085 // dw = (p6x * x) + (p6y * y) + (p6z * z) - (expr->G_edw) + G_rad_T*expr->G_deche[ix][iy][iz]; 00086 edw = expr->G_edw *(expr->B0+1.*(event->ax*x + event->ay*y + event->az*z) + expr->G_deche[ix][iy][iz]); 00087 dw = G_rad_T*(event->ax*x + event->ay*y + event->az*z + expr->G_deche[ix][iy][iz])- edw; 00088 teta = dw * event->acq_delay; /* tr= event->acq_delay; */ 00089 e1 = exp(-event->acq_delay / expr->t1[ix][iy][iz]); 00090 e2 = exp(-event->acq_delay / expr->t2[ix][iy][iz]); 00091 r1 = e2 * cos(teta); 00092 r2 = e2 * sin(teta); 00093 rmnx = 00094 r1 * expr->magstate[0][ix][iy][iz] + 00095 r2 * expr->magstate[1][ix][iy][iz]; 00096 expr->magstate[1][ix][iy][iz] = 00097 -r2 * expr->magstate[0][ix][iy][iz] + 00098 r1 * expr->magstate[1][ix][iy][iz]; 00099 expr->magstate[2][ix][iy][iz] = 00100 e1 * expr->magstate[2][ix][iy][iz] + 00101 expr->ro[ix][iy][iz] * (1 - e1); 00102 expr->magstate[0][ix][iy][iz] = rmnx; 00103 } 00104 } 00105 } 00106 } 00107 }

Generated on Wed Oct 19 09:28:34 2005 for SIMRI3D by doxygen 1.3.7