API documentation
World.cpp
Go to the documentation of this file.
00001 00005 /* 00006 * JEMRIS Copyright (C) 2007-2010 Tony Stöcker, Kaveh Vahedipour 00007 * Forschungszentrum Jülich, Germany 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 */ 00023 00024 #include "World.h" 00025 #include "Model.h" 00026 00027 00028 World* World::m_instance = 0; 00029 00030 /***********************************************************/ 00031 World* World::instance() { 00032 00033 if (m_instance == 0) { 00034 00035 m_instance = new World(); 00036 00037 00038 m_instance->time = 0.0; 00039 m_instance->total_time = 0.0; 00040 m_instance->phase = -1.0; 00041 m_instance->deltaB = 0.0; 00042 m_instance->GMAXoverB0 = 0.0; 00043 m_instance->NonLinGradField = 0.0; 00044 m_instance->RandNoise = 0.0; 00045 m_instance->saveEvolStepSize = 0; 00046 m_instance->saveEvolFileName = ""; 00047 m_instance->saveEvolOfstream = NULL; 00048 m_instance->saveEvolFunPtr = &Model::saveEvolution; 00049 m_instance->solverSuccess = true; 00050 m_instance->m_noofpools = 1; 00051 00052 00053 m_instance->pAtom = NULL; 00054 m_instance->pStaticAtom = NULL; 00055 m_instance->pAtom = NULL; 00056 00057 for (int i=0; i<3; i++) 00058 m_instance->solution[i] = 0.0; 00059 00060 for (int i=0; i<NO_SPIN_PROPERTIES; i++) 00061 m_instance->InitValues[i] = 0.0; 00062 00063 m_instance->Values = m_instance->InitValues; 00064 00065 m_instance->m_myRank = -1; 00066 m_instance->m_useLoadBalancing = true; 00067 m_instance->m_no_processes = 1; /* default: serial jemris */ 00068 m_instance->m_startSpin = 0; 00069 } 00070 00071 return m_instance; 00072 00073 } 00074 00075 /***********************************************************/ 00076 double World::ConcomitantField (double* G) { 00077 00078 if (GMAXoverB0==0.0) return 0.0; 00079 return ((0.5*GMAXoverB0)*(pow(G[0]*Values[ZC]-0.5*G[2]*Values[XC],2) + pow(G[1]*Values[ZC]-0.5*G[2]*Values[YC],2))) ; 00080 00081 };
