Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve interface inconsistencies between CLI-interface and C-API #335

Merged
merged 5 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions include/common/SolutionRecorderImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder
if (!_storeCoordinates)
return;

if (!_axialCoords.empty())
if (!_axialCoords.empty() && ((_keepBulkSingletonDim && (_nAxialCells == 1)) || (_nAxialCells > 1)))
writer.template vector<double>("AXIAL_COORDINATES", _axialCoords);
if (!_radialCoords.empty())
writer.template vector<double>("RADIAL_COORDINATES", _radialCoords);
Expand All @@ -350,7 +350,7 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder
unsigned int offset = 0;
for (std::size_t pt = 0; pt < _nParShells.size(); ++pt)
{
if (_nParShells[pt] == 0)
if (_nParShells[pt] == 0 || (!_keepParticleSingletonDim && (_nParShells[pt] == 1)))
continue;

oss.str("");
Expand Down Expand Up @@ -882,7 +882,9 @@ class InternalStorageUnitOpRecorder : public ISolutionRecorder
{
oss.str("");
oss << prefix << "_VOLUME";
writer.template matrix<double>(oss.str(), _numTimesteps, _nVolumeDof, _curStorage->volume.data(), 1);
// Note: since the CSTR is currently the only unit operation that simulates volume, and _numVolumeDof is 1, we always write this as a vector.
// Once other unit operations are implemented with more than one volume, we should add the option here to write this as a matrix (singletonDimension filed etc, see other output).
writer.template vector<double>(oss.str(), _numTimesteps * _nVolumeDof, _curStorage->volume.data(), 1);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcadet/model/StirredTankModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CSTRModel : public UnitOperationBase
virtual unsigned int numInletPorts() const CADET_NOEXCEPT { return 1; }
virtual unsigned int numOutletPorts() const CADET_NOEXCEPT { return 1; }
virtual unsigned int numParticleTypes() const CADET_NOEXCEPT { return _nParType; }
virtual unsigned int numParticleShells(unsigned int parType) const CADET_NOEXCEPT { return 1; }
virtual unsigned int numParticleShells(unsigned int parType) const CADET_NOEXCEPT { return 0; }
virtual unsigned int numBoundStates(unsigned int parType) const CADET_NOEXCEPT { return _strideBound[parType]; }
virtual unsigned int numMobilePhaseDofs() const CADET_NOEXCEPT { return _nComp; }
virtual unsigned int numParticleMobilePhaseDofs() const CADET_NOEXCEPT { return 0; }
Expand Down
Loading