7 #include <configure.hpp>
11 #include <athena/bvals/bvals.hpp>
12 #include <athena/bvals/bvals_interfaces.hpp>
13 #include <athena/hydro/hydro.hpp>
14 #include <athena/mesh/mesh.hpp>
15 #include <athena/parameter_input.hpp>
18 #include <application/application.hpp>
19 #include <application/globals.hpp>
32 #define MAX_DATA_SIZE 25
35 : has_bot_neighbor(false),
36 has_top_neighbor(false),
39 periodic_boundary(false),
43 Application::Logger app(
"snap");
44 app->Log(
"Initialize ImplicitSolver");
46 implicit_flag = pin->GetOrAddInteger(
"hydro",
"implicit_flag", 0);
47 int nc1 = pmb->ncells1, nc2 = pmb->ncells2, nc3 = pmb->ncells3;
48 int n2max = nc2, n3max = nc3;
58 du_.NewAthenaArray(NHYDRO, nc3, nc2, nc1);
69 int idn = 0, ivx = 1, ivy = 2, ivz = 3, ien = 4;
86 Application::Logger app(
"snap");
87 app->Log(
"Destroy ImplicitSolver");
112 }
else if (dir == X2DIR) {
128 if ((
pmy_block_->pmy_mesh->mesh_bcs[2 * dir] == BoundaryFlag::periodic) &&
129 (
pmy_block_->pmy_mesh->mesh_bcs[2 * dir + 1] == BoundaryFlag::periodic)) {
135 if (
pmy_block_->pbval->block_bcs[2 * dir] == BoundaryFlag::polar)
140 if (
pmy_block_->pbval->block_bcs[2 * dir + 1] == BoundaryFlag::polar)
153 for (
int n = 0; n <
pmy_block_->pbval->nneighbor; ++n) {
154 NeighborBlock &nb =
pmy_block_->pbval->neighbor[n];
156 if ((nb.ni.ox1 == -1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0)) {
160 if ((nb.ni.ox1 == 1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0)) {
164 }
else if (
mydir_ == X2DIR) {
165 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == -1) && (nb.ni.ox3 == 0)) {
169 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 1) && (nb.ni.ox3 == 0)) {
174 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == -1)) {
178 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 1)) {
186 Mesh
const *pmesh = pmb->pmy_mesh;
189 if (pmb->block_size.x1min > pmesh->mesh_size.x1min)
first_block =
false;
190 if (pmb->block_size.x1max < pmesh->mesh_size.x1max)
last_block =
false;
191 }
else if (
mydir_ == X2DIR) {
192 if (pmb->block_size.x2min > pmesh->mesh_size.x2min)
first_block =
false;
193 if (pmb->block_size.x2max < pmesh->mesh_size.x2max)
last_block =
false;
195 if (pmb->block_size.x3min > pmesh->mesh_size.x3min)
first_block =
false;
196 if (pmb->block_size.x3max < pmesh->mesh_size.x3max)
last_block =
false;
308 std::string str = std::to_string(recvid);
310 str += std::to_string(sendid);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool has_top_neighbor
int CreateMPITag(int lid, int bufid, std::string phy)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool has_bot_neighbor
Eigen::Matrix< Real, 5, 5 > p3_
CoordinateDirection mydir_
AthenaArray< Real > coefficients_
void SetDirection(CoordinateDirection dir)
Eigen::Matrix< Real, 5, 5 > p2_
MeshBlock const * pmy_block_
ImplicitSolver(MeshBlock *pmb, ParameterInput *pin)
double max(double x1, double x2, double x3)
void NewCArray(T **&a, int n1, int n2)