1#ifndef AMREX_COORDSYS_2D_C_H_
2#define AMREX_COORDSYS_2D_C_H_
3#include <AMReX_Config.H>
24 Real dv = dx[0]*dx[1];
25 for (
int j = lo.y; j <= hi.y; ++j) {
27 for (
int i = lo.x; i <= hi.x; ++i) {
34 const Real pi = Real(3.1415926535897932);
35 for (
int j = lo.y; j <= hi.y; ++j) {
37 for (
int i = lo.x; i <= hi.x; ++i) {
38 Real ri =
offset[0] + dx[0]*(i);
40 Real v = pi*dx[1]*dx[0]*(ro + ri);
41 vol(i,j,0) = std::abs(v);
47 const Real pi = Real(3.1415926535897932);
48 for (
int j = lo.y; j <= hi.y; ++j) {
49 Real ti =
offset[1] + dx[1]*(j);
51 Real tmp = (Real(2.)*pi)*(std::cos(ti)-std::cos(to))/Real(3.0);
53 for (
int i = lo.x; i <= hi.x; ++i) {
54 Real ri =
offset[0] + dx[0]*(i);
56 Real v = tmp*(ro-ri)*(ro*ro+ro*ri+ri*ri);
57 vol(i,j,0) = std::abs(v);
75 Real a = (dir == 0) ? dx[1] : dx[0];
76 for (
int j = lo.y; j <= hi.y; ++j) {
78 for (
int i = lo.x; i <= hi.x; ++i) {
85 const Real pi = Real(3.1415926535897932);
88 for (
int j = lo.y; j <= hi.y; ++j) {
90 for (
int i = lo.x; i <= hi.x; ++i) {
91 Real ri =
offset[0] + dx[0]*(i);
92 Real a = std::abs((Real(2.)*pi)*ri*dx[1]);
99 for (
int j = lo.y; j <= hi.y; ++j) {
101 for (
int i = lo.x; i <= hi.x; ++i) {
102 Real rc =
offset[0] + dx[0]*(i+Real(0.5));
103 Real a = std::abs(dx[0]*(Real(2.)*pi)*rc);
111 const Real pi = Real(3.1415926535897932);
114 for (
int j = lo.y; j <= hi.y; ++j) {
115 Real ti =
offset[1] + dx[1]*(j);
116 Real to = ti + dx[1];
117 Real tmp = (Real(2.)*pi)*(std::cos(ti)-std::cos(to));
119 for (
int i = lo.x; i <= hi.x; ++i) {
120 Real ri =
offset[0] + dx[0]*(i);
121 Real a = std::abs(tmp*ri*ri);
128 for (
int j = lo.y; j <= hi.y; ++j) {
129 Real ti =
offset[1] + dx[1]*(j);
130 Real tmp = pi*std::sin(ti);
132 for (
int i = lo.x; i <= hi.x; ++i) {
133 Real ri =
offset[0] + dx[0]*(i);
134 Real ro = ri + dx[0];
135 Real a = std::abs(tmp*(ro-ri)*(ro+ri));
155 for (
int j = lo.y; j <= hi.y; ++j) {
157 for (
int i = lo.x; i <= hi.x; ++i) {
158 dloga(i,j,0) = Real(0.0);
166 for (
int j = lo.y; j <= hi.y; ++j) {
168 for (
int i = lo.x; i <= hi.x; ++i) {
169 Real rc =
offset[0] + dx[0]*(i+Real(0.5));
170 dloga(i,j,0) = Real(1.0)/rc;
176 for (
int j = lo.y; j <= hi.y; ++j) {
178 for (
int i = lo.x; i <= hi.x; ++i) {
179 dloga(i,j,0) = Real(0.0);
188 for (
int j = lo.y; j <= hi.y; ++j) {
190 for (
int i = lo.x; i <= hi.x; ++i) {
191 Real rc =
offset[0] + dx[0]*(i+Real(0.5));
192 dloga(i,j,0) = Real(2.0)/rc;
198 for (
int j = lo.y; j <= hi.y; ++j) {
199 Real ti =
offset[1] + dx[1]*(j);
200 Real to = ti + dx[1];
201 Real tmp = Real(1.0)/std::tan(Real(0.5)*(ti+to));
203 for (
int i = lo.x; i <= hi.x; ++i) {
204 Real rc =
offset[0] + dx[0]*(i+Real(0.5) );
205 dloga(i,j,0) = tmp/rc;
#define AMREX_PRAGMA_SIMD
Definition AMReX_Extension.H:80
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1089
Definition AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE void amrex_setvol(Box const &bx, Array4< Real > const &vol, GpuArray< Real, 1 > const &offset, GpuArray< Real, 1 > const &dx, const int coord) noexcept
Definition AMReX_COORDSYS_1D_C.H:15
AMREX_GPU_HOST_DEVICE void amrex_setarea(Box const &bx, Array4< Real > const &area, GpuArray< Real, 1 > const &offset, GpuArray< Real, 1 > const &dx, const int, const int coord) noexcept
Definition AMReX_COORDSYS_1D_C.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 ubound(Array4< T > const &a) noexcept
Definition AMReX_Array4.H:315
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition AMReX_Array4.H:308
AMREX_GPU_HOST_DEVICE void amrex_setdloga(Box const &bx, Array4< Real > const &dloga, GpuArray< Real, 1 > const &offset, GpuArray< Real, 1 > const &dx, const int, const int coord) noexcept
Definition AMReX_COORDSYS_1D_C.H:96
Definition AMReX_Array4.H:61
Definition AMReX_Array.H:34