3 #include "sll_assert.h"
4 #include "sll_memory.h"
5 #include "sll_working_precision.h"
42 sll_int32,
intent(in) :: ic
43 sll_int32,
intent(in) :: jc
44 sll_int32,
intent(in) :: integration_degree
47 sll_real64,
dimension(2, integration_degree) :: pts_g1
48 sll_real64,
dimension(2, integration_degree) :: pts_g2
49 sll_real64 :: eta1_min
50 sll_real64 :: eta2_min
63 sll_assert(
associated(t))
64 associate(m => t%mesh)
66 sll_assert(ic <= m%num_cells1)
67 sll_assert(jc <= m%num_cells2)
81 min1 = eta1_min + (ic - 1)*delta1
82 max1 = eta1_min + ic*delta1
83 min2 = eta2_min + (jc - 1)*delta2
84 max2 = eta2_min + jc*delta2
94 do j = 1, integration_degree
95 do i = 1, integration_degree
96 jac = t%jacobian(pts_g1(1, i), pts_g2(1, j))
97 vol = vol + abs(jac)*pts_g1(2, i)*pts_g2(2, j)
107 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
108 sll_int32,
intent(in) :: ic
109 sll_int32,
intent(in) :: jc
110 sll_int32,
intent(in) :: integration_degree
112 sll_real64,
dimension(2, 2) :: jac_mat
114 sll_real64,
dimension(2, integration_degree) :: pts_g2
117 sll_real64 :: eta2_min
127 sll_real64 :: x1_eta2
128 sll_real64 :: x2_eta2
131 sll_assert(
associated(t))
133 associate(m => t%mesh)
136 sll_assert(ic <= m%num_cells1)
137 sll_assert(jc <= m%num_cells2)
142 delta1 = m%delta_eta1
143 eta2_min = m%eta2_min
144 delta2 = m%delta_eta2
150 min2 = eta2_min + (jc - 1)*delta2
151 max2 = eta2_min + jc*delta2
153 sll_f_gauss_legendre_points_and_weights(integration_degree, min2, max2)
155 do j = 1, integration_degree
158 jac_mat(:, :) = t%jacobian_matrix(eta1, pts_g2(1, j))
159 x1_eta2 = jac_mat(1, 2)
160 x2_eta2 = jac_mat(2, 2)
161 len = len + sqrt(x1_eta2**2 + x2_eta2**2)*pts_g2(2, j)
169 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
170 sll_int32,
intent(in) :: ic
171 sll_int32,
intent(in) :: jc
172 sll_int32,
intent(in) :: integration_degree
174 sll_real64,
dimension(2, 2) :: jac_mat
176 sll_real64,
dimension(2, integration_degree) :: pts_g2
179 sll_real64 :: eta2_min
189 sll_real64 :: x1_eta2
190 sll_real64 :: x2_eta2
193 sll_assert(
associated(t))
195 associate(m => t%mesh)
198 sll_assert(ic <= m%num_cells1)
199 sll_assert(jc <= m%num_cells2)
204 delta1 = m%delta_eta1
205 eta2_min = m%eta2_min
206 delta2 = m%delta_eta2
211 eta1 = (ic - 1)*delta1
212 min2 = eta2_min + (jc - 1)*delta2
213 max2 = eta2_min + jc*delta2
218 sll_f_gauss_legendre_points_and_weights(integration_degree, min2, max2)
221 do j = 1, integration_degree
224 jac_mat(:, :) = t%jacobian_matrix(eta1, pts_g2(1, j))
225 x1_eta2 = jac_mat(1, 2)
226 x2_eta2 = jac_mat(2, 2)
227 len = len + sqrt(x1_eta2**2 + x2_eta2**2)*pts_g2(2, j)
235 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
236 sll_int32,
intent(in) :: ic
237 sll_int32,
intent(in) :: jc
238 sll_int32,
intent(in) :: integration_degree
240 sll_real64,
dimension(2, 2) :: jac_mat
241 sll_real64,
dimension(2, integration_degree) :: pts_g1
244 sll_real64 :: eta1_min
251 sll_real64 :: x1_eta1
252 sll_real64 :: x2_eta1
255 sll_assert(
associated(t))
256 associate(m => t%mesh)
259 sll_assert(ic <= m%num_cells1)
260 sll_assert(jc <= m%num_cells2)
264 eta1_min = m%eta1_min
265 delta1 = m%delta_eta1
266 delta2 = m%delta_eta2
271 min1 = eta1_min + (ic - 1)*delta1
272 max1 = eta1_min + ic*delta1
275 sll_f_gauss_legendre_points_and_weights(integration_degree, min1, max1)
279 do i = 1, integration_degree
282 jac_mat(:, :) = t%jacobian_matrix(pts_g1(1, i), eta2)
283 x1_eta1 = jac_mat(1, 1)
284 x2_eta1 = jac_mat(2, 1)
285 len = len + sqrt(x1_eta1**2 + x2_eta1**2)*pts_g1(2, i)
293 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
294 sll_int32,
intent(in) :: ic
295 sll_int32,
intent(in) :: jc
296 sll_int32,
intent(in) :: integration_degree
298 sll_real64,
dimension(2, 2) :: jac_mat
299 sll_real64,
dimension(2, integration_degree) :: pts_g1
302 sll_real64 :: eta1_min
313 sll_real64 :: x1_eta1
314 sll_real64 :: x2_eta1
317 sll_assert(
associated(t))
319 associate(m => t%mesh)
322 sll_assert(ic <= m%num_cells1)
323 sll_assert(jc <= m%num_cells2)
327 eta1_min = m%eta1_min
328 delta1 = m%delta_eta1
329 delta2 = m%delta_eta2
334 min1 = eta1_min + (ic - 1)*delta1
335 max1 = eta1_min + ic*delta1
336 eta2 = (jc - 1)*delta2
342 sll_f_gauss_legendre_points_and_weights(integration_degree, min1, max1)
346 do i = 1, integration_degree
349 jac_mat(:, :) = t%jacobian_matrix(pts_g1(1, i), eta2)
350 x1_eta1 = jac_mat(1, 1)
351 x2_eta1 = jac_mat(2, 1)
352 len = len + sqrt(x1_eta1**2 + x2_eta1**2)*pts_g1(2, i)
359 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
360 sll_int32,
intent(in) :: ic
361 sll_int32,
intent(in) :: jc
362 sll_int32,
intent(in) :: integration_degree
363 sll_real64,
dimension(2) :: res
365 sll_real64,
dimension(2, 2) :: inv_jac_mat
367 sll_real64,
dimension(2, integration_degree) :: pts_g2
370 sll_real64 :: eta2_min
380 sll_real64 :: eta1_x1
381 sll_real64 :: eta1_x2
382 sll_real64 :: edge_length
385 sll_assert(
associated(t))
387 associate(m => t%mesh)
390 sll_assert(ic <= m%num_cells1)
391 sll_assert(jc <= m%num_cells2)
394 delta1 = m%delta_eta1
395 eta2_min = m%eta2_min
396 delta2 = m%delta_eta2
404 min2 = eta2_min + (jc - 1)*delta2
405 max2 = eta2_min + jc*delta2
410 sll_f_gauss_legendre_points_and_weights(integration_degree, min2, max2)
422 do j = 1, integration_degree
425 inv_jac_mat(:, :) = t%inverse_jacobian_matrix(eta1, pts_g2(1, j))
426 eta1_x1 = inv_jac_mat(1, 1)
427 eta1_x2 = inv_jac_mat(2, 1)
428 sll_assert(t%jacobian(eta1, pts_g2(1, j)) > 0.0_f64)
429 res(1) = res(1) + eta1_x1*pts_g2(2, j)
430 res(2) = res(2) + eta1_x2*pts_g2(2, j)
432 res(1) = res(1)*edge_length
433 res(2) = res(2)*edge_length
438 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
439 sll_int32,
intent(in) :: ic
440 sll_int32,
intent(in) :: jc
441 sll_int32,
intent(in) :: integration_degree
442 sll_real64,
dimension(2) :: res
444 sll_real64,
dimension(2, 2) :: inv_jac_mat
445 sll_real64,
dimension(2, integration_degree) :: pts_g2
448 sll_real64 :: eta2_min
458 sll_real64 :: eta1_x1
459 sll_real64 :: eta1_x2
460 sll_real64 :: edge_length
463 sll_assert(
associated(t))
465 associate(m => t%mesh)
468 sll_assert(ic <= m%num_cells1)
469 sll_assert(jc <= m%num_cells2)
471 delta1 = m%delta_eta1
472 eta2_min = m%eta2_min
473 delta2 = m%delta_eta2
480 eta1 = (ic - 1)*delta1
481 min2 = eta2_min + (jc - 1)*delta2
482 max2 = eta2_min + jc*delta2
487 sll_f_gauss_legendre_points_and_weights(integration_degree, min2, max2)
498 do j = 1, integration_degree
501 inv_jac_mat(:, :) = t%inverse_jacobian_matrix(eta1, pts_g2(1, j))
502 eta1_x1 = inv_jac_mat(1, 1)
503 eta1_x2 = inv_jac_mat(2, 1)
504 sll_assert(t%jacobian(eta1, pts_g2(1, j)) > 0.0_f64)
505 res(1) = res(1) + eta1_x1*pts_g2(2, j)
506 res(2) = res(2) + eta1_x2*pts_g2(2, j)
509 res(1) = -res(1)*edge_length
510 res(2) = -res(2)*edge_length
517 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
518 sll_int32,
intent(in) :: ic
519 sll_int32,
intent(in) :: jc
520 sll_int32,
intent(in) :: integration_degree
521 sll_real64,
dimension(2) :: res
523 sll_real64,
dimension(2, 2) :: inv_jac_mat
524 sll_real64,
dimension(2, integration_degree) :: pts_g1
527 sll_real64 :: eta1_min
538 sll_real64 :: eta2_x1
539 sll_real64 :: eta2_x2
540 sll_real64 :: edge_length
543 sll_assert(
associated(t))
545 associate(m => t%mesh)
548 sll_assert(ic <= m%num_cells1)
549 sll_assert(jc <= m%num_cells2)
551 eta1_min = m%eta1_min
552 delta1 = m%delta_eta1
553 delta2 = m%delta_eta2
558 min1 = eta1_min + (ic - 1)*delta1
559 max1 = eta1_min + ic*delta1
565 pts_g1(:, :) = sll_f_gauss_legendre_points_and_weights(integration_degree, min1, max1)
578 do i = 1, integration_degree
581 inv_jac_mat(:, :) = t%inverse_jacobian_matrix(pts_g1(1, i), eta2)
582 eta2_x1 = inv_jac_mat(2, 1)
583 eta2_x2 = inv_jac_mat(2, 2)
584 sll_assert(t%jacobian(pts_g1(1, i), eta2) > 0.0_f64)
585 res(1) = res(1) + eta2_x1*pts_g1(2, i)
586 res(2) = res(2) + eta2_x2*pts_g1(2, i)
588 res(1) = res(1)*edge_length
589 res(2) = res(2)*edge_length
596 class(sll_c_coordinate_transformation_2d_base),
pointer :: t
597 sll_int32,
intent(in) :: ic
598 sll_int32,
intent(in) :: jc
599 sll_int32,
intent(in) :: integration_degree
600 sll_real64,
dimension(2) :: res
602 sll_real64,
dimension(2, 2) :: inv_jac_mat
603 sll_real64,
dimension(2, integration_degree) :: pts_g1
606 sll_real64 :: eta1_min
617 sll_real64 :: eta2_x1
618 sll_real64 :: eta2_x2
619 sll_real64 :: edge_length
622 sll_assert(
associated(t))
624 associate(m => t%mesh)
627 sll_assert(ic <= m%num_cells1)
628 sll_assert(jc <= m%num_cells2)
630 eta1_min = m%eta1_min
631 delta1 = m%delta_eta1
632 delta2 = m%delta_eta2
637 min1 = eta1_min + (ic - 1)*delta1
638 max1 = eta1_min + ic*delta1
639 eta2 = (jc - 1)*delta2
644 pts_g1(:, :) = sll_f_gauss_legendre_points_and_weights(integration_degree, min1, max1)
657 do i = 1, integration_degree
660 inv_jac_mat(:, :) = t%inverse_jacobian_matrix(pts_g1(1, i), eta2)
661 eta2_x1 = inv_jac_mat(2, 1)
662 eta2_x2 = inv_jac_mat(2, 2)
663 sll_assert(t%jacobian(pts_g1(1, i), eta2) > 0.0_f64)
664 res(1) = res(1) + eta2_x1*pts_g1(2, i)
665 res(2) = res(2) + eta2_x2*pts_g1(2, i)
668 res(1) = -res(1)*edge_length
669 res(2) = -res(2)*edge_length
Cartesian mesh basic types.
Gauss-Legendre integration.
real(kind=f64) function, dimension(2, 1:npoints), public sll_f_gauss_legendre_points_and_weights(npoints, a, b)
Returns a 2d array of size (2,npoints) containing gauss-legendre points and weights in the interval [...
real(kind=f64) function, dimension(2), public sll_f_normal_integral_eta1_plus(T, ic, jc, integration_degree)
real(kind=f64) function, public sll_f_edge_length_eta1_minus(T, ic, jc, integration_degree)
dimension(2) normal_integral_eta1_minus(T, ic, jc, integration_degree)
dimension(2) normal_integral_eta2_minus(T, ic, jc, integration_degree)
real(kind=f64) function, public sll_f_edge_length_eta1_plus(T, ic, jc, integration_degree)
real(kind=f64) function, public sll_f_edge_length_eta2_minus(T, ic, jc, integration_degree)
real(kind=f64) function, dimension(2) normal_integral_eta2_plus(T, ic, jc, integration_degree)
real(kind=f64) function, public sll_f_cell_volume(T, ic, jc, integration_degree)
real(kind=f64) function, public sll_f_edge_length_eta2_plus(T, ic, jc, integration_degree)