util.h

Go to the documentation of this file.
00001 /*
00002     This file is part of magpar.
00003 
00004     Copyright (C) 2002-2010 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: util.h 2962 2010-02-04 19:50:44Z scholz $ */
00025 
00026 #ifndef UTIL_H
00027 #define UTIL_H
00028 
00029 #include "griddata.h"
00030 
00031 int ascat(int **aindata,int n_items,int s_item,int *newproc,int insize,int send);
00032 int AreaCal(Mat AIpol, PetscReal *p_area);
00033 int AxesRotation(PetscReal *slice_p,PetscReal *slice_n,PetscReal *axes1,int inv,int n_vert,PetscReal *vertxyz,PetscReal *vertxyz2);
00034 int barycent(PetscReal *p,PetscReal *a,PetscReal *b,PetscReal *c,PetscReal *d,PetscReal *bary);
00035 int bbox2(GridData *gdata,PetscReal *vertxyz2,int n_prop,int *propid,PetscReal *bbox,int *pix);
00036 int calcbbox(int n_ele,int *elevert,int *eleprop,PetscReal *vertxyz2,int n_pids,int *slice_id,PetscReal *bbox);
00037 int Cart2SphereDiff(Vec C,Vec X,Vec S);
00038 int Cart2Sphere(Vec C,Vec S);
00039 int CalAfe2fe(GridData *gdata,PetscReal *shift,int *slice_id,Mat *pAIpol);
00040 int CalAsq2fe(GridData *gdata,PetscReal *vertxyz2,PetscReal *bbox,int *pix,int slice_id,Mat *AIpol);
00041 int CalAfe2sq(GridData *gdata,PetscReal *vertxyz2,PetscReal *bbox,int *pix,int slice_id,Mat *AIpol);
00042 int distint(int from,int to,int a);
00043 int DistortVec(PetscRandom rctx,Vec v,PetscReal distpar);
00044 int DistPointLine(PetscReal *point,PetscReal *linepoint,PetscReal *linevec,PetscReal *dist);
00045 PetscScalar getscalf(PetscReal tfdata[],PetscReal time);
00046 int matcreateseqadj(int nvert,int nele,int *elevert,Mat *mat);
00047 int matviewstruct(MPI_Comm comm,Mat mat);
00048 int Mesh2Dual(int n_ele, int n_vert, int *elevert, int **ia, int **ja);
00049 int Mesh2Dual2(int n_ele, int n_vert, int *elevert, int **ia, int **ja);
00050 int Mesh2Nodal(int n_ele, int n_vert, int *elevert, int **ia, int **ja);
00051 int Mesh2VertEle(int n_ele, int n_vert, int *elevert, int **ia, int **ja);
00052 int PointFromPlane(PetscReal *x, PetscReal *v1, PetscReal *v2, PetscReal *v3, PetscReal *d);
00053 int PrintMatInfo(Mat A,MatInfoType flag);
00054 int PrintMatInfoAll(Mat A);
00055 int ProgressBar(int cur,int max,int ival);
00056 int readht(FILE *fd,PetscReal **indata,const int col);
00057 int readxy(FILE *fd,const int colx,const int coly,int *n_rows,PetscReal **indata);
00058 PetscReal RenormVec(Vec v,PetscReal normset,PetscReal normtol,int dim);
00059 int PidSharedArea(GridData *gdata,int pid1,int pid2,PetscReal *sharedarea_area,PetscReal *sharedarea_point,PetscReal *sharedarea_norm);
00060 int SolidAngle(PetscScalar *x,PetscScalar *v1,PetscScalar *v2,PetscScalar *v3,PetscScalar *omega);
00061 int Sphere2Cart(Vec S,Vec C);
00062 int SynchronizedFastFPrintf(FILE *fd,int nchars,int nmax,char *wbufs,PetscTruth zip);
00063 int tetnb(int *tet1, int *tet2, int *vshared);
00064 PetscReal tetvol(PetscReal *x1,PetscReal *x2,PetscReal *x3,PetscReal *x4);
00065 PetscReal triarea(PetscReal *v0,PetscReal *v1,PetscReal *v2,PetscReal *n);
00066 int TetSharedVertices(int *v1,int *v2,int *s);
00067 int VecSetVec(Vec vec,PetscScalar *vec3,int dim);
00068 
00069 #endif

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