Garfield++ 5.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Isles.h
Go to the documentation of this file.
1/*
2(c) 2005, Supratik Mukhopadhayay, Nayana Majumdar
3*/
4#ifndef _Isles_H_
5#define _Isles_H_
6
7#ifdef DEFINE_ISLESGLOBAL
8#define ISLESGLOBAL
9#else
10#define ISLESGLOBAL extern
11#endif
12
13#include <math.h>
14#include <stdio.h>
15
16#include "Vector.h"
17
18#define MINDIST 1.0e-8
19#define MINDIST2 1.0e-16
20#define MINDIST3 1.0e-20
21
22#define FarField 10.0 // Beyond FarField*ElementSize, use nodal expressions
23#define FarField2 100.0
24
25#define ST_PI 3.14159265358979323846
26
27#ifdef __cplusplus
28namespace neBEM {
29#endif
30
32
33// Nb of times these get called: FailureCntr keeps a tab of how many times
34// the exact expressions failed to evaluate.
38
39// ECS: Element coordinate system
40// GCS: Global coordinate system
41
42// X, Y, Z defines the field point in the ECS whose origin is at the
43// centre of the rectangular element, the element being in the XZ plane.
44// lo and hi define the extent of the element.
45ISLESGLOBAL int ExactRecSurf(double X, double Y, double Z, double xlo,
46 double zlo, double xhi, double zhi,
47 double *Potential, Vector3D *Flux);
48
49ISLESGLOBAL int ApproxRecSurf(double X, double Y, double Z, double xlo,
50 double zlo, double xhi, double zhi, int xseg,
51 int zseg, double *Potential, Vector3D *Flux);
52
53// X, Y, Z defines the field point in the ECS whose origin is at the right
54// angle corner of a triangular element, the element being on the XZ plane.
55// x extent is always from 0 to 1, while z is from 0 to zmax
56ISLESGLOBAL int ExactTriSurf(double zMax, double X, double Y, double Z,
57 double *Potential, Vector3D *Flux);
58
59ISLESGLOBAL int ApproxTriSurf(double zMax, double X, double Y, double Z,
60 int xseg, int zseg, double *Potential,
61 Vector3D *Flux);
62
63// potential at the surfce of the thin wire
64ISLESGLOBAL double ExactCentroidalP_W(double rW, double lW);
65
66// potential along the axis of the thin wire
67ISLESGLOBAL double ExactAxialP_W(double rW, double lW, double Z);
68
69// axial field along the axis of the wire
70ISLESGLOBAL double ExactAxialFZ_W(double rW, double lW, double Z);
71
72ISLESGLOBAL double ApproxP_W(double rW, double lW, double X, double Y, double Z,
73 int zseg);
74
75ISLESGLOBAL double ApproxFX_W(double rW, double lW, double X, double Y,
76 double Z, int zseg);
77
78ISLESGLOBAL double ApproxFY_W(double rW, double lW, double X, double Y,
79 double Z, int zseg);
80
81ISLESGLOBAL double ApproxFZ_W(double rW, double lW, double X, double Y,
82 double Z, int zseg);
83
84ISLESGLOBAL int ApproxWire(double rW, double lW, double X, double Y, double Z,
85 int zseg, double *potential, Vector3D *Flux);
86
87ISLESGLOBAL double ImprovedP_W(double rW, double lW, double X, double Y,
88 double Z);
89
90ISLESGLOBAL double ImprovedFX_W(double rW, double lW, double X, double Y,
91 double Z);
92
93ISLESGLOBAL double ImprovedFY_W(double rW, double lW, double X, double Y,
94 double Z);
95
96ISLESGLOBAL double ImprovedFZ_W(double rW, double lW, double X, double Y,
97 double Z);
98
99ISLESGLOBAL int ImprovedWire(double rW, double lW, double X, double Y, double Z,
100 double *potential, Vector3D *Flux);
101
102// Potential and fluxes at a field point in the ECS due to a thin wire.
103// The four functions yield the mentioned four parameters separately.
104ISLESGLOBAL double ExactThinP_W(double rW, double lW, double X, double Y,
105 double Z);
106
107ISLESGLOBAL double ExactThinFX_W(double rW, double lW, double X, double Y,
108 double Z);
109
110ISLESGLOBAL double ExactThinFY_W(double rW, double lW, double X, double Y,
111 double Z);
112
113ISLESGLOBAL double ExactThinFZ_W(double rW, double lW, double X, double Y,
114 double Z);
115
116ISLESGLOBAL int ExactThinWire(double rW, double lW, double X, double Y,
117 double Z, double *potential, Vector3D *Flux);
118
119// The point is passed in the local coordinate system, in the ECS of the ring
120// In the ECS, plane of the ring is r,theta (XY) and z is the ordinate
121// up and down of this plane.
122ISLESGLOBAL int ExactRingPF(double rW, Point3D localPt, double *potential,
123 Vector3D *Flux);
124
125// The point is passed in the local coordinate system, in the ECS of the disc
126// In the ECS, plane of the ring is r,theta (XY) and z is the ordinate
127// up and down of this plane.
128ISLESGLOBAL int ExactDiscPF(double rW, Point3D localPt, double *potential,
129 Vector3D *Flux);
130
131// All coordinates and vectors are in the global co-ordinate system.
132// In case of area (both triangular and rectangular), it is assumed that
133// the +ve normal direction is obtained by
134// \vec{P1-P0} \cross \vec{P2-P1}.
135// Note that, according to our convention, the second point of a right
136// triangle \vec{P1} is the right corner of the triangle.
137ISLESGLOBAL double PointKnChPF(Point3D SourcePt, Point3D FieldPt,
138 Vector3D *globalF);
139
140ISLESGLOBAL double LineKnChPF(Point3D LineStart, Point3D LineStop,
141 Point3D FieldPt, Vector3D *globalF);
142
143ISLESGLOBAL double WireKnChPF(Point3D WireStart, Point3D WireStop,
144 double radius, Point3D FieldPt,
145 Vector3D *globalF);
146
147ISLESGLOBAL double AreaKnChPF(int NbVertices, Point3D *Vertices,
148 Point3D FieldPt, Vector3D *globalF);
149
150ISLESGLOBAL double ApproxVolumeKnChPF(int NbPts, Point3D *SourcePt,
151 Point3D FieldPt, Vector3D *globalF);
152
153ISLESGLOBAL double VolumeKnChPF(int NbPts, Point3D *Vertices, Point3D FieldPt,
154 Vector3D *globalF);
155
156ISLESGLOBAL int Sign(double x);
157
158#ifdef __cplusplus
159} // namespace
160#endif
161
162#endif
double ApproxFZ_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition Isles.c:1881
double ApproxP_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition Isles.c:1816
double ExactThinFX_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:2108
int ApproxTriSurf(double zMax, double X, double Y, double Z, int nbxseg, int nbzseg, double *Potential, Vector3D *Flux)
Definition Isles.c:1666
int ApproxWire(double rW, double lW, double X, double Y, double Z, int zseg, double *potential, Vector3D *Flux)
Definition Isles.c:1903
double ExactCentroidalP_W(double rW, double lW)
Definition Isles.c:1782
double ApproxVolumeKnChPF(int, Point3D *, Point3D, Vector3D *globalF)
Definition Isles.c:2827
double ApproxFX_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition Isles.c:1837
double ExactThinFY_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:2128
double ImprovedFZ_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:1998
double ExactAxialP_W(double rW, double lW, double Z)
Definition Isles.c:1792
double WireKnChPF(Point3D WireStart, Point3D WireStop, double radius, Point3D FieldPt, Vector3D *globalF)
Definition Isles.c:2514
double ExactAxialFZ_W(double rW, double lW, double Z)
Definition Isles.c:1805
double ApproxFY_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition Isles.c:1859
int ExactThinWire(double rW, double lW, double X, double Y, double Z, double *potential, Vector3D *Flux)
Definition Isles.c:2164
double ImprovedFY_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:1974
double ExactThinFZ_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:2148
int ExactRecSurf(double X, double Y, double Z, double xlo, double zlo, double xhi, double zhi, double *Potential, Vector3D *Flux)
Definition Isles.c:42
int ExactTriSurf(double zMax, double X, double Y, double Z, double *Potential, Vector3D *Flux)
Definition Isles.c:783
double LineKnChPF(Point3D LineStart, Point3D LineStop, Point3D FieldPt, Vector3D *globalF)
Definition Isles.c:2271
ISLESGLOBAL int ExactRingPF(double a, Point3D localPt, double *potential, Vector3D *Flux)
Definition Isles.c:2193
int Sign(double x)
Definition Isles.c:2854
double ExactThinP_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:2092
double ImprovedFX_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:1950
int ImprovedWire(double rW, double lW, double X, double Y, double Z, double *potential, Vector3D *Flux)
Definition Isles.c:2028
int ApproxRecSurf(double X, double Y, double Z, double xlo, double zlo, double xhi, double zhi, int xseg, int zseg, double *Potential, Vector3D *Flux)
Definition Isles.c:706
double AreaKnChPF(int NbVertices, Point3D *Vertex, Point3D FieldPt, Vector3D *globalF)
Definition Isles.c:2694
double PointKnChPF(Point3D SourcePt, Point3D FieldPt, Vector3D *globalF)
Definition Isles.c:2249
double VolumeKnChPF(int, Point3D *, Point3D, Vector3D *globalF)
Definition Isles.c:2841
double ImprovedP_W(double rW, double lW, double X, double Y, double Z)
Definition Isles.c:1934
ISLESGLOBAL int ApproxCntr
Definition Isles.h:35
ISLESGLOBAL int IslesCntr
Definition Isles.h:35
ISLESGLOBAL FILE * fIsles
Definition Isles.h:37
ISLESGLOBAL int FailureCntr
Definition Isles.h:35
ISLESGLOBAL int ApproxFlag
Definition Isles.h:36
ISLESGLOBAL int DebugISLES
Definition Isles.h:36
ISLESGLOBAL int ExactDiscPF(double rW, Point3D localPt, double *potential, Vector3D *Flux)
ISLESGLOBAL int ExactCntr
Definition Isles.h:35
#define ISLESGLOBAL
Definition Isles.h:10
ISLESGLOBAL char ISLESVersion[10]
Definition Isles.h:31
neBEMGLOBAL int * NbVertices
Definition neBEM.h:77