Garfield++ 4.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
15#include "Vector.h"
16
17#define MINDIST 1.0e-8
18#define MINDIST2 1.0e-16
19#define MINDIST3 1.0e-20
20
21#define FarField 10.0 // Beyond FarField*ElementSize, use nodal expressions
22#define FarField2 100.0
23
24#define ST_PI 3.14159265358979323846
25
26#ifdef __cplusplus
27namespace neBEM {
28#endif
29
31
32// Nb of times these get called: FailureCntr keeps a tab of how many times
33// the exact expressions failed to evaluate.
37
38// ECS: Element coordinate system
39// GCS: Global coordinate system
40
41// X, Y, Z defines the field point in the ECS whose origin is at the
42// centre of the rectangular element, the element being in the XZ plane.
43// lo and hi define the extent of the element.
44ISLESGLOBAL int ExactRecSurf(double X, double Y, double Z, double xlo,
45 double zlo, double xhi, double zhi,
46 double *Potential, Vector3D *Flux);
47
48ISLESGLOBAL int ApproxRecSurf(double X, double Y, double Z, double xlo,
49 double zlo, double xhi, double zhi, int xseg,
50 int zseg, double *Potential, Vector3D *Flux);
51
52// X, Y, Z defines the field point in the ECS whose origin is at the right
53// angle corner of a triangular element, the element being on the XZ plane.
54// x extent is always from 0 to 1, while z is from 0 to zmax
55ISLESGLOBAL int ExactTriSurf(double zMax, double X, double Y, double Z,
56 double *Potential, Vector3D *Flux);
57
58ISLESGLOBAL int ApproxTriSurf(double zMax, double X, double Y, double Z,
59 int xseg, int zseg, double *Potential,
60 Vector3D *Flux);
61
62// potential at the surfce of the thin wire
63ISLESGLOBAL double ExactCentroidalP_W(double rW, double lW);
64
65// potential along the axis of the thin wire
66ISLESGLOBAL double ExactAxialP_W(double rW, double lW, double Z);
67
68// axial field along the axis of the wire
69ISLESGLOBAL double ExactAxialFZ_W(double rW, double lW, double Z);
70
71ISLESGLOBAL double ApproxP_W(double rW, double lW, double X, double Y, double Z,
72 int zseg);
73
74ISLESGLOBAL double ApproxFX_W(double rW, double lW, double X, double Y,
75 double Z, int zseg);
76
77ISLESGLOBAL double ApproxFY_W(double rW, double lW, double X, double Y,
78 double Z, int zseg);
79
80ISLESGLOBAL double ApproxFZ_W(double rW, double lW, double X, double Y,
81 double Z, int zseg);
82
83ISLESGLOBAL int ApproxWire(double rW, double lW, double X, double Y, double Z,
84 int zseg, double *potential, Vector3D *Flux);
85
86ISLESGLOBAL double ImprovedP_W(double rW, double lW, double X, double Y,
87 double Z);
88
89ISLESGLOBAL double ImprovedFX_W(double rW, double lW, double X, double Y,
90 double Z);
91
92ISLESGLOBAL double ImprovedFY_W(double rW, double lW, double X, double Y,
93 double Z);
94
95ISLESGLOBAL double ImprovedFZ_W(double rW, double lW, double X, double Y,
96 double Z);
97
98ISLESGLOBAL int ImprovedWire(double rW, double lW, double X, double Y, double Z,
99 double *potential, Vector3D *Flux);
100
101// Potential and fluxes at a field point in the ECS due to a thin wire.
102// The four functions yield the mentioned four parameters separately.
103ISLESGLOBAL double ExactThinP_W(double rW, double lW, double X, double Y,
104 double Z);
105
106ISLESGLOBAL double ExactThinFX_W(double rW, double lW, double X, double Y,
107 double Z);
108
109ISLESGLOBAL double ExactThinFY_W(double rW, double lW, double X, double Y,
110 double Z);
111
112ISLESGLOBAL double ExactThinFZ_W(double rW, double lW, double X, double Y,
113 double Z);
114
115ISLESGLOBAL int ExactThinWire(double rW, double lW, double X, double Y,
116 double Z, double *potential, Vector3D *Flux);
117
118// All coordiantes and vectors are in the global co-ordinate system.
119// In case of area (both triangular and rectangular), it is assumed that
120// the +ve normal direction is obtained by
121// \vec{P1-P0} \cross \vec{P2-P1}.
122// Note that, according to our convention, the second point of a right
123// triangle \vec{P1} is the right corner of the triangle.
124ISLESGLOBAL double PointKnChPF(Point3D SourcePt, Point3D FieldPt,
125 Vector3D *globalF);
126
127ISLESGLOBAL double LineKnChPF(Point3D LineStart, Point3D LineStop,
128 double radius, Point3D FieldPt,
129 Vector3D *globalF);
130
131ISLESGLOBAL double AreaKnChPF(int NbVertices, Point3D *Vertices,
132 Point3D FieldPt, Vector3D *globalF);
133
134ISLESGLOBAL double VolumeKnChPF(int NbPts, Point3D *Vertices, Point3D FieldPt,
135 Vector3D *globalF);
136
137ISLESGLOBAL int Sign(double x);
138
139#ifdef __cplusplus
140} // namespace
141#endif
142
143#endif
double ApproxFZ_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition: Isles.c:1877
double ApproxP_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition: Isles.c:1812
double ExactThinFX_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:2103
int ApproxTriSurf(double zMax, double X, double Y, double Z, int nbxseg, int nbzseg, double *Potential, Vector3D *Flux)
Definition: Isles.c:1660
int ApproxWire(double rW, double lW, double X, double Y, double Z, int zseg, double *potential, Vector3D *Flux)
Definition: Isles.c:1899
double ExactCentroidalP_W(double rW, double lW)
Definition: Isles.c:1779
double ApproxFX_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition: Isles.c:1833
double ExactThinFY_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:2121
double ImprovedFZ_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:1994
double ExactAxialP_W(double rW, double lW, double Z)
Definition: Isles.c:1789
double ExactAxialFZ_W(double rW, double lW, double Z)
Definition: Isles.c:1801
double ApproxFY_W(double rW, double lW, double X, double Y, double Z, int zseg)
Definition: Isles.c:1855
int ExactThinWire(double rW, double lW, double X, double Y, double Z, double *potential, Vector3D *Flux)
Definition: Isles.c:2155
double ImprovedFY_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:1970
double ExactThinFZ_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:2139
double LineKnChPF(Point3D LineStart, Point3D LineStop, double radius, Point3D FieldPt, Vector3D *globalF)
Definition: Isles.c:2199
int ExactRecSurf(double X, double Y, double Z, double xlo, double zlo, double xhi, double zhi, double *Potential, Vector3D *Flux)
Definition: Isles.c:40
int ExactTriSurf(double zMax, double X, double Y, double Z, double *Potential, Vector3D *Flux)
Definition: Isles.c:784
int Sign(double x)
Definition: Isles.c:2506
double ExactThinP_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:2088
double ImprovedFX_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:1946
int ImprovedWire(double rW, double lW, double X, double Y, double Z, double *potential, Vector3D *Flux)
Definition: Isles.c:2024
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:2350
double PointKnChPF(Point3D SourcePt, Point3D FieldPt, Vector3D *globalF)
Definition: Isles.c:2177
double VolumeKnChPF(int, Point3D *, Point3D, Vector3D *globalF)
Definition: Isles.c:2491
double ImprovedP_W(double rW, double lW, double X, double Y, double Z)
Definition: Isles.c:1930
ISLESGLOBAL int ApproxCntr
Definition: Isles.h:34
ISLESGLOBAL int IslesCntr
Definition: Isles.h:34
ISLESGLOBAL FILE * fIsles
Definition: Isles.h:36
ISLESGLOBAL int FailureCntr
Definition: Isles.h:34
ISLESGLOBAL int ApproxFlag
Definition: Isles.h:35
ISLESGLOBAL int DebugISLES
Definition: Isles.h:35
ISLESGLOBAL int ExactCntr
Definition: Isles.h:34
#define ISLESGLOBAL
Definition: Isles.h:10
ISLESGLOBAL char ISLESVersion[10]
Definition: Isles.h:30
neBEMGLOBAL int * NbVertices
Definition: neBEM.h:70
Definition: Vector.h:21