00001 // copyright by benedikt oswald, all rights reserved, 2002-2006. 00002 // project - aqhdes2003 00003 // file name - newinternalsrc.h 00004 // file type - C include file 00005 // objective - define NUMPROC for internal source aka excitation of the em problem 00006 // creation - 2003 oct 07 ~ 14:45:00 by benedikt oswald 00007 // modified - 2004 feb 18 ~ 15:40:00 by holger gerhards 00008 // modified - 2004 mar 23 ~ 15:21:00 by benedikt oswald, integrated into parallel version 00009 // required software - UG 3.1 or higher 00010 // rights for UG - cf. paper by Bastian et al., 1997 00011 // file id - 00012 // inheritance - iinternalsrc.h 00013 // feature - defines the NUMPROCS required for the implementation of 00014 // feature - internal excitation of the electric field governed 00015 // feature - by the curl-curl equation for the electric field 00016 // feature - with the implicit solver its, implemented in itdi.h and itdi,c 00017 00018 // hint - only some modifications on names 00019 00020 #ifndef __INTERNAL_SOURCE__ 00021 #define __INTERNAL_SOURCE__ 00022 00023 // include standard header files 00024 #include <math.h> 00025 #include <stdlib.h> 00026 #include <stdio.h> 00027 #include <string.h> 00028 00029 // include UG header files 00030 #include "gm.h" /* for data structure */ 00031 #include "shapes.h" /* general element shape calculations */ 00032 #include "ugstruct.h" /* for GetStringValue */ 00033 #include "misc.h" /* for MIN, MAX, PI, ... */ 00034 #include "ugdevices.h" /* for UserWrite, PrintErrorMessage */ 00035 #include "commands.h" /* for GetCurrentMultigrid */ 00036 #include "cmdint.h" /* for CreateCommand */ 00037 #include "cmdline.h" /* for command line processing */ 00038 #include "general.h" /* for general desclarations */ 00039 #include "np.h" /* for NUMPROC implementation */ 00040 #include "assemble.h" /* for CreateCLASS implementation */ 00041 00042 // proprietary includes 00043 #include "whitney.h" /* include Whitney base function definitions and procedures */ 00044 #include "tdwaveforms.h" /* time domain shapes of excitation: gaussian etc. */ 00045 #include "aqhdSysParams.h" /* get system parameters from standard include file */ 00046 #include "aqhdReleaseInfo.h" /* get release information */ 00047 #include "aqhdPhysicoMath.h" /* get mathematical & physical constants */ 00048 #include "aqhdBaseTypes.h" /* get mathematical & physical constants */ 00049 #include "auxiliary.h" 00050 00051 /****************************************************************************/ 00052 /* */ 00053 /* defines in the following order */ 00054 /* */ 00055 /* compile time constants defining static data size (i.e. arrays) */ 00056 /* other constants */ 00057 /* macros */ 00058 /* */ 00059 /****************************************************************************/ 00060 00061 #define IMPLICIT_INTERNAL_SOURCE_CLASS_NAME "internal_source" 00062 00063 /****************************************************************************/ 00064 /* */ 00065 /* data structures used in this source file (exported data structures are */ 00066 /* in the corresponding include file!) */ 00067 /* */ 00068 /****************************************************************************/ 00069 00070 /* declare NUMPROC class and methods for internal voltage or current density source */ 00071 struct np_implicit_internal_source 00072 { 00073 NP_BASE base; // inherits base class 00074 00075 DOUBLE a0; // amplitude of source, ampere per square meter 00076 DOUBLE timedelay; // right shift of time domain waveform 00077 DOUBLE gspread; // variance s in Gaussian 00078 DOUBLE f0; // center frequency of sine modulated Gaussian pulse 00079 00080 DOUBLE srcloc[DIM]; // source location 00081 DOUBLE jdir[DIM]; // vector of current density direction 00082 DOUBLE antlen; // length of antenna centered at srcloc[DIM] 00083 00084 INT source; // code for source type 00085 char sourcetype[MAX_NUM_CHAR_FILENAME]; // string containing source type 00086 char tdshape[MAX_NUM_CHAR_FILENAME]; // string containing time domain shape description 00087 char fnsrcoutput[MAX_NUM_CHAR_FILENAME]; // string containing filename of source output file 00088 00089 INT fl; // from level with respect to multigrid 00090 INT tl; // to level with respect to multigrid 00091 00092 ELEMENT *theElement; // pointer to element containing source location 00093 00094 VECDATA_DESC* force; // pointer to excitation aka force vector 00095 00096 00097 // function adapts the discrete system obtained from the FE approach 00098 // by setting the respective coefficients of the involved matrices 00099 DOUBLE (*ImplicitInternalSourceSetup)(struct np_implicit_internal_source *); 00100 00101 // function calculates the value of the time domain excitation and 00102 // and adapts the right hand side of the linear system to be solved 00103 DOUBLE (*ImplicitInternalSourceUpdate)(struct np_implicit_internal_source *, DOUBLE); 00104 00105 }; 00106 typedef struct np_implicit_internal_source NP_IMPLICIT_INTERNAL_SOURCE; 00107 00108 /****************************************************************************/ 00109 /* */ 00110 /* definition of exported global variables */ 00111 /* */ 00112 /****************************************************************************/ 00113 00114 /****************************************************************************/ 00115 /* */ 00116 /* definition of variables global to this source file only (static!) */ 00117 /* */ 00118 /****************************************************************************/ 00119 00120 /****************************************************************************/ 00121 /* */ 00122 /* forward declarations of functions used before they are defined */ 00123 /* */ 00124 /****************************************************************************/ 00125 00126 /****************************************************************************/ 00127 /****************************************************************************/ 00128 /* */ 00129 /****************************************************************************/ 00130 /****************************************************************************/ 00131 00132 INT InitImplicitInternalSource(void); 00133 00134 #endif 00135 00136 00137 00138