Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
AMReX_Habec_K.H
Go to the documentation of this file.
1#ifndef AMREX_Habec_K_H_
2#define AMREX_Habec_K_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_LO_BCTYPES.H>
6#include <AMReX_FArrayBox.H>
7#include <AMReX_IArrayBox.H>
8
10namespace amrex::detail {
12 void comp_bf (Real& bf1, Real& bf2, Real sb, Real h, int bct, Real bcl, int bho)
13 {
14 Real fac = sb / (h*h);
15 if (bct == AMREX_LO_DIRICHLET) {
16 Real h2 = Real(0.5)*h;
17 if (bho >= 1) {
18 Real h3 = Real(3.0)*h2;
19 bf1 = fac*((h3 - bcl)/(bcl + h2) - Real(1.0));
20 bf2 = fac*(bcl - h2)/(bcl + h3);
21 } else {
22 bf1 = fac*( h/(bcl + h2) - Real(1.0));
23 bf2 = Real(0.0);
24 }
25 } else if (bct == AMREX_LO_NEUMANN) {
26 bf1 = -fac;
27 bf2 = Real(0.0);
28 } else {
29 bf1 = bf2 = Real(0.0);
30 AMREX_ASSERT_WITH_MESSAGE(false,"hpmat: unsupported boundary type");
31 }
32 }
33
35 void comp_bflo (Real& bf1, Real& bf2, Real& bflo, Real sb, Real h, int bct, Real bcl, int bho)
36 {
37 Real fac = sb / (h*h);
38 if (bct == AMREX_LO_DIRICHLET) {
39 Real h2 = Real(0.5)*h;
40 bflo = fac * ( h / (bcl + h2) - Real(1.0));
41 if (bho >= 1) {
42 Real h3 = Real(3.0)*h2;
43 bf1 = fac*((h3 - bcl)/(bcl + h2) - Real(1.0));
44 bf2 = fac*(bcl - h2)/(bcl + h3);
45 } else {
46 bf1 = bflo;
47 bf2 = Real(0.0);
48 }
49 } else if (bct == AMREX_LO_NEUMANN) {
50 bflo = -fac;
51 bf1 = -fac;
52 bf2 = Real(0.0);
53 } else {
54 bf1 = bf2 = bflo = Real(0.0);
55 AMREX_ASSERT_WITH_MESSAGE(false,"hpmat: unsupported boundary type");
56 }
57 }
58}
60
61#if (AMREX_SPACEDIM == 1)
62#include <AMReX_Habec_1D_K.H>
63#elif (AMREX_SPACEDIM == 2)
64#include <AMReX_Habec_2D_K.H>
65#elif (AMREX_SPACEDIM == 3)
66#include <AMReX_Habec_3D_K.H>
67#endif
68
69#endif
#define AMREX_ASSERT_WITH_MESSAGE(EX, MSG)
Definition AMReX_BLassert.H:37
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
#define AMREX_LO_NEUMANN
Definition AMReX_LO_BCTYPES.H:6
#define AMREX_LO_DIRICHLET
Definition AMReX_LO_BCTYPES.H:5
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79