File indexing completed on 2025-01-18 09:58:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 inline
0030 G4double G4Paraboloid::GetZHalfLength() const
0031 {
0032 return dz;
0033 }
0034
0035 inline
0036 G4double G4Paraboloid::GetRadiusPlusZ() const
0037 {
0038 return r2;
0039 }
0040
0041 inline
0042 G4double G4Paraboloid::GetRadiusMinusZ() const
0043 {
0044 return r1;
0045 }
0046
0047 inline
0048 void G4Paraboloid::SetZHalfLength(G4double pDz)
0049 {
0050 if(pDz <= 0)
0051 {
0052 G4Exception("G4Paraboloid::SetZHalfLength()", "GeomSolids0002",
0053 FatalException, "Invalid dimensions.");
0054 }
0055 else
0056 {
0057 dz = pDz;
0058 k1 = (sqr(r2) - sqr(r1)) / (2 * dz);
0059 k2 = (sqr(r2) + sqr(r1)) / 2;
0060
0061
0062
0063
0064 fSurfaceArea = 0.;
0065 fCubicVolume = 0.;
0066 fRebuildPolyhedron = true;
0067 }
0068 }
0069
0070 inline
0071 void G4Paraboloid::SetRadiusPlusZ(G4double pR2)
0072 {
0073 if(pR2 <= 0 || pR2 <= r1)
0074 {
0075 G4Exception("G4Paraboloid::SetRadiusPlusZ()", "GeomSolids0002",
0076 FatalException, "Invalid dimensions.");
0077 }
0078 else
0079 {
0080 r2 = pR2;
0081 k1 = (sqr(r2) - sqr(r1)) / (2 * dz);
0082 k2 = (sqr(r2) + sqr(r1)) / 2;
0083
0084
0085
0086
0087 fSurfaceArea = 0.;
0088 fCubicVolume = 0.;
0089 fRebuildPolyhedron = true;
0090 }
0091 }
0092
0093 inline
0094 void G4Paraboloid::SetRadiusMinusZ(G4double pR1)
0095 {
0096 if(pR1 < 0 || pR1 >= r2)
0097 {
0098 G4Exception("G4Paraboloid::SetRadiusMinusZ()", "GeomSolids0002",
0099 FatalException, "Invalid dimensions.");
0100 }
0101 else
0102 {
0103 r1 = pR1;
0104 k1 = (sqr(r2) - sqr(r1)) / (2 * dz);
0105 k2 = (sqr(r2) + sqr(r1)) / 2;
0106
0107
0108
0109
0110 fSurfaceArea = 0.;
0111 fCubicVolume = 0.;
0112 fRebuildPolyhedron = true;
0113 }
0114 }
0115
0116 inline
0117 G4double G4Paraboloid::GetCubicVolume()
0118 {
0119 if(fCubicVolume != 0. ) {;}
0120 else
0121 {
0122 fCubicVolume = CLHEP::twopi * k2 * dz;
0123 }
0124 return fCubicVolume;
0125 }
0126
0127
0128 inline
0129 G4double G4Paraboloid::CalculateSurfaceArea() const
0130 {
0131 G4double h1, h2, A1, A2;
0132
0133 h1 = k2/k1 + dz;
0134 h2 = k2/k1 - dz;
0135
0136
0137
0138
0139 A1 = sqr(r2) + 4 * sqr(h1);
0140 A1 *= sqr(A1);
0141 A1 = CLHEP::pi * r2 /6 / sqr(h1) * ( std::sqrt(A1) - r2 * r2 * r2);
0142
0143
0144
0145
0146 A2 = sqr(r1) + 4 * sqr(h2);
0147 A2 *= sqr(A2);
0148
0149 if(h2 != 0)
0150 { A2 = CLHEP::pi * r1 /6 / sqr(h2) * ( std::sqrt(A2) - r1 * r1 * r1); }
0151 else
0152 { A2 = 0.; }
0153
0154 return fSurfaceArea = A1 - A2 + (sqr(r1) + sqr(r2))*CLHEP::pi;
0155 }
0156
0157 inline
0158 G4double G4Paraboloid::GetSurfaceArea()
0159 {
0160 if(fSurfaceArea == 0.) CalculateSurfaceArea();
0161
0162 return fSurfaceArea;
0163 }