ASL  0.1.7
Advanced Simulation Library
aslFDElChemKinetics.h
Go to the documentation of this file.
1 /*
2  * Advanced Simulation Library <http://asl.org.il>
3  *
4  * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5  *
6  *
7  * This file is part of Advanced Simulation Library (ASL).
8  *
9  * ASL is free software: you can redistribute it and/or modify it
10  * under the terms of the GNU Affero General Public License as
11  * published by the Free Software Foundation, version 3 of the License.
12  *
13  * ASL 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 Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 
23 
24 #ifndef ASLFDELCHEMKINETICS_H
25 #define ASLFDELCHEMKINETICS_H
26 
27 #include "aslSingleKernelNM.h"
29 
30 
31 namespace acl
32 {
33  class VectorOfElementsData;
34  class VectorOfElements;
35 }
36 
37 namespace asl
38 {
39  class VectorTemplate;
40  template <typename V> class DataWithGhostNodes;
41  typedef DataWithGhostNodes<acl::VectorOfElementsData> DataWithGhostNodesACLData;
42  typedef std::shared_ptr<DataWithGhostNodesACLData> SPDataWithGhostNodesACLData;
43 
45 
89  {
90  public:
94 
95  private:
96  acl::SPKernel kernelJ;
97  std::vector<Data> aI;
98  Data efSPhi;
99  Field phi;
100 
101  vector<double> nI;
102  Param j0;
103  Param beta;
104  double n;
105 
106  virtual void init0();
107  public:
108  FDBVKinetics(Data a0,
109  double n0,
110  Data aI,
111  double nI,
112  Data phiS,
113  Field phi,
114  const Param & j0,
115  const Param & beta,
116  double n);
117  void setElectricFieldSource(Field phi);
119  inline Data & getAI(unsigned int i=0);
120  void addAI(Data ai, double ni);
121  void executeJ();
122  };
123 
124  typedef std::shared_ptr<FDBVKinetics> SPFDBVKinetics;
125 
126 
128  double n0,
130  double nI,
133  double j0,
134  double beta,
135  double n);
136 
137 
138 
139 // ------------------------- Implementation ------------------------
140 
141  inline FDBVKinetics::Data & FDBVKinetics::getAI(unsigned int i)
142  {
143  return aI[i];
144  }
145 
146 } // asl
147 #endif // ASLFDADVECTIONDIFFUSION_H
void setElectricFieldSource(Field phi)
Data & getAI(unsigned int i=0)
SPFDBVKinetics generateFDBVKinetics(SPDataWithGhostNodesACLData a0, double n0, SPDataWithGhostNodesACLData aI, double nI, SPDataWithGhostNodesACLData phiS, SPAbstractDataWithGhostNodes phi, double j0, double beta, double n)
Advanced Simulation Library.
Definition: aslDataInc.h:30
Advanced Computational Language.
Definition: acl.h:40
std::shared_ptr< Kernel > SPKernel
std::shared_ptr< DataWithGhostNodesACLData > SPDataWithGhostNodesACLData
Definition: aslGenerators.h:47
Numerical method which computes electrode reactions.
std::shared_ptr< FDBVKinetics > SPFDBVKinetics
DataWithGhostNodes< acl::VectorOfElementsData > DataWithGhostNodesACLData
Definition: aslGenerators.h:45
SPDataWithGhostNodesACLData Data
FDBVKinetics(Data a0, double n0, Data aI, double nI, Data phiS, Field phi, const Param &j0, const Param &beta, double n)
SPAbstractDataWithGhostNodes Field
The class represents several Element.
acl::VectorOfElements Param
void addAI(Data ai, double ni)
std::shared_ptr< AbstractDataWithGhostNodes > SPAbstractDataWithGhostNodes
Definition: aslGenerators.h:50
Field getElectricFieldSource() const