all_pml.h

00001 // copyright by benedikt oswald, all rights reserved, 2002-2006.
00002 // project - aqhdes2003
00003 // file name - all_pml.h
00004 // file type - C include file
00005 // objective - defines all structures, the numproc and makros
00006 // creation - 2004 mar 11 by holger gerhards
00007 // modified - 2004 may 11 by holger gerhards, including timestep
00008 // required software - UG 3.1 or higher
00009 // rights for UG - cf. paper by Bastian et al., 1997
00010 // file id -
00011 // inheritance - apml.h
00012 // feature - 
00013 
00014 
00015 #ifndef __ALL_PML__
00016 #define __ALL_PML__
00017 
00018 #include <math.h>
00019 #include <stdlib.h>
00020 #include <stdio.h>
00021 #include <string.h>
00022 
00023 #include "gm.h"                             /* for data structure                 */
00024 #include "shapes.h"                         /* general element shape calculations */
00025 #include "ugstruct.h"                       /* for GetStringValue                 */
00026 #include "misc.h"                           /* for MIN, MAX, PI, ...              */
00027 #include "ugdevices.h"                      /* for UserWrite, PrintErrorMessage   */
00028 #include "commands.h"                       /* for GetCurrentMultigrid            */
00029 #include "cmdint.h"                         /* for CreateCommand                  */
00030 #include "cmdline.h"                        /* for command line processing        */
00031 #include "general.h"                        /* for general desclarations          */
00032 #include "np.h"                             /* for NUMPROC implementation         */
00033 #include "assemble.h"                       /* for CreateCLASS implementation     */
00034 #include "parallel.h"
00035 
00036 // proprietary includes
00037 #include "disconst.h"
00038 #include "tdwaveforms.h"
00039 #include "aqhdSysParams.h"
00040 #include "aqhdReleaseInfo.h"
00041 #include "aqhdPhysicoMath.h"
00042 #include "aqhdBaseTypes.h"
00043 #include "whitney.h"
00044 #include "linmaterials.h"
00045 #include "iinternalsrc.h"
00046 #include "auxiliary.h"
00047 
00048 /********* definition of constants ************/
00049 
00050 /* return constants */
00051 #define PML_BAD    1   
00052 #define PML_OK     0
00053 #define TIME_METHOD_BAD 3
00054 #define PML_METHOD_BAD  3
00055 #define BOUNDARY_BAD    3
00056 #define PML_NO_CONNECTION 2
00057 
00058 
00059 /* ... without words ... */
00060 #define NUM_OF_BOUNDARY_SEGMENTS  6
00061 
00062 /* some strings */
00063 #define NEWMARK_METHOD      "newmark"
00064 #define CENTRAL_DIFFERENCE  "central"
00065 
00066 #define PML_TYPE_CONST       "constant"
00067 #define PML_TYPE_LINEAR      "linear"
00068 #define NO_PML_TYPE          "pmlfree"
00069 
00070 #define PEC_BOUNDARY         "pec"
00071 #define ABC_BOUNDARY         "abc"
00072 
00073 #define T_PML_SOLVER_CLASS_NAME "pmlclass"
00074 #define CONV_CLASS_NAME "conv"
00075 
00076 /* order of Gau�-Quatrature for convolution */
00077 #define CONV_GQ_ORDR  4
00078 #define QUAD_POINTS  15 /* Zahl ist abh�ngig von der Ordnung der Quadratur */
00079 
00080 /*************************************************************************/
00081 /* struct for convolution per element in the case of constant parameters */
00082 
00083 typedef struct
00084 {
00085   INT elemid;
00086   
00087   DOUBLE g_i_x[6][QUAD_POINTS];        /* Werte, wenn x-pml-Parameter ungleich null */
00088   DOUBLE g_i_y[6][QUAD_POINTS];        /* Werte, wenn y-pml-Parameter ungleich null */
00089   DOUBLE g_i_z[6][QUAD_POINTS];        /* Werte, wenn z-pml-Parameter ungleich null */
00090   
00091 } CONV_PER_ELEM_POINT_COMP;
00092 
00093 
00094 
00095 /********************************************************************************/
00096 /* struct for convolution per element in the case of linear channging parmaters */
00097 
00098 typedef struct
00099 {
00100   INT elemid;
00101   
00102   DOUBLE psi_j_xi[6][3];
00103   DOUBLE Sx_plus_Tx[6][6];
00104   DOUBLE Sy_plus_Ty[6][6];
00105   DOUBLE Sz_plus_Tz[6][6];
00106 } CONV_PER_ELEM;
00107 
00108 
00109 /**********************************************************************/
00110 /* numproc for pml - includes constant and linear changing parameters */
00111 
00112 typedef struct
00113 {
00114   NP_BASE base;                              // inherits base class
00115 
00116   NP_LINEAR_MATERIALS *linmat;               // provides linear, non-dispersive electrical materials
00117   NP_IMPLICIT_INTERNAL_SOURCE *internalsrc;  // provides internal source for the electric field
00118 
00119   DOUBLE dt;                                 // time step for explicit scheme
00120   DOUBLE t;                                  // current time
00121   INT timestep;                           // timestep * dt = t
00122 
00123   INT fl;                                    // from level with respect to multigrid
00124   INT tl;                                    // to level with respect to multigrid
00125 
00126   char timetype[MAX_NUM_CHAR_FILENAME];      // string containing time-marching-type (central, newmark) 
00127 
00128   DOUBLE beta;                               // newmark parameter
00129   DOUBLE gamma;                              // newmark parameter
00130 
00131   char pmltype[MAX_NUM_CHAR_FILENAME];       // string containing pml-type (constant, linear) 
00132 
00133   char boundary[MAX_NUM_CHAR_FILENAME];      // string containing pec-boundary- or abc-boundary-condition
00134 
00135   INT anzahl;                                // number of elements in pml-domain
00136   CONV_PER_ELEM *eleminfo_c;                 // for local convolution and const. pml-parameter
00137   CONV_PER_ELEM_POINT_COMP *eleminfo;        // for local convolution and linear pml-parameter
00138   
00139   DOUBLE pml_dist_x1;                        // thickness of pml-domain left   
00140   DOUBLE pml_dist_x2;                        // right
00141   DOUBLE pml_dist_y1;                        // front
00142   DOUBLE pml_dist_y2;                        // back
00143   DOUBLE pml_dist_z1;                        // bottom
00144   DOUBLE pml_dist_z2;                        // top
00145 
00146   DOUBLE sig_x1_inner;                       // pml-para. left inner wall 
00147   DOUBLE sig_x1_outer;                       // pml-para. left outer wall  etc.
00148   DOUBLE sig_x2_inner;   
00149   DOUBLE sig_x2_outer;                       // if mode2 = 0, const. pml-param., only inner value is used
00150   DOUBLE sig_y1_inner;   
00151   DOUBLE sig_y1_outer;  
00152   DOUBLE sig_y2_inner;   
00153   DOUBLE sig_y2_outer;  
00154   DOUBLE sig_z1_inner;  
00155   DOUBLE sig_z1_outer; 
00156   DOUBLE sig_z2_inner;  
00157   DOUBLE sig_z2_outer; 
00158 
00159   VECDATA_DESC* efldp;                       // pointer to electric field vector at t_(n+1)
00160   VECDATA_DESC* efldn;                       // pointer to electric field vector at t_n
00161   VECDATA_DESC* efldm;                       // pointer to electric field vector at t_(m-1)
00162   VECDATA_DESC* efldo;                       // pointer to electric field vector at t_(m-2)
00163 
00164   VECDATA_DESC* rhs;                         // pointer to right hand side vector
00165 
00166   VECDATA_DESC* force;                       // pointer to excitation force vector
00167   VECDATA_DESC* forcep;                      // pointer to excitation force vector for timestep n+1
00168   VECDATA_DESC* forcen;                      // pointer to excitation force vector for timestep n
00169   VECDATA_DESC* forcem;                      // pointer to excitation force vector for timestep n-1
00170   
00171   VECDATA_DESC* g_vecp;                      // pointer to convolution vector for timestep n+1
00172   VECDATA_DESC* g_vecn;                      // pointer to convolution vector for timestep n
00173   VECDATA_DESC* g_vecm;                      // pointer to convolution vector for timestep n-1
00174   
00175   MATDATA_DESC* pmat;                        // pointer to leftside matrix structure (in front of efldp)
00176   MATDATA_DESC* nmat;                        // pointer to matrix structure in front of efldn
00177   MATDATA_DESC* mmat;                        // pointer to matrix structure in front of efldm
00178 
00179   MATDATA_DESC* tmat;
00180   MATDATA_DESC* tpmat;
00181   MATDATA_DESC* tqmat;
00182   MATDATA_DESC* smat;
00183   MATDATA_DESC* rmat;
00184   MATDATA_DESC* xmat;
00185 
00186   MATDATA_DESC* hmat;                        // matrix structur for intermediate results
00187   
00188   INT (*Assemble)(NP_BASE *base, INT, char**);          // pointer to Assembling function
00189   INT (*PreProcess)(NP_BASE *base, INT, char**);        // pointer to PreProcessing function
00190   INT (*PostProcess)(NP_BASE *base, INT, char**);       // pointer to PostProcessing function
00191 
00192 } NP_PML_SOLVER;
00193 
00194 
00195 /********************************************************/
00196 /********* function to initialize pml-num-proc **********/
00197 
00198 INT InitPMLTimeIntegration(void);
00199 
00200 /********************************************************/
00201 /********************************************************/
00202 
00203 #endif
00204 
00205 
00206 
00207 
00208 
00209 
00210 
00211 
00212 
00213 
00214 
00215 
00216 
00217  

Generated on Fri Oct 26 14:04:29 2007 for acheron3d by  doxygen 1.4.7