Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
sll_m_dg_fields.F90
Go to the documentation of this file.
1 #define sll_transformation class(sll_c_coordinate_transformation_2d_base)
2 
7 
8 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 #include "sll_assert.h"
10 #include "sll_memory.h"
11 #include "sll_working_precision.h"
12 
13  use sll_m_ascii_io, only: &
15 
16  use sll_m_cartesian_meshes, only: &
18 
21  sll_p_io_gmsh, &
22  sll_p_io_mtv, &
24 
28 
29  use sll_m_utilities, only: &
31 
32  implicit none
33 
34  public :: &
38 
39  private
40 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41 
44 
45  sll_int32 :: degree
46  sll_transformation, pointer :: tau
47  sll_real64, dimension(:, :, :, :), allocatable :: array
48  sll_real64, dimension(:), allocatable :: xgalo
49  sll_real64, dimension(:), allocatable :: wgalo
50  sll_int32 :: tag
51  sll_int32 :: file_id
52 
53  contains
54 
55  procedure, pass :: init => sll_s_dg_field_2d_init
56  procedure, pass :: write_to_file => write_dg_field_2d_to_file
57  procedure, pass :: set_value => set_value_dg_field_2d
58 
59  end type sll_t_dg_field_2d
60 
62  interface operator(+)
63  module procedure dg_field_add
64  end interface operator(+)
65 
67  interface operator(-)
68  module procedure dg_field_sub
69  end interface operator(-)
70 
71  sll_int32 :: error
72 
73 contains
74 
75  subroutine sll_s_dg_field_2d_init(this, degree, tau, init_function)
76 
77  class(sll_t_dg_field_2d) :: this
78  sll_transformation, target :: tau
79  sll_real64, external, optional :: init_function
80  sll_int32, intent(in) :: degree
81  sll_int32 :: nc_eta1
82  sll_int32 :: nc_eta2
83  sll_int32 :: error
84 
85  this%tau => tau
86  this%degree = degree
87 
88  sll_allocate(this%xgalo(degree + 1), error)
89  sll_allocate(this%wgalo(degree + 1), error)
90 
91  this%xgalo = sll_f_gauss_lobatto_points(degree + 1, -1._f64, 1._f64)
92  this%wgalo = sll_f_gauss_lobatto_weights(degree + 1)
93 
94  nc_eta1 = tau%mesh%num_cells1
95  nc_eta2 = tau%mesh%num_cells2
96  allocate (this%array(1:degree + 1, 1:degree + 1, 1:nc_eta1, 1:nc_eta2))
97 
98  this%array = 0.0_f64
99  if (present(init_function)) then
100  call set_value_dg_field_2d(this, init_function, 0.0_f64)
101  end if
102 
103  this%tag = 0
104  this%file_id = 0
105 
106  end subroutine sll_s_dg_field_2d_init
107 
108  function sll_f_new_dg_field_2d(degree, tau, init_function) result(this)
109 
110  sll_transformation, pointer :: tau
111  sll_real64, external, optional :: init_function
112  sll_int32, intent(in) :: degree
113  sll_int32 :: nc_eta1
114  sll_int32 :: nc_eta2
115  type(sll_t_dg_field_2d), pointer :: this
116  sll_int32 :: error
117  sll_allocate(this, error)
118  this%tau => tau
119  this%degree = degree
120 
121  sll_allocate(this%xgalo(degree + 1), error)
122  sll_allocate(this%wgalo(degree + 1), error)
123 
124  this%xgalo = sll_f_gauss_lobatto_points(degree + 1, -1._f64, 1._f64)
125  this%wgalo = sll_f_gauss_lobatto_weights(degree + 1)
126 
127  associate(lm => this%tau%mesh)
128  nc_eta1 = lm%num_cells1
129  nc_eta2 = lm%num_cells2
130  end associate
131 
132  allocate (this%array(1:degree + 1, 1:degree + 1, 1:nc_eta1, 1:nc_eta2))
133 
134  this%array = 0.0_f64
135  if (present(init_function)) then
136  call set_value_dg_field_2d(this, init_function, 0.0_f64)
137  end if
138 
139  this%tag = 0
140  this%file_id = 0
141 
142  end function sll_f_new_dg_field_2d
143 
144  subroutine set_value_dg_field_2d(this, init_function, time)
145 
146  class(sll_t_dg_field_2d) :: this
147  sll_real64, external :: init_function
148  sll_real64 :: time
149  sll_real64 :: offset(2)
150  sll_real64 :: eta1
151  sll_real64 :: eta2
152  sll_int32 :: i, j, ii, jj
153 
154  sll_assert(allocated(this%array))
155 
156  do j = 1, this%tau%mesh%num_cells2
157  do i = 1, this%tau%mesh%num_cells1
158  offset(1) = this%tau%mesh%eta1_min + real(i - 1, f64)*this%tau%mesh%delta_eta1
159  offset(2) = this%tau%mesh%eta2_min + real(j - 1, f64)*this%tau%mesh%delta_eta2
160  do jj = 1, this%degree + 1
161  do ii = 1, this%degree + 1
162  eta1 = offset(1) + 0.5_f64*(this%xgalo(ii) + 1.0_f64)*this%tau%mesh%delta_eta1
163  eta2 = offset(2) + 0.5_f64*(this%xgalo(jj) + 1.0_f64)*this%tau%mesh%delta_eta2
164  this%array(ii, jj, i, j) = init_function(this%tau%x1(eta1, eta2), &
165  this%tau%x2(eta1, eta2), &
166  time)
167  end do
168  end do
169  end do
170  end do
171 
172  end subroutine set_value_dg_field_2d
173 
174  subroutine write_dg_field_2d_to_file(this, field_name, file_format, time)
175 
176  class(sll_t_dg_field_2d) :: this
177  character(len=*) :: field_name
178  sll_int32, optional :: file_format
179  sll_real64, optional :: time
180 
181  if (present(file_format)) then
182  select case (file_format)
183  case (sll_p_io_gmsh)
184  call plot_dg_field_2d_with_gmsh(this, field_name)
185  case (sll_p_io_mtv)
186  call plot_dg_field_2d_with_plotmtv(this, field_name)
187  case (sll_p_io_xdmf)
188  if (present(time)) then
189  call plot_dg_field_2d_with_xdmf(this, field_name, time)
190  else
191  call plot_dg_field_2d_with_xdmf(this, field_name)
192  end if
193  case default
194  print "(a)", field_name//' write_to_file : Unknown format'
195  end select
196  else
197  call plot_dg_field_2d_with_gnuplot(this, field_name)
198  end if
199 
200  end subroutine write_dg_field_2d_to_file
201 
202  subroutine plot_dg_field_2d_with_gnuplot(this, field_name)
203 
204  class(sll_t_dg_field_2d) :: this
205  character(len=*) :: field_name
206  sll_int32 :: file_id
207  sll_int32 :: gnu_id
208  sll_real64 :: eta1, eta2
209  sll_real64 :: offset(2)
210  sll_int32 :: i, j, ii, jj
211  character(len=4) :: ctag
212 
213  call sll_s_int2string(this%tag, ctag)
214 
215  gnu_id = this%file_id
216 
217  if (gnu_id == 0) then
218  call sll_s_ascii_file_create(field_name//".gnu", gnu_id, error)
219  rewind(gnu_id)
220  else
221  open (unit=gnu_id, file=field_name//".gnu", position="append")
222  end if
223  write (gnu_id, "(a)") "unset key"
224  write (gnu_id, "(a)") "set title '"//field_name//" step "//ctag//"'"
225  write (gnu_id, "(a)") "splot '"//field_name//ctag//".dat' w l"
226 
227  call sll_s_ascii_file_create(field_name//ctag//".dat", file_id, error)
228 
229  associate(lm => this%tau%mesh)
230 
231  do j = 1, lm%num_cells2
232  do i = 1, lm%num_cells1
233 
234  offset(1) = lm%eta1_min + real(i - 1, f64)*lm%delta_eta1
235  offset(2) = lm%eta2_min + real(j - 1, f64)*lm%delta_eta2
236  do jj = 1, this%degree + 1
237  do ii = 1, this%degree + 1
238  eta1 = offset(1) + 0.5_f64*(this%xgalo(ii) + 1.0_f64)*lm%delta_eta1
239  eta2 = offset(2) + 0.5_f64*(this%xgalo(jj) + 1.0_f64)*lm%delta_eta2
240  write (file_id, *) this%tau%x1(eta1, eta2), &
241  this%tau%x2(eta1, eta2), &
242  sngl(this%array(ii, jj, i, j))
243  end do
244  write (file_id, *)
245  end do
246  write (file_id, *)
247 
248  end do
249  end do
250 
251  end associate
252 
253  close (file_id)
254 
255  write (gnu_id, *)
256  close (gnu_id)
257 
258  this%tag = this%tag + 1
259  this%file_id = gnu_id
260 
261  end subroutine plot_dg_field_2d_with_gnuplot
262 
263  function dg_field_add(W1, W2) result(W3)
264 
265  type(sll_t_dg_field_2d), intent(in) :: w1
266  type(sll_t_dg_field_2d), intent(in) :: w2
267  type(sll_t_dg_field_2d) :: w3
268 
269  sll_assert(w1%degree == w2%degree)
270  sll_assert(allocated(w1%array))
271  sll_assert(allocated(w2%array))
272 
273  w3%array = w1%array + w2%array
274 
275  end function dg_field_add
276 
277  function dg_field_sub(W1, W2) result(W3)
278 
279  type(sll_t_dg_field_2d), intent(in) :: w1
280  type(sll_t_dg_field_2d), intent(in) :: w2
281  type(sll_t_dg_field_2d) :: w3
282 
283  w3%array = w1%array - w2%array
284 
285  end function dg_field_sub
286 
287  subroutine plot_dg_field_2d_with_gmsh(this, field_name)
288 
289  class(sll_t_dg_field_2d) :: this
290  character(len=*) :: field_name
291 
292  sll_int32 :: file_id
293  sll_int32, parameter :: nlocmax = 16
294  sll_int32 :: typelem
295  sll_int32, dimension(4) :: invpermut1 = (/1, 2, 4, 3/)
296  sll_int32, dimension(9) :: invpermut2 = (/1, 5, 2, 8, 9, 6, 4, 7, 3/)
297  sll_int32, dimension(16) :: invpermut3 = (/1, 5, 6, 2, 12, 13, 14, 7, 11, 16, 15, 8, 4, 10, 9, 3/)
298  sll_int32 :: invpermut(nlocmax), permut(nlocmax)
299  sll_int32 :: nloc, nel, neq, iel, ino, inoloc
300  sll_int32 :: i, j, k, l, ii, jj, ni, nj
301  sll_int32, allocatable :: connec(:, :)
302  sll_real64, allocatable :: coords(:, :)
303  sll_real64, allocatable :: values(:)
304  sll_real64 :: offset(2), eta1, eta2
305  character(len=32) :: my_fmt
306 
307  if (this%degree > 3) then
308  write (*, *) é'ordre non prvu'
309  stop
310  end if
311 
312  associate(lm => this%tau%mesh)
313 
314  ni = lm%num_cells1
315  nj = lm%num_cells2
316  nloc = (this%degree + 1)*(this%degree + 1)
317  nel = ni*nj
318  neq = (ni*this%degree + 1)*(nj*this%degree + 1)
319 
320  sll_allocate(connec(1:nloc, 1:neq), error)
321  sll_allocate(coords(1:2, 1:neq), error)
322  sll_allocate(values(1:neq), error)
323 
324  do j = 0, nj - 1
325  do i = 0, ni - 1
326  iel = 1 + i + j*ni
327  offset(1) = lm%eta1_min + i*lm%delta_eta1
328  offset(2) = lm%eta2_min + j*lm%delta_eta2
329  do jj = 0, this%degree
330  do ii = 0, this%degree
331  inoloc = 1 + ii + (this%degree + 1)*jj
332  ino = 1 + ii + this%degree*i + (this%degree*ni + 1)*(jj + this%degree*j)
333  connec(inoloc, iel) = ino
334  eta1 = offset(1) + .5_f64*(this%xgalo(ii + 1) + 1._f64)*lm%delta_eta1
335  eta2 = offset(2) + .5_f64*(this%xgalo(jj + 1) + 1._f64)*lm%delta_eta2
336  coords(1, ino) = this%tau%x1(eta1, eta2)
337  coords(2, ino) = this%tau%x2(eta1, eta2)
338  values(ino) = this%array(ii + 1, jj + 1, i + 1, j + 1)
339  end do
340  end do
341  end do
342  end do
343 
344  select case (this%degree)
345  case (1)
346  invpermut(1:nloc) = invpermut1
347  typelem = 3
348  case (2)
349  invpermut(1:nloc) = invpermut2
350  typelem = 10
351  case (3)
352  invpermut(1:nloc) = invpermut3
353  typelem = 36
354  case default
355  write (*, *) é'ordre non prvu'
356  stop
357  end select
358 
359  do i = 1, nloc
360  permut(invpermut(i)) = i
361  end do
362 
363  call sll_s_ascii_file_create(field_name//".msh", file_id, error)
364  write (file_id, '(A)') '$MeshFormat'
365  write (file_id, '(A)') '2 0 8'
366  write (file_id, '(A)') '$EndMeshFormat'
367  write (file_id, '(A)') '$Nodes'
368  write (file_id, *) neq
369  do k = 1, neq
370  write (file_id, '(i6,2x,3f10.5)') k, coords(1:2, k), 0.0
371  end do
372  write (file_id, '(A)') '$EndNodes'
373  write (file_id, '(A)') '$Elements'
374  write (file_id, *) nel
375 
376  write (my_fmt, '(a, i0, a)') '(3i6,', nloc, 'i5)'
377 
378  k = 0
379  do i = 1, lm%num_cells1
380  do j = 1, lm%num_cells2
381  k = k + 1
382  write (file_id, trim(my_fmt)) k, typelem, 0, (connec(l, k), l=1, nloc)
383  end do
384  end do
385  write (file_id, '(A)') '$EndElements'
386  write (file_id, '(A)') '$NodeData'
387  write (file_id, *) 1
388  write (file_id, *) 'values'
389  write (file_id, *) 1
390  write (file_id, *) 0
391  write (file_id, *) 3
392  write (file_id, *) 0
393  write (file_id, *) 1
394  write (file_id, *) neq
395  do k = 1, neq
396  write (file_id, '(i6,2x,f10.5)') k, values(k)
397  end do
398  write (file_id, '(A)') '$EndNodeData'
399 
400  close (file_id)
401  end associate
402 
403  end subroutine plot_dg_field_2d_with_gmsh
404 
405  subroutine plot_dg_field_2d_with_plotmtv(this, field_name)
406 
407  class(sll_t_dg_field_2d) :: this
408  character(len=*) :: field_name
409 
410  sll_int32 :: file_id
411  sll_int32 :: ni, nj, ino
412  sll_int32 :: i, j, ii, jj
413  sll_real64 :: offset(2)
414  sll_real64 :: eta1, eta2
415 
416  offset = 0.0_f64
417  call sll_s_ascii_file_create(field_name//".mtv", file_id, error)
418 
419  write (file_id, *) "$DATA=CONTCURVE"
420  write (file_id, *) "%equalscale=T"
421  write (file_id, *) "%contfill"
422  write (file_id, *) "%toplabel='"//field_name//"'"
423 
424  associate(lm => this%tau%mesh)
425 
426  do j = 1, lm%num_cells2
427  offset(2) = lm%eta2_min + real(j - 1, f64)*lm%delta_eta2
428  do jj = 1, merge(this%degree, this%degree + 1, j < lm%num_cells2)
429  do i = 1, lm%num_cells1
430  offset(1) = lm%eta1_min + real(i - 1, f64)*lm%delta_eta1
431  do ii = 1, merge(this%degree, this%degree + 1, i < lm%num_cells1)
432  eta1 = offset(1) + .5_f64*(this%xgalo(ii) + 1._f64)*lm%delta_eta1
433  eta2 = offset(2) + .5_f64*(this%xgalo(jj) + 1._f64)*lm%delta_eta2
434  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
435  sngl(this%tau%x2(eta1, eta2)), &
436  sngl(this%array(ii, jj, i, j))
437  end do
438  end do
439  end do
440  end do
441 
442  write (file_id, *)
443 
444  write (file_id, *) "$DATA=CURVE3D"
445  write (file_id, *) "%equalscale=T"
446  write (file_id, *) "%meshplot"
447  write (file_id, *) "%toplabel='"//field_name//"'"
448 
449  do j = 1, lm%num_cells2
450  do i = 1, lm%num_cells1
451  offset(1) = lm%eta1_min + (i - 1)*lm%delta_eta1
452  offset(2) = lm%eta2_min + (j - 1)*lm%delta_eta2
453  do jj = 1, this%degree
454  do ii = 1, this%degree
455  eta1 = offset(1) + .5_f64*(this%xgalo(ii) + 1._f64)*lm%delta_eta1
456  eta2 = offset(2) + .5_f64*(this%xgalo(jj) + 1._f64)*lm%delta_eta2
457  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
458  sngl(this%tau%x2(eta1, eta2)), &
459  sngl(this%array(ii, jj, i, j))
460  eta1 = offset(1) + .5_f64*(this%xgalo(ii + 1) + 1._f64)*lm%delta_eta1
461  eta2 = offset(2) + .5_f64*(this%xgalo(jj) + 1._f64)*lm%delta_eta2
462  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
463  sngl(this%tau%x2(eta1, eta2)), &
464  sngl(this%array(ii + 1, jj, i, j))
465  eta1 = offset(1) + .5_f64*(this%xgalo(ii + 1) + 1._f64)*lm%delta_eta1
466  eta2 = offset(2) + .5_f64*(this%xgalo(jj + 1) + 1._f64)*lm%delta_eta2
467  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
468  sngl(this%tau%x2(eta1, eta2)), &
469  sngl(this%array(ii + 1, jj + 1, i, j))
470  eta1 = offset(1) + .5_f64*(this%xgalo(ii) + 1._f64)*lm%delta_eta1
471  eta2 = offset(2) + .5_f64*(this%xgalo(jj + 1) + 1._f64)*lm%delta_eta2
472  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
473  sngl(this%tau%x2(eta1, eta2)), &
474  sngl(this%array(ii, jj + 1, i, j))
475  eta1 = offset(1) + .5_f64*(this%xgalo(ii) + 1._f64)*lm%delta_eta1
476  eta2 = offset(2) + .5_f64*(this%xgalo(jj) + 1._f64)*lm%delta_eta2
477  write (file_id, *) sngl(this%tau%x1(eta1, eta2)), &
478  sngl(this%tau%x2(eta1, eta2)), &
479  sngl(this%array(ii, jj, i, j))
480  write (file_id, *)
481  end do
482  end do
483  end do
484  end do
485 
486  ni = lm%num_cells1
487  nj = lm%num_cells2
488 
489  do j = 0, nj - 1
490  do i = 0, ni - 1
491  offset(1) = lm%eta1_min + i*lm%delta_eta1
492  offset(2) = lm%eta2_min + j*lm%delta_eta2
493  do jj = 0, this%degree
494  do ii = 0, this%degree
495  ino = 1 + ii + this%degree*i + (this%degree*ni + 1)*(jj + this%degree*j)
496  eta1 = offset(1) + .5*(this%xgalo(ii + 1) + 1.)*lm%delta_eta1
497  eta2 = offset(2) + .5*(this%xgalo(jj + 1) + 1.)*lm%delta_eta2
498  write (file_id, "(a)", advance="no") "@text x1="
499  write (file_id, "(g15.3)", advance="no") this%tau%x1(eta1, eta2)
500  write (file_id, "(a)", advance="no") " y1="
501  write (file_id, "(g15.3)", advance="no") this%tau%x2(eta1, eta2)
502  write (file_id, "(a)", advance="no") " z1=0. lc=5 ll='"
503  write (file_id, "(i4)", advance="no") ino
504  write (file_id, "(a)") "'"
505  end do
506  end do
507  end do
508  end do
509 
510  write (file_id, *) "$end"
511  close (file_id)
512  end associate
513 
514  end subroutine plot_dg_field_2d_with_plotmtv
515 
516  subroutine plot_dg_field_2d_with_xdmf(this, field_name, time)
517 
518  class(sll_t_dg_field_2d) :: this
519  character(len=*) :: field_name
520  sll_real64, optional :: time
521 
522  sll_int32 :: file_id
523  sll_int32 :: i, j, k, ii, jj
524  sll_real64 :: offset(2)
525  sll_real64 :: eta1, eta2
526  sll_int32 :: clength
527 
528  clength = len_trim(field_name)
529 
530  sll_assert(this%degree < 10)
531 
532  call sll_s_ascii_file_create(field_name//".xmf", file_id, error)
533 
534  write (file_id, "(a)") "<?xml version='1.0' ?>"
535  write (file_id, "(a)") "<!DOCTYPE Xdmf SYSTEM 'Xdmf.dtd' []>"
536  write (file_id, "(a)") "<Xdmf Version='2.'>"
537  write (file_id, "(a)") "<Domain>"
538  write (file_id, "(a)") "<Grid Name='Mesh' GridType='Collection'>"
539  if (present(time)) then
540  write (file_id, "(a13,g15.3,a3)") "<Time Value='", time, "'/>"
541  end if
542 
543  associate(lm => this%tau%mesh)
544 
545  k = 0
546  do i = 1, lm%num_cells1
547  do j = 1, lm%num_cells2
548  offset(1) = lm%eta1_min + real(i - 1, f64)*lm%delta_eta1
549  offset(2) = lm%eta2_min + real(j - 1, f64)*lm%delta_eta2
550  k = k + 1
551  write (file_id, "(a,i6,a)") "<Grid Name='Mesh", k, "' GridType='Uniform'>"
552  write (file_id, "(a,2i5,a)") &
553  "<Topology TopologyType='2DSMesh' NumberOfElements='", &
554  this%degree + 1, this%degree + 1, "'/>"
555  write (file_id, "(a)") "<Geometry GeometryType='X_Y'>"
556  write (file_id, "(a,2i3,a)") "<DataItem Dimensions='", this%degree + 1, &
557  this%degree + 1, "' NumberType='Float' Format='XML'>"
558  do jj = 1, this%degree + 1
559  do ii = 1, this%degree + 1
560  eta1 = offset(1) + .5*(this%xgalo(ii) + 1.0_f64)*lm%delta_eta1
561  eta2 = offset(2) + .5*(this%xgalo(jj) + 1.0_f64)*lm%delta_eta2
562  write (file_id, "(f7.3)", advance='no') sngl(this%tau%x1(eta1, eta2))
563  end do
564  write (file_id, *)
565  end do
566  write (file_id, "(a)") "</DataItem>"
567  write (file_id, "(a,2i3,a)") "<DataItem Dimensions='", this%degree + 1, &
568  this%degree + 1, "' NumberType='Float' Format='XML'>"
569  do jj = 1, this%degree + 1
570  do ii = 1, this%degree + 1
571  eta1 = offset(1) + .5*(this%xgalo(ii) + 1.0_f64)*lm%delta_eta1
572  eta2 = offset(2) + .5*(this%xgalo(jj) + 1.0_f64)*lm%delta_eta2
573  write (file_id, "(f7.3)", advance='no') sngl(this%tau%x2(eta1, eta2))
574  end do
575  write (file_id, *)
576  end do
577  write (file_id, "(a)") "</DataItem>"
578  write (file_id, "(a)") "</Geometry>"
579  write (file_id, "(a)") "<Attribute Name='values' &
580  & AttributeType='Scalar' Center='Node'>"
581  write (file_id, "(a,2i3,a)") "<DataItem Dimensions='", &
582  this%degree + 1, this%degree + 1, &
583  "' NumberType='Float' Precision='4' Format='XML'>"
584  do jj = 1, this%degree + 1
585  do ii = 1, this%degree + 1
586  eta1 = offset(1) + .5_f64*(this%xgalo(ii) + 1._f64)*lm%delta_eta1
587  eta2 = offset(2) + .5_f64*(this%xgalo(jj) + 1._f64)*lm%delta_eta2
588  write (file_id, "(f7.3)", advance='no') sngl(this%array(ii, jj, i, j))
589  end do
590  write (file_id, *)
591  end do
592  write (file_id, "(a)") "</DataItem>"
593  write (file_id, "(a)") "</Attribute>"
594  write (file_id, "(a)") "</Grid>"
595  end do
596  end do
597  write (file_id, "(a)") "</Grid>"
598  write (file_id, "(a)") "</Domain>"
599  write (file_id, "(a)") "</Xdmf>"
600 
601  end associate
602 
603  end subroutine plot_dg_field_2d_with_xdmf
604 
605 end module sll_m_dg_fields
606 
Module that contains routines to write data in ASCII format file.
subroutine, public sll_s_ascii_file_create(file_name, file_id, error)
Create ASCII file.
Cartesian mesh basic types.
Abstract class for coordinate transformations.
Solve Maxwell equations on cartesian domain with Disconituous Galerkine method:
subroutine write_dg_field_2d_to_file(this, field_name, file_format, time)
subroutine plot_dg_field_2d_with_gmsh(this, field_name)
type(sll_t_dg_field_2d) function dg_field_add(W1, W2)
integer(kind=i32) error
subroutine plot_dg_field_2d_with_plotmtv(this, field_name)
subroutine, public sll_s_dg_field_2d_init(this, degree, tau, init_function)
subroutine plot_dg_field_2d_with_xdmf(this, field_name, time)
type(sll_t_dg_field_2d) function dg_field_sub(W1, W2)
subroutine set_value_dg_field_2d(this, init_function, time)
subroutine plot_dg_field_2d_with_gnuplot(this, field_name)
type(sll_t_dg_field_2d) function, pointer, public sll_f_new_dg_field_2d(degree, tau, init_function)
real(kind=f64) function, dimension(n), public sll_f_gauss_lobatto_points(n, a, b)
Returns a 1d array of size (n) containing gauss-lobatto points in the interval [a,...
real(kind=f64) function, dimension(n), public sll_f_gauss_lobatto_weights(n, a, b)
Returns a 1d array of size (n) containing gauss-lobatto weights in the interval [a,...
Some common numerical utilities.
subroutine, public sll_s_int2string(istep, cstep)
Convert an integer < 9999 to a 4 characters string.
Object to describe field data with DG numerical method.
    Report Typos and Errors