43 REAL,
PARAMETER ::
pi = 3.1415926535897932384626433832795028842
52 REAL,
DIMENSION(3) :: geoparam
53 INTEGER,
PRIVATE :: azimuthindex = 0
58 procedure(scalefactors_1),
DEFERRED :: scalefactors_1
59 procedure(scalefactors_2),
DEFERRED :: scalefactors_2
60 procedure(scalefactors_3),
DEFERRED :: scalefactors_3
61 procedure(scalefactors_4),
DEFERRED :: scalefactors_4
63 procedure(radius_1),
DEFERRED :: radius_1
64 procedure(radius_2),
DEFERRED :: radius_2
65 procedure(radius_3),
DEFERRED :: radius_3
66 procedure(radius_4),
DEFERRED :: radius_4
68 procedure(positionvector_1),
DEFERRED :: positionvector_1
69 procedure(positionvector_2),
DEFERRED :: positionvector_2
70 procedure(positionvector_3),
DEFERRED :: positionvector_3
71 procedure(positionvector_4),
DEFERRED :: positionvector_4
73 procedure(convert2cartesian_coords_1),
DEFERRED :: convert2cartesian_coords_1
74 procedure(convert2cartesian_coords_2),
DEFERRED :: convert2cartesian_coords_2
75 procedure(convert2cartesian_coords_3),
DEFERRED :: convert2cartesian_coords_3
76 procedure(convert2cartesian_coords_4),
DEFERRED :: convert2cartesian_coords_4
78 procedure(convert2curvilinear_coords_1),
DEFERRED :: convert2curvilinear_coords_1
79 procedure(convert2curvilinear_coords_2),
DEFERRED :: convert2curvilinear_coords_2
80 procedure(convert2curvilinear_coords_3),
DEFERRED :: convert2curvilinear_coords_3
81 procedure(convert2curvilinear_coords_4),
DEFERRED :: convert2curvilinear_coords_4
83 procedure(convert2cartesian_vectors_1),
DEFERRED :: convert2cartesian_vectors_1
84 procedure(convert2cartesian_vectors_2),
DEFERRED :: convert2cartesian_vectors_2
85 procedure(convert2cartesian_vectors_3),
DEFERRED :: convert2cartesian_vectors_3
86 procedure(convert2cartesian_vectors_4),
DEFERRED :: convert2cartesian_vectors_4
88 procedure(convert2curvilinear_vectors_1),
DEFERRED :: convert2curvilinear_vectors_1
89 procedure(convert2curvilinear_vectors_2),
DEFERRED :: convert2curvilinear_vectors_2
90 procedure(convert2curvilinear_vectors_3),
DEFERRED :: convert2curvilinear_vectors_3
91 procedure(convert2curvilinear_vectors_4),
DEFERRED :: convert2curvilinear_vectors_4
106 generic,
PUBLIC :: scalefactors =>
scalefactors_0, scalefactors_1, scalefactors_2, &
107 scalefactors_3, scalefactors_4
109 generic,
PUBLIC :: radius =>
radius_0, radius_1, radius_2, radius_3, radius_4
111 generic,
PUBLIC :: positionvector =>
positionvector_0, positionvector_1, positionvector_2, &
112 positionvector_3, positionvector_4
115 convert2cartesian_coords_1, convert2cartesian_coords_2,&
116 convert2cartesian_coords_3, convert2cartesian_coords_4, &
117 convert2cartesian_vectors_1, convert2cartesian_vectors_2,&
118 convert2cartesian_vectors_3, convert2cartesian_vectors_4
121 convert2curvilinear_coords_1, convert2curvilinear_coords_2,&
122 convert2curvilinear_coords_3, convert2curvilinear_coords_4,&
123 convert2curvilinear_vectors_1, convert2curvilinear_vectors_2,&
124 convert2curvilinear_vectors_3, convert2curvilinear_vectors_4
130 PURE SUBROUTINE scalefactors_1(this,coords,hx,hy,hz)
134 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
135 REAL,
DIMENSION(:),
INTENT(OUT) :: hx,hy,hz
137 PURE SUBROUTINE scalefactors_2(this,coords,hx,hy,hz)
141 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
142 REAL,
DIMENSION(:,:),
INTENT(OUT) :: hx,hy,hz
144 PURE SUBROUTINE scalefactors_3(this,coords,hx,hy,hz)
148 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
149 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: hx,hy,hz
151 PURE SUBROUTINE scalefactors_4(this,coords,hx,hy,hz)
155 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
156 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: hx,hy,hz
158 PURE SUBROUTINE radius_1(this,coords,r)
162 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
163 REAL,
DIMENSION(:),
INTENT(OUT) :: r
165 PURE SUBROUTINE radius_2(this,coords,r)
169 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
170 REAL,
DIMENSION(:,:),
INTENT(OUT) :: r
172 PURE SUBROUTINE radius_3(this,coords,r)
176 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
177 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: r
179 PURE SUBROUTINE radius_4(this,coords,r)
183 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
184 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: r
186 PURE SUBROUTINE positionvector_1(this,coords,posvec)
190 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
191 REAL,
DIMENSION(:,:),
INTENT(OUT) :: posvec
193 PURE SUBROUTINE positionvector_2(this,coords,posvec)
197 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
198 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: posvec
200 PURE SUBROUTINE positionvector_3(this,coords,posvec)
204 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
205 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: posvec
207 PURE SUBROUTINE positionvector_4(this,coords,posvec)
211 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
212 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: posvec
214 PURE SUBROUTINE convert2cartesian_coords_1(this,curv,cart)
218 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
219 REAL,
DIMENSION(:,:),
INTENT(OUT) :: cart
221 PURE SUBROUTINE convert2cartesian_coords_2(this,curv,cart)
225 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
226 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: cart
228 PURE SUBROUTINE convert2cartesian_coords_3(this,curv,cart)
232 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
233 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: cart
235 PURE SUBROUTINE convert2cartesian_coords_4(this,curv,cart)
239 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
240 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: cart
242 PURE SUBROUTINE convert2curvilinear_coords_1(this,cart,curv)
246 REAL,
DIMENSION(:,:),
INTENT(IN) :: cart
247 REAL,
DIMENSION(:,:),
INTENT(OUT) :: curv
249 PURE SUBROUTINE convert2curvilinear_coords_2(this,cart,curv)
253 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: cart
254 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: curv
256 PURE SUBROUTINE convert2curvilinear_coords_3(this,cart,curv)
260 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: cart
261 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: curv
263 PURE SUBROUTINE convert2curvilinear_coords_4(this,cart,curv)
267 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: cart
268 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: curv
270 PURE SUBROUTINE convert2cartesian_vectors_1(this,curv,v_curv,v_cart)
274 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
275 REAL,
DIMENSION(:,:),
INTENT(IN) :: v_curv
276 REAL,
DIMENSION(:,:),
INTENT(OUT) :: v_cart
278 PURE SUBROUTINE convert2cartesian_vectors_2(this,curv,v_curv,v_cart)
282 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
283 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: v_curv
284 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: v_cart
286 PURE SUBROUTINE convert2cartesian_vectors_3(this,curv,v_curv,v_cart)
290 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
291 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: v_curv
292 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: v_cart
294 PURE SUBROUTINE convert2cartesian_vectors_4(this,curv,v_curv,v_cart)
298 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
299 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: v_curv
300 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: v_cart
302 PURE SUBROUTINE convert2curvilinear_vectors_1(this,curv,v_cart,v_curv)
306 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
307 REAL,
DIMENSION(:,:),
INTENT(IN) :: v_cart
308 REAL,
DIMENSION(:,:),
INTENT(OUT) :: v_curv
310 PURE SUBROUTINE convert2curvilinear_vectors_2(this,curv,v_cart,v_curv)
314 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
315 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: v_cart
316 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: v_curv
318 PURE SUBROUTINE convert2curvilinear_vectors_3(this,curv,v_cart,v_curv)
322 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
323 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: v_cart
324 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: v_curv
326 PURE SUBROUTINE convert2curvilinear_vectors_4(this,curv,v_cart,v_curv)
330 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
331 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: v_cart
332 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: v_curv
337 CLASS(geometry_base),
INTENT(INOUT) :: this
381 CLASS(geometry_base),
INTENT(INOUT) :: this
382 TYPE(DICT_TYP),
POINTER :: config
384 CHARACTER(LEN=*) :: gname
385 REAL :: gs_def,gs_def2,gs_def3
387 CHARACTER(LEN=8) :: gs_str
389 INTENT(IN) :: gnum,gname
391 CALL this%logging_base%InitLogging(gnum,gname)
393 CALL getattr(config,
"geometry", gt)
406 CALL getattr(config,
"gparam", gs_def, 1.0)
422 CALL this%Info(
" GEOMETRY-> coordinates: " // trim(this%GetName()))
425 WRITE (gs_str,
'(ES8.1)') this%GetScale()
426 CALL this%Info(
" geometry scale: " // trim(gs_str))
444 gp =
this%geoparam(1)
447 PURE FUNCTION getscale2(this,i)
RESULT(gp)
451 INTEGER,
INTENT(IN) :: i
454 gp =
this%geoparam(i)
461 REAL,
INTENT(IN) :: gp
463 this%geoparam(1) = gp
470 REAL,
INTENT(IN) :: gp,gp2
472 this%geoparam(1) = gp
473 this%geoparam(2) = gp2
476 PURE SUBROUTINE setscale3(this,gp,gp2,gp3)
480 REAL,
INTENT(IN) :: gp,gp2,gp3
482 this%geoparam(1) = gp
483 this%geoparam(2) = gp2
484 this%geoparam(3) = gp3
505 CALL this%ScaleFactors(coords%data2d(:,:),hx%data1d(:),hy%data1d(:),hz%data1d(:))
514 PURE SUBROUTINE radius_0(this,coords,radius)
521 CALL this%Radius(coords%data2d(:,:),radius%data1d(:))
537 CALL this%PositionVector(coords%data2d(:,:),posvec%data2d(:,:))
551 CALL this%Convert2Cartesian(curv%data2d(:,:),cart%data2d(:,:))
565 CALL this%Convert2Curvilinear(cart%data2d(:,:),curv%data2d(:,:))
580 CALL this%Convert2Cartesian(curv%data2d(:,:),v_curv%data2d(:,:),v_cart%data2d(:,:))
593 CALL this%Convert2Curvilinear(curv%data2d(:,:),v_cart%data2d(:,:),v_curv%data2d(:,:))
603 INTEGER,
INTENT(IN) :: idx
605 this%azimuthIndex = idx
617 idx =
this%azimuthIndex
624 CLASS(geometry_base),
INTENT(INOUT) :: this
626 IF (.NOT.this%Initialized()) &
627 CALL this%Error(
"CloseGeometry",
"not initialized")
subroutine finalize_base(this)
Destructor of generic geometry module.
subroutine finalize(this)
Destructor of common class.
pure subroutine scalefactors_0(this, coords, hx, hy, hz)
Compute scale factors.
pure subroutine setazimuthindex(this, idx)
sets the coordinate index of the azimuthal angle
type(logging_base), save this
subroutine initgeometry(this, gnum, gname, config)
Constructor of generic geometry module.
derived mesh array class for scalar cell data
pure subroutine convert2cartesian_vectors(this, curv, v_curv, v_cart)
Convert curvilinear vector components to cartesian vector components.
integer, parameter, public logspherical
integer, parameter, public cartesian
real, parameter, public pi
base class for geometrical properties
integer, parameter, public logcylindrical
pure subroutine convert2cartesian_coords(this, curv, cart)
Convert curvilinear to cartesian coordinates.
derived mesh array class for vector cell data
integer, parameter, public spherical
pure subroutine radius_0(this, coords, radius)
Compute radial distances to the origin.
pure subroutine setscale2(this, gp, gp2)
Dictionary for generic data types.
pure subroutine setscale1(this, gp)
pure subroutine convert2curvilinear_vectors(this, curv, v_cart, v_curv)
Convert cartesian vector components to curvilinear vector components.
pure integer function getazimuthindex(this)
returns the coordinate index of the azimuthal angle
pure real function getscale1(this)
pure subroutine setscale3(this, gp, gp2, gp3)
integer, parameter, public cylindrical
pure real function getscale2(this, i)
pure subroutine convert2curvilinear_coords(this, cart, curv)
Convert cartesian to curvilinear coordinates.
pure subroutine positionvector_0(this, coords, posvec)
compute position vector components for all cell positions