Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
donotcompute.cpp
Go to the documentation of this file.
1/*
2 * This file is part of Vlasiator.
3 * Copyright 2010-2016 Finnish Meteorological Institute
4 *
5 * For details of usage, see the COPYING file and read the "Rules of the Road"
6 * at http://www.physics.helsinki.fi/vlasiator/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
26
27#include <cstdlib>
28#include <iostream>
29
30#include "donotcompute.h"
31#include "../object_wrapper.h"
32
33using namespace std;
34
35namespace SBC {
38
41
43 creal& t,
44 Project &project
45 ) {
46 precedence = 0;
47 dynamic = false;
48 }
49
50 void DoNotCompute::assignSysBoundary(dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>&,
52 // Does nothing.
53 }
54
55 void DoNotCompute::applyInitialState(dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
59 const vector<CellID>& cells = getLocalCells();
60 #pragma omp parallel for
61 for (size_t i=0; i<cells.size(); ++i) {
62 SpatialCell* cell = mpiGrid[cells[i]];
63 if(cell->sysBoundaryFlag != this->getIndex()) continue;
64
65 //TODO: Set fields on B grid to 0
66 cell->parameters[CellParams::RHOM] = 0.0;
67 cell->parameters[CellParams::VX] = 0.0;
68 cell->parameters[CellParams::VY] = 0.0;
69 cell->parameters[CellParams::VZ] = 0.0;
70 cell->parameters[CellParams::RHOQ] = 0.0;
72 cell->parameters[CellParams::VX_DT2] = 0.0;
73 cell->parameters[CellParams::VY_DT2] = 0.0;
74 cell->parameters[CellParams::VZ_DT2] = 0.0;
76 }
77 }
78
79 void DoNotCompute::updateState(dccrg::Dccrg<SpatialCell, dccrg::Cartesian_Geometry>& mpiGrid,
82 fsgrids::bgbspan bgb, creal t) {}
83
84 void DoNotCompute::getFaces(bool *faces) {}
85
86 string DoNotCompute::getName() const {return "DoNotCompute";}
87
89}
for i
Definition Dispersion.m:24
void initSysBoundary(creal &t, Project &project) override
virtual ~DoNotCompute()
void updateState(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, creal t) override
void getFaces(bool *faces) override
uint getIndex() const override
virtual void getParameters() override
void applyInitialState(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid, fsgrids::perbspan perb, fsgrids::bgbspan bgb, Project &project) override
static void addParameters()
void assignSysBoundary(dccrg::Dccrg< SpatialCell, dccrg::Cartesian_Geometry > &mpiGrid, fsgrids::technicalspan technical, FieldSolverGrid &fsgrid) override
std::string getName() const override
std::array< Real, CellParams::N_SPATIAL_CELL_PARAMS > parameters
const std::vector< CellID > & getLocalCells()
Definition main.cpp:39
fsgrid::FsGrid< FS_STENCIL_WIDTH > FieldSolverGrid
Definition definitions.h:78
const float creal
Definition definitions.h:42
std::span< std::array< Real, fsgrids::bfield::N_BFIELD > > perbspan
Definition common.h:434
std::span< technical > technicalspan
Definition common.h:452
std::span< std::array< Real, bgbfield::N_BGB > > bgbspan
Definition common.h:444