/////////////////////////////////////////////////////////////////////////////// // // File CellModel.h // // For more information, please see: http://www.nektar.info // // The MIT License // // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA), // Department of Aeronautics, Imperial College London (UK), and Scientific // Computing and Imaging Institute, University of Utah (USA). // // License for the specific language governing rights and limitations under // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. // // Description: Cell model base class. // /////////////////////////////////////////////////////////////////////////////// #ifndef NEKTAR_SOLVERS_ADRSOLVER_CELLMODELS_CELLMODEL #define NEKTAR_SOLVERS_ADRSOLVER_CELLMODELS_CELLMODEL #include #include #include #include #include #include #include namespace Nektar { // Forward declaration class CellModel; /// A shared pointer to an EquationSystem object typedef boost::shared_ptr CellModelSharedPtr; /// Datatype of the NekFactory used to instantiate classes derived from /// the EquationSystem class. typedef LibUtilities::NekFactory< std::string, CellModel, const LibUtilities::SessionReaderSharedPtr&, const MultiRegions::ExpListSharedPtr&> CellModelFactory; CellModelFactory& GetCellModelFactory(); /// Cell model base class. class CellModel { public: CellModel(const LibUtilities::SessionReaderSharedPtr& pSession, const MultiRegions::ExpListSharedPtr& pField); virtual ~CellModel() {} /// Initialise the cell model storage and set initial conditions void Initialise(); /// Time integrate the cell model by one PDE timestep void TimeIntegrate( const Array > &inarray, Array > &outarray, const NekDouble time); /// Compute the derivatives of cell model variables void Update( const Array >&inarray, Array >&outarray, const NekDouble time) { v_Update(inarray, outarray, time); } /// Print a summary of the cell model void PrintSummary(std::ostream &out) { v_PrintSummary(out); } protected: /// Session LibUtilities::SessionReaderSharedPtr m_session; /// Transmembrane potential field from PDE system MultiRegions::ExpListSharedPtr m_field; /// Number of physical points. int m_nq; /// Number of variables in cell model (inc. transmembrane voltage) int m_nvar; /// Timestep for pde model NekDouble m_lastTime; /// Number of substeps to take int m_substeps; /// Cell model solution variables Array > m_cellSol; /// Cell model integration workspace Array > m_wsp; /// Flag indicating whether nodal projection in use bool m_useNodal; /// StdNodalTri for cell model calculations StdRegions::StdNodalTriExpSharedPtr m_nodalTri; /// Temporary array for nodal projection Array > m_nodalTmp; /// Indices of cell model variables which are concentrations std::vector m_concentrations; /// Indices of cell model variables which are gates std::vector m_gates; /// Storage for gate tau values Array > m_gates_tau; virtual void v_Update( const Array >&inarray, Array >&outarray, const NekDouble time) = 0; virtual void v_PrintSummary(std::ostream &out) = 0; virtual void v_SetInitialConditions() = 0; }; } #endif /* CELLMODEL_H_ */