llg.h

Go to the documentation of this file.
00001 /*
00002     This file is part of magpar.
00003 
00004     Copyright (C) 2002-2009 Werner Scholz
00005 
00006     www:   http://www.magpar.net/
00007     email: magpar(at)magpar.net
00008 
00009     magpar 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     magpar 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 magpar; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 /* $Id: llg.h 2681 2009-07-31 04:30:53Z scholz $ */
00025 
00026 #ifndef LLG_H
00027 #define LLG_H
00028 
00029 #include "griddata.h"
00030 
00031 #ifdef SUNDIALS_VERSION
00032 
00033 #if SUNDIALS_VERSION < 230
00034 #error "SUNDIALS versions lower/older than 2.3.0 are not supported"
00035 #endif
00036 
00037 #ifdef UNIPROC
00038 #include "nvector/nvector_serial.h"       /* definitions of type N_Vector, macro N_VDATA for serial version */
00039 #else
00040 #include "nvector/nvector_parallel.h"     /* definitions of type N_Vector, macro N_VDATA for parallel version */
00041 #endif
00042 
00043 #include "sundials/sundials_types.h"      /* definitions of real, integer, boole, TRUE,FALSE */
00044 #include "cvode/cvode.h"                  /* main CVODE header file */
00045 #include "sundials/sundials_spgmr.h"      /* use CVSPGMR linear solver each internal step */
00046 #include "sundials/sundials_dense.h"      /* use generic DENSE solver in preconditioning */
00047 #include "sundials/sundials_math.h"       /* contains SQR macro */
00048 
00049 int RHSfunction(realtype t,N_Vector u,N_Vector udot,void *f_data);
00050 int PSolve(realtype t,N_Vector y,N_Vector fy,N_Vector r,N_Vector z,realtype gamma,realtype delta,int lr,void *P_data,N_Vector vtemp);
00051 int Precond(realtype t,N_Vector y,N_Vector fy,booleantype jok,booleantype *jcurPtr,realtype gamma,void *P_data,N_Vector vtemp1,N_Vector vtemp2,N_Vector vtemp3);
00052 int Jtimes(N_Vector v,N_Vector Jv,realtype t,N_Vector y,N_Vector fy,void *jac_data,N_Vector tmp);
00053 
00054 int WriteLogPVodeInit(GridData *gdata);
00055 int WriteLogPVode(GridData *gdata);
00056 
00057 int CheckIterationLLG(GridData *gdata);
00058 int EquilCheck(GridData *gdata);
00059 int myTSCreatePVode(GridData *gdata);
00060 int myTSStepPVode(GridData *gdata);
00061 int Precond_Init(GridData *gdata);
00062 int PVodeInit(GridData *gdata);
00063 int PVodeReInit(GridData *gdata);
00064 
00065 #endif
00066 
00067 int myLLGJacobian(TS ts,PetscReal t,Vec global_in,Mat *AA,Mat *BB,MatStructure *str,void *ctx);
00068 int calc_dMdt(TS ts,PetscReal dt,Vec invec,Vec outvec,void *ptr);
00069 
00070 #endif

magpar - Parallel Finite Element Micromagnetics Package
Copyright (C) 2002-2009 Werner Scholz