| 22 | Coordinates* coord; |
| 23 | |
| 24 | int Diffusion::init(bool UNUSED(restarting)) { |
| 25 | // Get the options |
| 26 | Options* meshoptions = Options::getRoot()->getSection("mesh"); |
| 27 | |
| 28 | coord = mesh->getCoordinates(); |
| 29 | |
| 30 | meshoptions->get("Lx", Lx, 1.0); |
| 31 | meshoptions->get("Ly", Ly, 1.0); |
| 32 | |
| 33 | /*this assumes equidistant grid*/ |
| 34 | int nguard = mesh->xstart; |
| 35 | coord->dx = Lx / (mesh->GlobalNx - 2 * nguard); |
| 36 | coord->dy = Ly / (mesh->GlobalNy - 2 * nguard); |
| 37 | |
| 38 | SAVE_ONCE2(Lx, Ly); |
| 39 | |
| 40 | Options* cytooptions = Options::getRoot()->getSection("cyto"); |
| 41 | cytooptions->get("dis", mu_N, 1); |
| 42 | |
| 43 | SAVE_ONCE(mu_N); |
| 44 | |
| 45 | //set mesh |
| 46 | coord->g11 = 1.0; |
| 47 | coord->g22 = 1.0; |
| 48 | coord->g33 = 1.0; |
| 49 | coord->g12 = 0.0; |
| 50 | coord->g13 = 0.0; |
| 51 | coord->g23 = 0.0; |
| 52 | |
| 53 | coord->g_11 = 1.0; |
| 54 | coord->g_22 = 1.0; |
| 55 | coord->g_33 = 1.0; |
| 56 | coord->g_12 = 0.0; |
| 57 | coord->g_13 = 0.0; |
| 58 | coord->g_23 = 0.0; |
| 59 | coord->geometry(); |
| 60 | |
| 61 | // Tell BOUT++ to solve N |
| 62 | SOLVE_FOR(N); |
| 63 | |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | int Diffusion::rhs(BoutReal t) { |
| 68 | mesh->communicate(N); // Communicate guard cells |
nothing calls this directly
no test coverage detected