MOOSE - Multiscale Object Oriented Simulation Environment
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SaveModels.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 ** This program is part of 'MOOSE', the
3 ** Messaging Object Oriented Simulation Environment.
4 ** Copyright (C) 2003-2009 Upinder S. Bhalla. and NCBS
5 ** It is made available under the terms of the
6 ** GNU Lesser General Public License version 2.1
7 ** See the file COPYING.LIB for the full notice.
8 **********************************************************************/
9 
10 #include <fstream>
11 #include "header.h"
12 #include "Shell.h"
13 
14 // Defined in kinetics/WriteKkit.cpp
15 extern void writeKkit( Id model, const string& fname );
16 extern void writeCspace (Id model, const string& fname );
17 
31 void Shell::doSaveModel( Id model, const string& fileName, bool qFlag )
32  const
33 {
34  // string modelFamily = Field< string >::get( model, "modelFamily" );
35  // if ( modelFamily != "kinetic" ) {
36  // cout << "Warning: Shell::doSaveModel: Do not know how to save "
37  // "model of family '" << modelFamily << "'.\n";
38  // return;
39  // }
40 
41  size_t pos = fileName.find( "." );
42  string fileType = fileName.substr( pos );
43 
44  if ( fileType == ".g" ) { // kkit model requested.
45  // cout << "Cannot write kkit model at this point\n";
46  writeKkit( model, fileName );
47  } else if (fileType == ".cspace"){
48  // writeCspace( model, fileName );
49  cout << "Cannot write cspace model at this point\n";
50  } else {
51  cout << "Warning: Shell::doSaveModel: Do not know how to save "
52  "model of file type '" << fileType << "'.\n";
53  }
54 }
void writeKkit(Id model, const string &fname)
Definition: WriteKkit.cpp:525
void doSaveModel(Id model, const string &fileName, bool qflag=0) const
Definition: SaveModels.cpp:31
Definition: Id.h:17
void writeCspace(Id model, const string &fname)