Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
neBEMInterface.h
Go to the documentation of this file.
1#ifndef _neBEMInterface_H_
2#define _neBEMInterface_H_
3
4#ifdef DEFINE_INTFACEGLOBAL
5#define INTFACEGLOBAL
6#else
7#define INTFACEGLOBAL extern
8#endif
9
10#include <stdio.h>
11#include <time.h>
12
13#include "Vector.h"
14
15#ifdef __cplusplus
16namespace neBEM {
17#endif
18
19INTFACEGLOBAL clock_t startClock, stopClock; // time related variables
20
21INTFACEGLOBAL double neBEMTimeElapsed(clock_t, clock_t); // elapsed time
22
23INTFACEGLOBAL int neBEMState; // the state in which neBEM is
24
25// Print relevant messages to stdout device
26INTFACEGLOBAL int neBEMMessage(const char *message);
27
28// return number of lines in a file
29INTFACEGLOBAL int neBEMGetNbOfLines(const char *fname);
30
31// check whether a 3D point is within a 3D plane
32// #define neBEMepsilon 1.0e-12
33#define neBEMtwopi 6.283185307179586476925287
34#define neBEMrtod 57.2957795
35#define MODULUS(p) (sqrt(p.X * p.X + p.Y * p.Y + p.Z * p.Z))
36INTFACEGLOBAL double neBEMChkInPoly(int nvert, Point3D node[], Point3D pt);
37
38// load default values of important global variables
40INTFACEGLOBAL int ReadInitFile(char filename[]);
41
42// Geometry details from files
43// Maintains compatilibity with the older approach
47
48// Number of threads requested
50
53
55INTFACEGLOBAL FILE *fgnuPrim, *fgnuElem, *fgnuMesh; // gnu plot files
56
57// Geometry from Garfield or some other Pre-processor
59
61
63INTFACEGLOBAL int neBEMGetPrimitive(int prim, int *nvertex, double xvert[],
64 double yvert[], double zvert[],
65 double *xnorm, double *ynorm, double *znorm,
66 int *volref1, int *volref2);
67
68INTFACEGLOBAL int neBEMVolumeDescription(int ivol, int *shape, int *material,
69 double *epsilon, double *potential,
70 double *charge, int *boundarytype);
71
72INTFACEGLOBAL int neBEMVolumePoint(double x, double y, double z);
73
74INTFACEGLOBAL void neBEMVolumePrimitives(int volume, int *nprim,
75 int primlist[]);
76
77// Periodicity information from Garfield
78// int prim introduced since V1.03 to allow different periodicities for
79// different primitives
80INTFACEGLOBAL int neBEMGetPeriodicities(int prim, int *ix, int *jx, double *sx,
81 int *iy, int *jy, double *sy, int *iz,
82 int *jz, double *sz);
83
84// Mirror information from Garfield
85// different mirror properties for different primtives are allowed
86INTFACEGLOBAL int neBEMGetMirror(int prim, int *ix, int *jx, double *sx,
87 int *iy, int *jy, double *sy, int *iz, int *jz,
88 double *sz);
89
90// Bounding plane information from Garfield
92 int *ixmin, double *cxmin, double *vxmin, int *ixmax, double *cxmax,
93 double *vxmax, int *iymin, double *cymin, double *vymin, int *iymax,
94 double *cymax, double *vymax, int *izmin, double *czmin, double *vzmin,
95 int *izmax, double *czmax, double *vzmax);
96
97// argument: array containing segment nbs in each dirn
99INTFACEGLOBAL int neBEMDiscretize(int **elementNbs);
100
101// Set boundary condition
103
104// Update the status of the known charge(s) / charge density (ies)
105// within the device.
106// INTFACEGLOBAL int neBEMKnownCharges(int (*Pt2UserFunction)(void));
108
109// Effect of charging up of device elements
111
112// argument: status of matrix inversion (0: not inverted; 1: inverted)
113INTFACEGLOBAL int neBEMSolve(void);
114
115// arguments: a 3D point, potential and flux vector, the last two to be
116// returned by the function
118INTFACEGLOBAL int neBEMField(Point3D *, double *, Vector3D *);
119
120// returns the total charge in a volume
121// the volume identifier is the argument
122INTFACEGLOBAL double neBEMVolumeCharge(int volume);
123
124// Weighting field calculation preparation
125// arguments: number of primitives considered for this weighting field
126// computation and the related list; returns the identification tag for the
127// solution for this weighting field set-up
128INTFACEGLOBAL int neBEMPrepareWeightingField(int NbPrimsWtField,
129 int PrimListWtField[]);
130
131// Deallocates memory reserved for a weighting field
132INTFACEGLOBAL void neBEMDeleteWeightingField(int IdWtField);
133
134// Deallocates all memory reserved for all weighting fields
136
137// Get weighting field and potential at a specific point
138// arguments: evaluation position, field vector and the identification tag
139// to indicate the necessary weighting field configuration; returns potential values
140// evaluation failure returns DBL_MAX for the value of potential
142 int IdWtField);
143
144// no argument
145INTFACEGLOBAL int neBEMEnd(void);
146
147// no argument
148// const int OptReuseDir = 1;
149// #define OptReuseDir 1
152
153// Read-Write Primitives and Elements
158
159#ifdef __cplusplus
160} // namespace
161#endif
162
163#endif
int neBEMVolumeDescription(int vol, int *shape, int *material, double *epsilon, double *potential, double *charge, int *boundarytype)
Return information about a volume.
int neBEMGetInputsFromFiles(void)
Do-nothing function (no file inputs).
int neBEMSetDefaults(void)
Assign default values to some of the important global variables.
int ReadInitFile(char filename[])
int neBEMVolumePoint(double x, double y, double z)
Return the volume in which a point is located.
int neBEMGetMirror(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
void neBEMVolumePrimitives(int, int *, int[])
int neBEMGetNbPrimitives()
Return the number of primitives.
int neBEMGetBoundingPlanes(int *ixmin, double *cxmin, double *vxmin, int *ixmax, double *cxmax, double *vxmax, int *iymin, double *cymin, double *vymin, int *iymax, double *cymax, double *vymax, int *izmin, double *czmin, double *vzmin, int *izmax, double *czmax, double *vzmax)
int neBEMGetPrimitive(int prim, int *nvertex, double xvert[], double yvert[], double zvert[], double *xnorm, double *ynorm, double *znorm, int *volref1, int *volref2)
Return one primitive at a time.
int neBEMGetPeriodicities(int, int *ix, int *jx, double *sx, int *iy, int *jy, double *sy, int *iz, int *jz, double *sz)
int ReadElements(void)
double neBEMVolumeCharge(int volume)
int neBEMBoundaryConditions(void)
int neBEMMessage(const char *message)
int neBEMDiscretize(int **NbElemsOnPrimitives)
int neBEMField(Point3D *point, double *potential, Vector3D *field)
int WritePrimitives(void)
int neBEMGetNbOfLines(const char fname[])
int neBEMReadGeometry(void)
double neBEMChkInPoly(int n, Point3D *p, Point3D q)
double neBEMTimeElapsed(clock_t t0, clock_t t1)
int WriteElements(void)
int neBEMChargingUp(int)
int CreateDirStr(void)
int neBEMInitialize(void)
void neBEMDeleteAllWeightingFields(void)
int neBEMEnd(void)
void neBEMDeleteWeightingField(int IdWtField)
int neBEMPrepareWeightingField(int nprim, int primlist[])
int neBEMKnownCharges(void)
double neBEMWeightingField(Point3D *point, Vector3D *field, int IdWtField)
int neBEMSolve(void)
int ReadPrimitives(void)
INTFACEGLOBAL clock_t stopClock
INTFACEGLOBAL int OptPrimitiveFiles
INTFACEGLOBAL int neBEMFieldCallCntr
INTFACEGLOBAL FILE * fgnuPrim
INTFACEGLOBAL int NbThreads
INTFACEGLOBAL FILE * fgnuElem
INTFACEGLOBAL int neBEMState
INTFACEGLOBAL int OptPrintVolumeDetails
INTFACEGLOBAL FILE * fgnuMesh
INTFACEGLOBAL char DeviceInputFile[256]
INTFACEGLOBAL int OptGnuplotPrimitives
#define INTFACEGLOBAL
Definition: neBEMInterface.h:7
INTFACEGLOBAL int OptDeviceFile
INTFACEGLOBAL int OptPrintPrimaryDetails
INTFACEGLOBAL clock_t startClock
INTFACEGLOBAL int OptPrintVertexAndNormal
INTFACEGLOBAL int OptElementFiles
INTFACEGLOBAL int OptGnuplot
INTFACEGLOBAL int OptGnuplotElements
INTFACEGLOBAL int OptReuseDir
int InfluenceMatrixFlag
Definition: neBEM.c:30
Definition: Vector.h:21