00001 // copyright by benedikt oswald, all rights reserved, 2002-2006. 00002 // rights - universitas ruperto carola heidelbergensis 00003 // project - aqhdes2003 00004 // file name - abc1stdisc.h 00005 // file type - C include file 00006 // objective - implement the functions to discretized the Galerkin 00007 // objective - form of the curl-curl equation 00008 // creation - 2004 jan 28 ~ 20:03:00 by benedikt oswald 00009 // modified - 2003 jun 11 ~ 00:03:01 by benedikt oswald 00010 // required software - UG 3.1 or higher 00011 // rights for UG - cf. paper by Bastian et al., 1997 00012 // file id - 00013 // inheritance - idiscretization.h 00014 // feature - implements the NUMPROC abc1st et al., to discretize the Galerkin 00015 // feature - form of the curl-curl equation, cf. Jianming Jin's 00016 // feature - book on finite elements in computational electromagnetics, 00017 // feature - pp. 530ff, for the electric field; 00018 00019 /****************************************************************************/ 00020 /* */ 00021 /* include files */ 00022 /* system include files */ 00023 /* application include files */ 00024 /* */ 00025 /****************************************************************************/ 00026 00027 #ifndef __ABC1ST__ 00028 #define __ABC1ST__ 00029 00030 // include standard C header files 00031 #include <math.h> 00032 #include <stdlib.h> 00033 #include <stdio.h> 00034 #include <string.h> 00035 00036 // include UG header files 00037 #include "gm.h" /* for data structure */ 00038 #include "shapes.h" /* general element shape calculations */ 00039 #include "ugstruct.h" /* for GetStringValue */ 00040 #include "misc.h" /* for MIN, MAX, PI, ... */ 00041 #include "ugdevices.h" /* for UserWrite, PrintErrorMessage */ 00042 #include "commands.h" /* for GetCurrentMultigrid */ 00043 #include "cmdint.h" /* for CreateCommand */ 00044 #include "cmdline.h" /* for command line processing */ 00045 #include "general.h" /* for general desclarations */ 00046 #include "np.h" /* for NUMPROC implementation */ 00047 #include "assemble.h" /* for CreateCLASS implementation */ 00048 #include "compiler.h" 00049 #include "namespace.h" 00050 00051 // include proprietary header files 00052 #include "disconst.h" /* discretization constants */ 00053 #include "tdwaveforms.h" /* time doman source waveforms */ 00054 #include "aqhdSysParams.h" /* get system parameters from standard include file */ 00055 #include "aqhdReleaseInfo.h" /* get release information */ 00056 #include "aqhdPhysicoMath.h" /* get mathematical & physical constants */ 00057 #include "aqhdBaseTypes.h" /* get mathematical & physical constants */ 00058 #include "abc1stdisc.h" /* get discretization of Maxwell equations */ 00059 #include "whitney.h" /* include basis functions */ 00060 #include "linmaterials.h" /* include NUMPROC definitions for linear, non-dispersive materials */ 00061 #include "iinternalsrc.h" /* include NUMPROC definitions for internal excitation aka source */ 00062 #include "auxiliary.h" /* auxiliary functions for matrix output etc. */ 00063 00064 /****************************************************************************/ 00065 /* */ 00066 /* defines in the following order */ 00067 /* */ 00068 /* compile time constants defining static data size (i.e. arrays) */ 00069 /* other constants */ 00070 /* macros */ 00071 /* */ 00072 /****************************************************************************/ 00073 00074 #define T_ABC1ST_CLASS_NAME "abc1stclass" 00075 00076 /****************************************************************************/ 00077 /* */ 00078 /* data structures used in this source file (exported data structures are */ 00079 /* in the corresponding include file!) */ 00080 /* */ 00081 /****************************************************************************/ 00082 00083 /* declare NUMPROC class and methods for 'NP_IMPLICIT_TIME_DOMAIN_INTEGRATION' */ 00084 00085 typedef struct 00086 { 00087 NP_BASE base; // inherits base class 00088 00089 NP_LINEAR_MATERIALS *linmat; // pointer to NUMPROC that provides linear, non-dispersive electrical materials 00090 NP_IMPLICIT_INTERNAL_SOURCE *iinternalsrc; // pointer to NUMPROCE that provides internal source for the electric field 00091 00092 DOUBLE dt; // time step for explicit scheme 00093 DOUBLE t; // current time 00094 00095 INT fl; // from level with respect to multigrid 00096 INT tl; // to level with respect to multigrid 00097 00098 VECDATA_DESC* efldp; // pointer to electric field vector at t_(n+1) 00099 VECDATA_DESC* efldn; // pointer to electric field vector at t_n 00100 VECDATA_DESC* efldm; // pointer to electric field vector at t_(m-1) 00101 00102 VECDATA_DESC* rhs; // pointer to right hand side vector 00103 VECDATA_DESC* force; // pointer to excitation aka force vector 00104 00105 MATDATA_DESC* tmat; // pointer to [T_ij] matrix structure 00106 MATDATA_DESC* rmat; // pointer to [R_ij] matrix structure 00107 MATDATA_DESC* qmat; // pointer to [Q_ij] matrix structure 00108 MATDATA_DESC* smat; // pointer to [S_ij] matrix structure 00109 00110 MATDATA_DESC* amat; // pointer to matrix A in final system A * x = rhs 00111 00112 VECDATA_DESC* hv1; // pointer to auxiliary vector, used in implicit time update scheme 00113 VECDATA_DESC* hv2; // pointer to auxiliary vector, used in implicit time update scheme 00114 00115 MATDATA_DESC* hmat1; // pointer to auxiliary matrix structure, used in implicit time update scheme 00116 MATDATA_DESC* hmat2; // pointer to auxiliary matrix structure, used in implicit time update scheme 00117 00118 INT (*Assemble)(NP_BASE *base, INT, char**); // pointer to Assembling function 00119 INT (*PreProcess)(NP_BASE *base, INT, char**); // pointer to PreProcessing function 00120 INT (*PostProcess)(NP_BASE *base, INT, char**); // pointer to PostProcessing function 00121 00122 } NP_ABC1ST_SOLVER; 00123 00124 00125 /****************************************************************************/ 00126 /* */ 00127 /* definition of exported global variables */ 00128 /* */ 00129 /****************************************************************************/ 00130 00131 /****************************************************************************/ 00132 /* */ 00133 /* definition of variables global to this source file only (static!) */ 00134 /* */ 00135 /****************************************************************************/ 00136 00137 /****************************************************************************/ 00138 /* */ 00139 /* forward declarations of functions used before they are defined */ 00140 /* */ 00141 /****************************************************************************/ 00142 00143 00144 00145 /****************************************************************************/ 00146 /****************************************************************************/ 00147 /* Discretization */ 00148 /****************************************************************************/ 00149 /****************************************************************************/ 00150 00151 INT InitABC1st(void); /* check class & methods into UG */ 00152 00153 00154 #endif 00155