All Classes Files Functions Variables Pages
module_coordinate.f90
Go to the documentation of this file.
1 !=====================================================================================================================================
2 ! EFISPEC3D !
3 ! (Elements FInis SPECtraux 3D) !
4 ! !
5 ! http://efispec.free.fr !
6 ! !
7 ! !
8 ! This file is part of EFISPEC3D !
9 ! Please refer to http://efispec.free.fr if you use it or part of it !
10 ! !
11 ! !
12 !1 ---> French License: CeCILL V2 !
13 ! !
14 ! Copyright BRGM 2009 contributeurs : Florent DE MARTIN !
15 ! David MICHEA !
16 ! Philippe THIERRY !
17 ! !
18 ! Contact: f.demartin at brgm.fr !
19 ! !
20 ! Ce logiciel est un programme informatique servant a resoudre l'equation du !
21 ! mouvement en trois dimensions via une methode des elements finis spectraux. !
22 ! !
23 ! Ce logiciel est regi par la licence CeCILL soumise au droit francais et !
24 ! respectant les principes de diffusion des logiciels libres. Vous pouvez !
25 ! utiliser, modifier et/ou redistribuer ce programme sous les conditions de la !
26 ! licence CeCILL telle que diffusee par le CEA, le CNRS et l'INRIA sur le site !
27 ! "http://www.cecill.info". !
28 ! !
29 ! En contrepartie de l'accessibilite au code source et des droits de copie, de !
30 ! modification et de redistribution accordes par cette licence, il n'est offert !
31 ! aux utilisateurs qu'une garantie limitee. Pour les memes raisons, seule une !
32 ! responsabilite restreinte pese sur l'auteur du programme, le titulaire des !
33 ! droits patrimoniaux et les concedants successifs. !
34 ! !
35 ! A cet egard l'attention de l'utilisateur est attiree sur les risques associes !
36 ! au chargement, a l'utilisation, a la modification et/ou au developpement et a !
37 ! la reproduction du logiciel par l'utilisateur etant donne sa specificite de !
38 ! logiciel libre, qui peut le rendre complexe a manipuler et qui le reserve donc !
39 ! a des developpeurs et des professionnels avertis possedant des connaissances !
40 ! informatiques approfondies. Les utilisateurs sont donc invites a charger et !
41 ! tester l'adequation du logiciel a leurs besoins dans des conditions permettant !
42 ! d'assurer la securite de leurs systemes et ou de leurs donnees et, plus !
43 ! generalement, a l'utiliser et l'exploiter dans les memes conditions de !
44 ! securite. !
45 ! !
46 ! Le fait que vous puissiez acceder a cet en-tete signifie que vous avez pris !
47 ! connaissance de la licence CeCILL et que vous en avez accepte les termes. !
48 ! !
49 ! !
50 !2 ---> International license: GNU GPL V3 !
51 ! !
52 ! EFISPEC3D is a computer program that solves the three-dimensional equations of !
53 ! motion using a finite spectral-element method. !
54 ! !
55 ! Copyright (C) 2009 Florent DE MARTIN !
56 ! !
57 ! Contact: f.demartin at brgm.fr !
58 ! !
59 ! This program is free software: you can redistribute it and/or modify it under !
60 ! the terms of the GNU General Public License as published by the Free Software !
61 ! Foundation, either version 3 of the License, or (at your option) any later !
62 ! version. !
63 ! !
64 ! This program is distributed in the hope that it will be useful, but WITHOUT ANY !
65 ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A !
66 ! PARTICULAR PURPOSE. See the GNU General Public License for more details. !
67 ! !
68 ! You should have received a copy of the GNU General Public License along with !
69 ! this program. If not, see http://www.gnu.org/licenses/. !
70 ! !
71 ! !
72 !3 ---> Third party libraries !
73 ! !
74 ! EFISPEC3D uses the following of third party libraries: !
75 ! !
76 ! --> METIS 5.1.0 !
77 ! see http://glaros.dtc.umn.edu/gkhome/metis/metis/overview !
78 ! !
79 ! --> Lib_VTK_IO !
80 ! see S. Zaghi's website: https://github.com/szaghi/Lib_VTK_IO !
81 ! !
82 ! --> INTERP_LINEAR !
83 ! see J. Burkardt website: http://people.sc.fsu.edu/~jburkardt/ !
84 ! !
85 ! --> SAC !
86 ! http://ds.iris.edu/files/sac-manual/ !
87 ! !
88 ! --> EXODUS II !
89 ! http://sourceforge.net/projects/exodusii/ !
90 ! !
91 ! --> NETCDF !
92 ! http://www.unidata.ucar.edu/software/netcdf/ !
93 ! !
94 ! --> HDF5 !
95 ! http://www.hdfgroup.org/HDF5/ !
96 ! !
97 ! Some of these libraries are located in directory lib and pre-compiled !
98 ! with intel compiler for x86_64 platform. !
99 ! !
100 ! !
101 !4 ---> Related Articles !
102 ! !
103 ! De Martin, F., Matsushima, M., Kawase, H. (BSSA, 2013) !
104 ! Impact of geometric effects on near-surface Green's functions !
105 ! doi:10.1785/0120130039 !
106 ! !
107 ! Aochi, H., Ducellier, A., Dupros, F., Delatre, M., Ulrich, T., De Martin, F., !
108 ! Yoshimi, M., (Pure Appl. Geophys. 2013) !
109 ! Finite Difference Simulations of Seismic Wave Propagation for the 2007 Mw 6.6 !
110 ! Niigata-ken Chuetsu-Oki Earthquake: Validity of Models and Reliable !
111 ! Input Ground Motion in the Near-Field !
112 ! doi:10.1007/s00024-011-0429-5 !
113 ! !
114 ! De Martin, F. (BSSA, 2011) !
115 ! Verification of a Spectral-Element Method Code for the Southern California !
116 ! Earthquake Center LOH.3 Viscoelastic Case !
117 ! doi:10.1785/0120100305 !
118 ! !
119 !=====================================================================================================================================
120 
123 
127 
128  use mpi
129 
130  implicit none
131 
132  private
133 
134  public :: compute_hexa_point_coord
135  public :: compute_quad_point_coord
137 
138  contains
139 
140 !
141 !
150 !***********************************************************************************************************************************************************************************
151  subroutine compute_hexa_point_coord(ihexa,xi,eta,zeta,x,y,z)
152 !***********************************************************************************************************************************************************************************
153 
154  use mod_global_variables, only :&
155  ig_hexa_nnode&
156  ,ig_hexa_gnode_xiloc&
157  ,ig_hexa_gnode_etloc&
158  ,ig_hexa_gnode_etloc&
159  ,ig_hexa_gnode_zeloc&
160  ,ig_line_nnode&
161  ,rg_gnode_x&
162  ,rg_gnode_y&
163  ,rg_gnode_z&
164  ,ig_hexa_gnode_glonum
165 
166  use mod_lagrange , only : lagrap_geom
167 
168  implicit none
169 
170  integer, intent( in) :: ihexa
171  real , intent( in) :: xi
172  real , intent( in) :: eta
173  real , intent( in) :: zeta
174  real , intent(out) :: x
175  real , intent(out) :: y
176  real , intent(out) :: z
177 
178  real :: lag_xi
179  real :: lag_et
180  real :: lag_ze
181  real :: xgnode
182  real :: ygnode
183  real :: zgnode
184 
185  integer :: m
186 
187  x = 0.0
188  y = 0.0
189  z = 0.0
190 
191  do m = 1,ig_hexa_nnode
192 
193  lag_xi = lagrap_geom(ig_hexa_gnode_xiloc(m),xi ,ig_line_nnode)
194  lag_et = lagrap_geom(ig_hexa_gnode_etloc(m),eta ,ig_line_nnode)
195  lag_ze = lagrap_geom(ig_hexa_gnode_zeloc(m),zeta,ig_line_nnode)
196 
197  xgnode = rg_gnode_x(ig_hexa_gnode_glonum(m,ihexa))
198  ygnode = rg_gnode_y(ig_hexa_gnode_glonum(m,ihexa))
199  zgnode = rg_gnode_z(ig_hexa_gnode_glonum(m,ihexa))
200 
201  x = x + lag_xi*lag_et*lag_ze*xgnode
202  y = y + lag_xi*lag_et*lag_ze*ygnode
203  z = z + lag_xi*lag_et*lag_ze*zgnode
204 
205  enddo
206 
207  return
208 
209 !***********************************************************************************************************************************************************************************
210  end subroutine compute_hexa_point_coord
211 !***********************************************************************************************************************************************************************************
212 
213 !
214 !
222 !***********************************************************************************************************************************************************************************
223  subroutine compute_quad_point_coord(iquad,xi,eta,x,y,z)
224 !***********************************************************************************************************************************************************************************
225 
226  use mod_global_variables, only :&
227  ig_quad_nnode&
228  ,ig_quad_gnode_xiloc&
229  ,ig_quad_gnode_etloc&
230  ,ig_line_nnode&
231  ,rg_gnode_x&
232  ,rg_gnode_y&
233  ,rg_gnode_z&
234  ,ig_quadf_gnode_glonum
235 
236  use mod_lagrange , only : lagrap_geom
237 
238  implicit none
239 
240  integer, intent( in) :: iquad
241  real , intent( in) :: xi
242  real , intent( in) :: eta
243  real , intent(out) :: x
244  real , intent(out) :: y
245  real , intent(out) :: z
246 
247  real :: lag_xi
248  real :: lag_et
249  real :: xgnode
250  real :: ygnode
251  real :: zgnode
252 
253  integer :: m
254 
255  x = 0.0
256  y = 0.0
257  z = 0.0
258 
259  do m = 1,ig_quad_nnode
260 
261  lag_xi = lagrap_geom(ig_quad_gnode_xiloc(m),xi ,ig_line_nnode)
262  lag_et = lagrap_geom(ig_quad_gnode_etloc(m),eta,ig_line_nnode)
263 
264  xgnode = rg_gnode_x(ig_quadf_gnode_glonum(m,iquad))
265  ygnode = rg_gnode_y(ig_quadf_gnode_glonum(m,iquad))
266  zgnode = rg_gnode_z(ig_quadf_gnode_glonum(m,iquad))
267 
268  x = x + lag_xi*lag_et*xgnode
269  y = y + lag_xi*lag_et*ygnode
270  z = z + lag_xi*lag_et*zgnode
271 
272  enddo
273 
274  return
275 
276 !***********************************************************************************************************************************************************************************
277  end subroutine compute_quad_point_coord
278 !***********************************************************************************************************************************************************************************
279 
280 !
281 !
286 !***********************************************************************************************************************************************************************************
287  function compute_quad_point_coord_z(iquad,xi,eta) result(z)
288 !***********************************************************************************************************************************************************************************
289 
290  use mod_global_variables, only :&
291  ig_quad_nnode&
292  ,rg_gnode_z&
293  ,ig_quadf_gnode_glonum&
294  ,ig_line_nnode&
295  ,ig_quad_gnode_xiloc&
296  ,ig_quad_gnode_etloc
297 
298  use mod_lagrange , only : lagrap_geom
299 
300  implicit none
301 
302  integer, intent(in) :: iquad
303  real , intent(in) :: xi
304  real , intent(in) :: eta
305 
306  real :: lag_xi
307  real :: lag_et
308  real :: zgnode
309  real :: z
310  integer :: m
311 
312  z = 0.0
313 
314  do m = 1,ig_quad_nnode
315 
316  lag_xi = lagrap_geom(ig_quad_gnode_xiloc(m),xi ,ig_line_nnode)
317  lag_et = lagrap_geom(ig_quad_gnode_etloc(m),eta,ig_line_nnode)
318 
319  zgnode = rg_gnode_z(ig_quadf_gnode_glonum(m,iquad))
320 
321  z = z + lag_xi*lag_et*zgnode
322 
323  enddo
324 
325  return
326 !***********************************************************************************************************************************************************************************
327  end function compute_quad_point_coord_z
328 !***********************************************************************************************************************************************************************************
329 
330 end module mod_coordinate
This module defines all global variables of EFISPEC3D. Scalar variables are initialized directly in t...
real function, public lagrap_geom(i, x, n)
function to compute value of order Lagrange polynomial of geometric node i at abscissa : ...
This module contains subroutines to compute global -coordinates of a given point in the physical doma...
subroutine, public compute_hexa_point_coord(ihexa, xi, eta, zeta, x, y, z)
subroutine to compute -coordinates of a point knowing to which hexahedron element it belongs and its ...
real function, public compute_quad_point_coord_z(iquad, xi, eta)
function to compute -coordinates of a point knowing to which quadrangle element it belongs and its lo...
subroutine, public compute_quad_point_coord(iquad, xi, eta, x, y, z)
subroutine to compute -coordinates of a point knowing to which quadrangle element it belongs and its ...
This module contains functions to compute Lagrange polynomials and its derivatives; and to interpolat...