LBIBCell
 All Classes Functions Variables Friends Pages
BioSolverGrowth.cpp
1 /* Copyright (c) 2013 David Sichau <mail"at"sichau"dot"eu>
2  * 2013-2015 Simon Tanaka <tanakas"at"gmx"dot"ch>
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20  * THE SOFTWARE.
21  */
22 #include <LbmLib/include/solver/BioSolver/BioSolverGrowth.hpp>
23 #include <LbmLib/include/geometry/GeometryHandler.hpp>
24 #include <LbmLib/include/GlobalSimulationParameters.hpp>
25 #include <LbmLib/include/nodes/PhysicalNode.hpp>
26 #include <vector>
27 #include <string>
28 #include <iostream>
29 namespace LbmLib {
30 namespace solver {
31 
32 namespace {
33  const unsigned int FREQUENCY = 1;
34  const double source = 0.0025;
35  double cdeconcentration;
36 }
37 
38 BioSolverGrowth::BioSolverGrowth() : BioBaseSolver()
39 {}
40 
42  geometry::GeometryHandler& geometryhandler,
43  solver::ForceSolver& forcesolver
44  ) {
45 
46  if (Parameters.getCurrentIteration()%FREQUENCY != 0) {
47  return;
48  }
49 
50  // add mass to the cells:
51 #pragma omp parallel for schedule(dynamic)
52  for (unsigned int ity = 0;
53  ity < geometryhandler.getPhysicalNodes().size();
54  ity++) { // loop y direction
55  for (unsigned int itx = 0;
56  itx < geometryhandler.getPhysicalNodes()[0].size();
57  itx++) { // loop x direction
58  if (geometryhandler.getPhysicalNodes()[ity][itx]->getDomainIdentifier() != 0 ) {
59  //cdeconcentration = fluidGrid[it][i]->getCDESolverSlow("CDESolverD2Q5HH").getC();
60  geometryhandler.getPhysicalNodes()[ity][itx]->getFluidSolver().addMass(source);
61  }
62  }
63  }
64 }
65 
66 const std::string BioSolverGrowth::name = "BioSolverGrowth";
67 }
68 } // end namespace
69 
The actual force solver.
Definition: ForceSolver.hpp:43
virtual void applyBioProcess(geometry::GeometryHandler &geometryhandler, solver::ForceSolver &forcesolver)
Applies biological processes.
const std::vector< std::vector< nodes::PhysicalNode * > > & getPhysicalNodes() const
getPhysicalNodes Getter method for the physical node grid
class responsible for generating the internal geometry representation