feat(io): added ability to export the rate calculations of any engine to a python file
GridFire can now (to a very limited degree) approximate the abilities of pynucastro in so far as it can not just solve an engine but it can also export it to a python file. Currently only the rates are exported so no solver can yet be used (since things like the rest of the RHS and the jacobian are missing) but this is a step in that direction
This commit is contained in:
21
src/include/gridfire/io/generative/python.h
Normal file
21
src/include/gridfire/io/generative/python.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "gridfire/reaction/reaction.h"
|
||||
#include "gridfire/engine/engine_abstract.h"
|
||||
|
||||
namespace gridfire::io::gen {
|
||||
struct PyFunctionDef {
|
||||
std::string func_name;
|
||||
std::string func_code;
|
||||
std::vector<std::string> module_req;
|
||||
};
|
||||
|
||||
PyFunctionDef exportReactionToPy(const reaction::Reaction& reaction);
|
||||
|
||||
std::string exportEngineToPy(const DynamicEngine& engine);
|
||||
|
||||
void exportEngineToPy(const DynamicEngine& engine, const std::string& fileName);
|
||||
}
|
||||
Reference in New Issue
Block a user