SPEED
GET_DIME_DG.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine get_dime_dg (nm, sd, tag_mat, cs_nnz_loc, cs_loc, nn_loc, local_n_num, ne_loc, local_el_num, xs, ys, zs, nel_dg_loc, nel_dg_glo, i4count, mpi_id, mpi_comm)
 Counts number of DG elements (local and global)
 

Function/Subroutine Documentation

◆ get_dime_dg()

subroutine get_dime_dg (   nm,
dimension(nm)  sd,
dimension(nm)  tag_mat,
  cs_nnz_loc,
dimension(nm)  cs_loc,
  nn_loc,
dimension(nm)  local_n_num,
  ne_loc,
dimension(nm)  local_el_num,
dimension(nm)  xs,
dimension(nm)  ys,
dimension(nm)  zs,
  nel_dg_loc,
  nel_dg_glo,
dimension(nm)  i4count,
  mpi_id,
  mpi_comm 
)

Counts number of DG elements (local and global)

Author
Ilario Mazzieri
Date
September, 2013
Version
1.0
Parameters
[in]nm= number of materials
[in]sd(nm)= spectral degree vector
[in]tag_mat(nm)= tag for materials
[in]cs_nnz_loclength of cs_loc
[in]cs_loclocal spectral connectivity vector
[in]nn_locnumber of local nodes
[in]local_n_numlocal node numeration
[in]ne_locnumber of local elements
[in]local_el_numlocal element numeration
[in]xsx-coord local spectral nodes
[in]ysy-coord local spectral nodes
[in]zsz-coord local spectral nodes
[in]i4countvector identifying nodes where DG conditions are applied
[in]mpi_idMPI processor identity
[in]mpi_commMPI common world
[out]nel_dg_locnumber of local dg elements
[out]nel_dg_glonumber of global dg elements

Definition at line 41 of file GET_DIME_DG.f90.

70
71 do im = 1,nm
72
73 nn = sd(im) +1
74
75 do ie = 1,ned
76 if (cs_loc(cs_loc(ie -1) + 0) .eq. tag_mat(im)) then
77
78 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(1 -1) +1)
79 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(1 -1) +1)
80 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(1 -1) +1)
81 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(1 -1) +1)
82
83 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
84 nel_dg_loc = nel_dg_loc +1
85 endif
86
87 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(1 -1) +1)
88 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(nn -1) +1)
89 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(nn -1) +1)
90 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(1 -1) +1)
91
92 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
93 nel_dg_loc = nel_dg_loc +1
94 endif
95
96 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(1 -1) +1)
97 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(nn -1) +1)
98 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(nn -1) +1)
99 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(1 -1) +1)
100
101 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
102 nel_dg_loc = nel_dg_loc +1
103 endif
104
105 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(1 -1) +(nn -1) +1)
106 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(nn -1) +1)
107 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(nn -1) +1)
108 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(nn -1) +1)
109
110 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
111 nel_dg_loc = nel_dg_loc +1
112 endif
113
114 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(1 -1) +1)
115 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(1 -1) +nn*(nn -1) +(nn -1) +1)
116 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(nn -1) +1)
117 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(1 -1) +1)
118
119
120 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
121 nel_dg_loc = nel_dg_loc +1
122 endif
123
124 ne1 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(1 -1) +1)
125 ne2 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(1 -1) +(nn -1) +1)
126 ne3 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(nn -1) +1)
127 ne4 = cs_loc(cs_loc(ie -1) +nn*nn*(nn -1) +nn*(nn -1) +(1 -1) +1)
128
129
130 if ((i4count(ne1).ne.0) .and. (i4count(ne2).ne.0) .and. (i4count(ne3).ne.0) .and. (i4count(ne4).ne.0)) then
131 nel_dg_loc = nel_dg_loc +1
132 endif
133
134 endif
135 enddo
136 enddo
137
138
139 call mpi_allreduce(nel_dg_loc, nel_dg_glo, 1, speed_integer, mpi_sum, mpi_comm, mpi_ierr)
140
141
142
143