def main(): # This command loads the file into the path '/model', and tells # the system to use the gsl solver. modelId = moose.loadModel( '../Genesis_files/reaction.g', 'model', 'gsl' ) moose.start( 100.0 ) # Run the model for 100 seconds. # Iterate through all plots, dump their contents to data.plot. for x in moose.wildcardFind( '/model/graphs/conc#/#' ): moose.element( x[0] ).xplot( 'data.plot', x[0].name ) moose.saveModel( modelId, 'saveReaction.g' ) quit()
# modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, Fifth # Floor, Boston, MA 02110-1301, USA. # # # Code: """This example illustrates loading a kinetic model defined in Genesis format into Moose using "loadModel" function and using "saveModel" function one can save the model back to Genesis format """ import sys #sys.path.append('../../python') import moose if __name__ == '__main__': """ The script demonstates to convert Chemical (Genesis) file back to Genesis file using moose """ model = moose.loadModel('../genesis/reaction.g', '/model') moose.saveModel('/model', 'testsave.g')