MCPcopy Create free account
hub / github.com/Cantera/cantera / newSolution

Function newSolution

src/base/Solution.cpp:191–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191shared_ptr<Solution> newSolution(const string &infile,
192 const string &name,
193 const string &transport,
194 const vector<shared_ptr<Solution>> &adjacent)
195{
196 // get file extension
197 size_t dot = infile.find_last_of(".");
198 string extension;
199 if (dot != npos) {
200 extension = toLowerCopy(infile.substr(dot+1));
201 }
202
203 if (extension == "cti" || extension == "xml") {
204 throw CanteraError("newSolution",
205 "The CTI and XML formats are no longer supported.");
206 }
207
208 // load YAML file
209 auto rootNode = AnyMap::fromYamlFile(infile);
210 const AnyMap& phaseNode = rootNode.at("phases").getMapWhere("name", name);
211 auto sol = newSolution(phaseNode, rootNode, transport, adjacent);
212 sol->setSource(infile);
213 return sol;
214}
215
216shared_ptr<Solution> newSolution(const string& infile, const string& name,
217 const string& transport, const vector<string>& adjacent)

Callers 15

newidealgasmix_Function · 0.85
calc_potentialsFunction · 0.85
kinetics1Function · 0.85
runexampleFunction · 0.85
mainFunction · 0.85
demoprogFunction · 0.85
flamespeedFunction · 0.85
benchmarkFunction · 0.85
runFunction · 0.85
transport_exampleFunction · 0.85
TESTFunction · 0.85
SetUpTestCaseMethod · 0.85

Calls 15

toLowerCopyFunction · 0.85
CanteraErrorClass · 0.85
newThermoFunction · 0.85
InputFileErrorClass · 0.85
newKineticsFunction · 0.85
setSourceMethod · 0.80
nDimMethod · 0.80
addAdjacentMethod · 0.80
hasKeyMethod · 0.80
nAdjacentMethod · 0.80
adjacentMethod · 0.80
type_strMethod · 0.80

Tested by 11

TESTFunction · 0.68
SetUpTestCaseMethod · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
TESTFunction · 0.68
initSolutionMethod · 0.68