Commit e1e09d43 authored by Marco Drache's avatar Marco Drache
Browse files

feature: expanded export of polymer products

parent d0a2af07
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -70,8 +70,8 @@ public:
	void initConcentrationNumMoleculesExport() const;
	void initReactionsCountExport() const;
	void exportConcentrationNumMolecules(double _reactionTime) const;

	void exportReactionsCount(double _reactionTime) const;
	void exportPolymers(std::string _prefixFilename, double _reactionTime, bool _binaryExport, bool _writeHeader);
	
protected:
	void exportComplete(time_t _timerStart, TerminationConditions _terminationConditions) const;
+18 −0
Original line number Diff line number Diff line
@@ -443,5 +443,23 @@ double SimulationController::getVolume() {
void SimulationController::updateSolidsContent(double _solidsContent) {
	currentState->setSolidsContent(_solidsContent);
}
void SimulationController::exportPolymers(std::string _prefixFilename, double _reactionTime, bool _binaryExport, bool _writeHeader) {
	for (const auto& species : currentModel->getSpecies()) {
		if (species.isPolymer) {
			if (_binaryExport) {
				kMC->exportPolymerSpecies(species.id, simulationParameter.outputdir + "/" + _prefixFilename + species.name + "." + to_string(_reactionTime), FileTypePolymerSpecies::Binary, currentModel);
			}
			else {
				kMC->exportPolymerSpecies(species.id, simulationParameter.outputdir + "/" + _prefixFilename + species.name + "." + to_string(_reactionTime), FileTypePolymerSpecies::CLD, currentModel);
			}
		}
	}
	if (_binaryExport) {
		kMC->exportPolymersBinary(simulationParameter.outputdir + "/" + _prefixFilename + "Polymers." + to_string(_reactionTime), currentModel, 0, _writeHeader);
	}
	else {
		kMC->exportPolymersCLD(simulationParameter.outputdir + "/" + "Polymers." + to_string(_reactionTime), currentModel);
	}
}
} // namespace