Commit 5c131b9f authored by Elias Barbers's avatar Elias Barbers
Browse files

version 2.24.1

parent 7fd79c1a
Pipeline #469096 passed with stages
in 74 minutes and 29 seconds
Version 2.24.1
===========
- Fix S-functions build for windows
- Fix observer output for individual twoports in the aging S-function
Version 2.24.0
===========
- Expression object can rescale parameters and output value
......
......@@ -6,7 +6,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
cmake_policy(SET CMP0009 NEW)
set(ISEAFrameVERSION_MAJOR 2)
set(ISEAFrameVERSION_MINOR 24)
set(ISEAFramePATCH_LEVEL 0)
set(ISEAFramePATCH_LEVEL 1)
set(ISEAFrameNAME "misc")
set(ISEAFrameVERSION
"${ISEAFrameVERSION_MAJOR}.${ISEAFrameVERSION_MINOR}.${ISEAFramePATCH_LEVEL}"
......
#include "aging_simulation.h"
#include "../electrical/electrical_simulation.h"
#include "../factory/factorybuilder_for_aging.h"
#include "../factory/observer/createObserver.h"
#include "../thermal/thermal_simulation.h"
#ifdef BUILD_AGING_SIMULATION
namespace simulation
{
template < typename Matrix, typename T, bool filterTypeChoice >
AgingSimulation< Matrix, T, filterTypeChoice >::AgingSimulation(
const boost::shared_ptr< xmlparser::XmlParameter > &rootXmlNode,
boost::shared_ptr< simulation::ElectricalSimulation< Matrix, T, filterTypeChoice > > electricalSimulation,
boost::shared_ptr< simulation::ThermalSimulation< Matrix, T, filterTypeChoice > > thermalSimulation,
const std::vector< boost::shared_ptr< electrical::TwoPort< Matrix > > > & /*cells*/, double agingStepTime,
factory::FactoryBuilderForAging< Matrix, T > *factoryBuilder, const std::string &uuid )
: mTime( 0.0 )
, mElectricalSimulation( electricalSimulation )
, mThermalSimulation( thermalSimulation )
, mAgingStepTime( agingStepTime )
, mCycleLength( electricalSimulation->mSimulationDuration )
, mLastAgingDataTime( 0.0 )
, mCollectAgingData( true )
{
mCellAgingTwoPorts = factoryBuilder->mAgingTwoPortFactory->GetObjectsOfClass( "CellElement" );
mAgingTwoPorts.reserve( factoryBuilder->mAgingTwoPortFactory->GetNumberOfObjects() );
for ( const auto &cellAgingTp : mCellAgingTwoPorts )
{
mAgingTwoPorts.push_back( cellAgingTp );
for ( const auto &child : cellAgingTp->GetChildren() )
{
mAgingTwoPorts.push_back( child );
}
}
mAgingObserver =
CreateAgingObserver< std::vector< boost::shared_ptr< aging::AgingTwoPort< Matrix > > >, Matrix, filterTypeChoice >(
mAgingTwoPorts, rootXmlNode.get(), uuid );
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CollectCellAgingData()
{
if ( !mCollectAgingData )
return;
double timestep = mTime - mLastAgingDataTime;
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CollectData( timestep );
}
mLastAgingDataTime = mTime;
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::ResetToPointInTime( double time )
{
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->ResetToPointInTime( time );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CalculateAging( double timestep, bool scaleToAgingStep )
{
double scaleFactor = 1.0;
if ( scaleToAgingStep )
scaleFactor = mAgingStepTime * 3600 * 24 / timestep;
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CalculateAging( timestep, scaleFactor );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CalculateAging( double timestep, double scaleFactor )
{
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CalculateAging( timestep, scaleFactor );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::ResetThElStates()
{
mElectricalSimulation->ResetSystemStates();
mElectricalSimulation->ResetSocStates();
mElectricalSimulation->UpdateSystemValues();
mThermalSimulation->ResetThermalElementTemperatures();
mThermalSimulation->UpdateAllThermalStatesTemperatures();
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::SetCollectAgingData( bool collectAgingData )
{
mCollectAgingData = collectAgingData;
if ( mCollectAgingData )
mLastAgingDataTime = mTime;
}
template < typename Matrix, typename T, bool filterTypeChoice >
double AgingSimulation< Matrix, T, filterTypeChoice >::GetAgingStepTime() const
{
return mAgingStepTime;
}
} // namespace simulation
template class simulation::AgingSimulation< myMatrixType, double, true >;
template class simulation::AgingSimulation< myMatrixType, double, false >;
#endif
......@@ -3,9 +3,14 @@
#ifdef BUILD_AGING_SIMULATION
#include "../electrical/electrical_simulation.h"
#include "../electrical/twoport.h"
#include "../factory/factorybuilder_for_aging.h"
#include "../factory/observer/createObserver.h"
#include "../thermal/thermal_simulation.h"
#include "../xmlparser/tinyxml2/xmlparameterimpl.h"
#include "../xmlparser/tinyxml2/xmlparserimpl.h"
#include <boost/shared_ptr.hpp>
namespace aging
......@@ -75,6 +80,106 @@ class AgingSimulation
bool mCollectAgingData;
};
template < typename Matrix, typename T, bool filterTypeChoice >
AgingSimulation< Matrix, T, filterTypeChoice >::AgingSimulation(
const boost::shared_ptr< xmlparser::XmlParameter > &rootXmlNode,
boost::shared_ptr< simulation::ElectricalSimulation< Matrix, T, filterTypeChoice > > electricalSimulation,
boost::shared_ptr< simulation::ThermalSimulation< Matrix, T, filterTypeChoice > > thermalSimulation,
const std::vector< boost::shared_ptr< electrical::TwoPort< Matrix > > > & /*cells*/, double agingStepTime,
factory::FactoryBuilderForAging< Matrix, T > *factoryBuilder, const std::string &uuid )
: mTime( 0.0 )
, mElectricalSimulation( electricalSimulation )
, mThermalSimulation( thermalSimulation )
, mAgingStepTime( agingStepTime )
, mCycleLength( electricalSimulation->mSimulationDuration )
, mLastAgingDataTime( 0.0 )
, mCollectAgingData( true )
{
mCellAgingTwoPorts = factoryBuilder->mAgingTwoPortFactory->GetObjectsOfClass( "CellElement" );
mAgingTwoPorts.reserve( factoryBuilder->mAgingTwoPortFactory->GetNumberOfObjects() );
for ( const auto &cellAgingTp : mCellAgingTwoPorts )
{
mAgingTwoPorts.push_back( cellAgingTp );
for ( const auto &child : cellAgingTp->GetChildren() )
{
mAgingTwoPorts.push_back( child );
}
}
mAgingObserver =
CreateAgingObserver< std::vector< boost::shared_ptr< aging::AgingTwoPort< Matrix > > >, Matrix, filterTypeChoice >(
mAgingTwoPorts, rootXmlNode.get(), uuid );
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CollectCellAgingData()
{
if ( !mCollectAgingData )
return;
double timestep = mTime - mLastAgingDataTime;
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CollectData( timestep );
}
mLastAgingDataTime = mTime;
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::ResetToPointInTime( double time )
{
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->ResetToPointInTime( time );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CalculateAging( double timestep, bool scaleToAgingStep )
{
double scaleFactor = 1.0;
if ( scaleToAgingStep )
scaleFactor = mAgingStepTime * 3600 * 24 / timestep;
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CalculateAging( timestep, scaleFactor );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::CalculateAging( double timestep, double scaleFactor )
{
for ( auto &agingTwoPort : mCellAgingTwoPorts )
{
agingTwoPort->CalculateAging( timestep, scaleFactor );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::ResetThElStates()
{
mElectricalSimulation->ResetSystemStates();
mElectricalSimulation->ResetSocStates();
mElectricalSimulation->UpdateSystemValues();
mThermalSimulation->ResetThermalElementTemperatures();
mThermalSimulation->UpdateAllThermalStatesTemperatures();
}
template < typename Matrix, typename T, bool filterTypeChoice >
void AgingSimulation< Matrix, T, filterTypeChoice >::SetCollectAgingData( bool collectAgingData )
{
mCollectAgingData = collectAgingData;
if ( mCollectAgingData )
mLastAgingDataTime = mTime;
}
template < typename Matrix, typename T, bool filterTypeChoice >
double AgingSimulation< Matrix, T, filterTypeChoice >::GetAgingStepTime() const
{
return mAgingStepTime;
}
} // namespace simulation
#endif
#endif
......@@ -3,6 +3,6 @@ file(GLOB_RECURSE SOURCEFILES *.cpp)
find_package(MATIO REQUIRED)
add_library(cinterface ${SOURCEFILES})
target_link_libraries(cinterface PUBLIC ISEAFrameNumeric matio::matio)
target_link_libraries(cinterface PUBLIC ISEAFrameNumeric)
target_compile_definitions(cinterface PUBLIC ${COMMON_DEFINITIONS}
${NUMERIC_DEFINITIONS})
${NUMERIC_DEFINITIONS})
......@@ -86,21 +86,40 @@ extern "C"
{
PointerStructure_ThEl_Aging *pointerStructure = (PointerStructure_ThEl_Aging *)*pointerStructureAddress;
std::vector< boost::shared_ptr< electrical::TwoPort< myUnit > > > outputTwoports;
const auto &agingTwoports = pointerStructure->mAgingSimulation->mAgingTwoPorts;
outputTwoports.reserve( agingTwoports.size() );
for ( const auto &twoport : agingTwoports )
size_t numberOfCellelements = pointerStructure->mElectricalSimulation->mCellElements.size();
const auto &observedTwoports = pointerStructure->mElectricalSimulation->mObserver->GetObservedTwoPorts();
if ( observedTwoports.size() > numberOfCellelements )
{
outputTwoports.push_back( twoport->GetTwoPort() );
// Reorder the observed twoports so that all elements inside one cell end up in the same row in the output
// matrix. The vector is interpreted as a column-major matrix with the number of rows equal to the number of cells
std::vector< boost::shared_ptr< electrical::TwoPort< myMatrixType > > > twoportVector( observedTwoports.size(), nullptr );
size_t outputRows = numberOfCellelements;
size_t outputColumns = std::ceil( (double)observedTwoports.size() / outputRows );
// first column has all the cellements, so they can just be copied
for ( size_t i = 0; i < numberOfCellelements; ++i )
{
twoportVector[i] = observedTwoports[i];
}
for ( size_t i = numberOfCellelements; i < observedTwoports.size(); ++i )
{
size_t row = ( i - numberOfCellelements ) / ( outputColumns - 1 );
size_t column = ( i - numberOfCellelements ) % ( outputColumns - 1 ) + 1;
twoportVector[column * outputRows + row] = observedTwoports[i];
}
pointerStructure->mElectricalSimulation->mObserver =
CreateTwoPortObserver< std::vector< boost::shared_ptr< electrical::TwoPort< myUnit > > >, myUnit, false >(
&twoportVector, 0, voltageOutputVec, currentOutputVec, powerOutputVec, socOutputVec, socSurfaceOutputVec );
}
else
{
pointerStructure->mElectricalSimulation->mObserver =
CreateTwoPortObserver< std::vector< boost::shared_ptr< electrical::TwoPort< myUnit > > >, myUnit, false >(
&observedTwoports, 0, voltageOutputVec, currentOutputVec, powerOutputVec, socOutputVec, socSurfaceOutputVec );
}
pointerStructure->mElectricalSimulation->mObserver =
CreateTwoPortObserver< std::vector< boost::shared_ptr< electrical::TwoPort< myUnit > > >, myUnit, false >(
&outputTwoports, 0, voltageOutputVec, currentOutputVec, powerOutputVec, socOutputVec, socSurfaceOutputVec );
}
void GetRealSizes_ThEl_Aging( const char *configStr, const size_t *pointerStructureAddress, size_t *stateSize,
size_t *numberOfCells, size_t *probeSize, size_t *agingTwoportSize )
size_t *numberOfCells, size_t *probeSize, size_t *agingTwoportSize, size_t *observerSize )
{
xmlparser::tinyxml2::XmlParserImpl parser;
parser.ReadFromMem( configStr );
......@@ -114,6 +133,7 @@ extern "C"
PointerStructure_ThEl_Aging *pointerStructure = (PointerStructure_ThEl_Aging *)*pointerStructureAddress;
electricalStateSize = pointerStructure->mElectricalSimulation->mStateSystemGroup.GetStateCount();
*agingTwoportSize = pointerStructure->mAgingSimulation->mAgingTwoPorts.size();
*observerSize = pointerStructure->mElectricalSimulation->mObserver->GetObservedTwoPorts().size();
}
else
{
......@@ -126,6 +146,7 @@ extern "C"
nullptr, {}, 0, &factoryBuilder ) );
electricalStateSize = pointerStructure.mElectricalSimulation->mStateSystemGroup.GetStateCount();
*agingTwoportSize = pointerStructure.mAgingSimulation->mAgingTwoPorts.size();
*observerSize = pointerStructure.mElectricalSimulation->mObserver->GetObservedTwoPorts().size();
}
if ( stateSize )
*stateSize = themalStateSize + electricalStateSize;
......
......@@ -22,7 +22,7 @@ extern "C"
real_T *powerOutputVec, real_T *socOutputVec, real_T *socSurfaceOutputVec );
void GetRealSizes_ThEl_Aging( const char *configStr, const size_t *pointerStructureAddress, size_t *stateSize,
size_t *numberOfCells, size_t *probeSize, size_t *agingTwoportSize );
size_t *numberOfCells, size_t *probeSize, size_t *agingTwoportSize, size_t *realObserverSize );
/// Apply the aging input to the cells
void SetAging_ThEl_Aging( const size_t *pointerStructureAddress, const real_T *capFactors, const real_T *resFactors,
......
#include "electrical_simulation.h"
#include "../misc/matrixInclude.h"
namespace simulation
{
template < typename Matrix, typename T, bool filterTypeChoice >
ElectricalSimulation< Matrix, T, filterTypeChoice >::ElectricalSimulation(
const boost::shared_ptr< xmlparser::XmlParameter > &rootXmlNode, T maxSimulationStepDuration, T simulationDuration,
double socStopCriterion, std::vector< boost::shared_ptr< ::electrical::TwoPort< Matrix > > > *cells,
factory::FactoryBuilder< Matrix, T > *factoryBuilder, const std::string &uuid )
: mTime( 0.0 )
, mDeltaTime( maxSimulationStepDuration )
, mSimulationDuration( simulationDuration )
, mLastUnconstrainedDeltaTime( maxSimulationStepDuration )
, mMaxSimulationStepDuration( maxSimulationStepDuration )
, mStepStartTime( 0.0 )
, mSocStopCriterion( socStopCriterion )
, mPowerStopCriterion( 0.0 )
, mNumberOfSteps( 0 )
{
// if no FactoryBuilder is passed, create a local one in this scope
boost::scoped_ptr< factory::FactoryBuilder< Matrix, T > > scopedFactoryBuilder;
if ( !factoryBuilder )
{
scopedFactoryBuilder.reset( new factory::FactoryBuilder< Matrix, T >() );
factoryBuilder = scopedFactoryBuilder.get();
}
factory::Factory< state::State, factory::ArgumentTypeState > *stateFactory = factoryBuilder->BuildStateFactory();
factory::Factory< object::Object< double >, factory::ArgumentTypeObject< double > > *objectFactory =
factoryBuilder->BuildObjectFactory();
factory::Factory< electrical::TwoPort< Matrix >, factory::ArgumentTypeElectrical > *electricalFactory =
factoryBuilder->BuildElectricalFactory();
// Create electrical system
mRootTwoPort = electricalFactory->CreateInstance( rootXmlNode->GetElementChild( "RootElement" ) );
#ifdef _SYMBOLIC_
mRootTwoPort->SetID( 0 );
size_t iDCounter = 1;
std::vector< boost::shared_ptr< electrical::TwoPort< Matrix > > > electricalElements;
electricalFactory->GetObjects( electricalElements );
for ( size_t i = 0; i < electricalElements.size(); ++i )
if ( electricalElements.at( i ).get() != mRootTwoPort.get() )
electricalElements.at( i )->SetID( iDCounter++ );
try
{
BOOST_FOREACH ( boost::shared_ptr< electrical::TwoPort< Matrix > > &elem, electricalFactory->GetObjectsOfClass( "WarburgCotanh" ) )
{
SerialTwoPort< Matrix > *serialTwoPort = dynamic_cast< SerialTwoPort< Matrix > * >( elem.get() );
for ( size_t i = 0; i < serialTwoPort->size(); ++i )
serialTwoPort->at( i )->SetID( iDCounter++ );
}
}
catch ( ... )
{
}
try
{
BOOST_FOREACH ( boost::shared_ptr< electrical::TwoPort< Matrix > > &elem, electricalFactory->GetObjectsOfClass( "WarburgTanh" ) )
{
SerialTwoPort< Matrix > *serialTwoPort = dynamic_cast< SerialTwoPort< Matrix > * >( elem.get() );
for ( size_t i = 0; i < serialTwoPort->size(); ++i )
serialTwoPort->at( i )->SetID( iDCounter++ );
}
}
catch ( ... )
{
}
try
{
BOOST_FOREACH ( boost::shared_ptr< electrical::TwoPort< Matrix > > &elem, electricalFactory->GetObjectsOfClass( "Rmphn" ) )
{
SerialTwoPort< Matrix > *serialTwoPort = dynamic_cast< SerialTwoPort< Matrix > * >( elem.get() );
for ( size_t i = 0; i < serialTwoPort->size(); ++i )
serialTwoPort->at( i )->SetID( iDCounter++ );
}
}
catch ( ... )
{
}
for ( size_t i = 0; i < this->mStateSystemGroup.GetStateCount(); ++i )
this->mStateSystemGroup.mStateVector.coeffRef( i, 0 ) = ScalarUnit( misc::StrCont( "State" ) + misc::StrCont( i + 1 ) );
#endif
mNumberOfObjects = objectFactory->GetNumberOfObjects();
mRootTwoPort->SetSystem( &mStateSystemGroup );
mStateSystemGroup.Initialize();
#ifndef _SYMBOLIC_
mRootTwoPort->SetInitialCurrent( 0.0 );
#else
mRootTwoPort->SetInitialCurrent( ScalarUnit( "InputCurrent" ) );
#endif
mRootTwoPort->UpdateStateSystemGroup();
mEqSystem = boost::make_shared< systm::DifferentialAlgebraicSystem< Matrix > >( &mStateSystemGroup );
// Store thermal states, SoC states and cell elements from electrical state factory
mThermalStates.reserve( stateFactory->GetObjectsOfClass( "ThermalState" ).size() );
BOOST_FOREACH ( const boost::shared_ptr< state::State > &thermalStateFromFactory, stateFactory->GetObjectsOfClass( "ThermalState" ) )
mThermalStates.push_back( boost::static_pointer_cast< state::ThermalState< double >, state::State >( thermalStateFromFactory ) );
const size_t numberOfSocObject = stateFactory->GetObjectsOfClass( "Soc" ).size();
mSocStates.reserve( numberOfSocObject );
mSavedSocValues.resize( numberOfSocObject );
mSavedSocOffsets.resize( numberOfSocObject );
BOOST_FOREACH ( const boost::shared_ptr< state::State > &socStateFromFactory,
stateFactory->GetObjectsOfClass( "Soc" ) )
mSocStates.push_back( boost::static_pointer_cast< state::Soc, state::State >( socStateFromFactory ) );
mCellElements.reserve( electricalFactory->GetObjectsOfClass( "CellElement" ).size() );
BOOST_FOREACH ( const boost::shared_ptr< ::electrical::TwoPort< Matrix > > &twoPortFromFactory,
electricalFactory->GetObjectsOfClass( "CellElement" ) )
{
if ( twoPortFromFactory->IsCellelement() )
mCellElements.push_back(
boost::static_pointer_cast< ::electrical::Cellelement< Matrix >, ::electrical::TwoPort< Matrix > >( twoPortFromFactory ) );
else
{
::electrical::ParallelTwoPort< Matrix > *cellFromFactory =
static_cast< ::electrical::ParallelTwoPort< Matrix > * >( twoPortFromFactory.get() );
for ( size_t i = 0; i < cellFromFactory->GetParallelChildren(); ++i )
mCellElements.push_back(
boost::static_pointer_cast< ::electrical::Cellelement< Matrix > >( cellFromFactory->shared_at( i ) ) );
}
}
// Evaluate Options node
boost::shared_ptr< xmlparser::XmlParameter > optionsNode = rootXmlNode->GetElementChild( "Options" );
// SocStopCriterion
if ( optionsNode->HasElementDirectChild( "SocStopCriterionInPercent" ) )
{
mSocStopCriterion = optionsNode->GetElementDoubleValue( "SocStopCriterionInPercent" );
if ( mSocStopCriterion <= 0.0 )
ErrorFunction< std::runtime_error >( __FUNCTION__, __LINE__, __FILE__, "SocStopCriterionInPercentNegative" );
}
// Give out cells if wanted
if ( cells )
*cells = electricalFactory->GetObjectsOfClass( "Cellelement" );
if ( cells )
{
mObserver = CreateTwoPortObserver< std::vector< boost::shared_ptr< ::electrical::TwoPort< Matrix > > >, Matrix, filterTypeChoice >(
cells, rootXmlNode.get(), 0, 0, 0, 0, 0, mRootTwoPort, uuid );
}
else
{
mObserver = CreateTwoPortObserver< std::vector< boost::shared_ptr< electrical::TwoPort< Matrix > > >, Matrix, filterTypeChoice >(
0, rootXmlNode.get(), 0, 0, 0, 0, 0, mRootTwoPort, uuid );
}
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::UpdateSystem()
{
// Current must be set before this function
mRootTwoPort->UpdateStateSystemGroup();
mEqSystem->PrepareEquationSystem();
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::UpdateSystemValues()
{
mRootTwoPort->CalculateStateDependentValues();
#if defined( _ARMADILLO_ ) && defined( SPARSE_MATRIX_FORMAT )
mStateSystemGroup.ResetSystem();
#endif
}
template < typename Matrix, typename T, bool filterTypeChoice >
bool ElectricalSimulation< Matrix, T, filterTypeChoice >::CheckLoopConditionAndSetDeltaTime( T currentChangeTime )
{
if ( mTime < mStepStartTime + mMaxSimulationStepDuration && mTime < currentChangeTime )
{
mLastUnconstrainedDeltaTime = mDeltaTime;
mDeltaTime = std::min( currentChangeTime - mTime, mLastUnconstrainedDeltaTime );
mDeltaTime = std::min( mStepStartTime + mMaxSimulationStepDuration - mTime, mDeltaTime );
return true;
}
return false;
}
template < typename Matrix, typename T, bool filterTypeChoice >
bool ElectricalSimulation< Matrix, T, filterTypeChoice >::CheckIfSimulationTimeHasEnded()
{
return mTime >= mSimulationDuration;
}
template < typename Matrix, typename T, bool filterTypeChoice >
T ElectricalSimulation< Matrix, T, filterTypeChoice >::GetCurrentSimulationStepTime() const
{
return mTime - mStepStartTime;
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::FinshStep()
{
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::UpdateAllThermalStatesPowerDissipation()
{
BOOST_FOREACH ( boost::shared_ptr< electrical::Cellelement< Matrix > > &elem, mCellElements )
elem->UpdateThermalStatePowerDissipation( mTime );
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::UpdateAllThermalStatesPowerDissipationWithoutTime()
{
BOOST_FOREACH ( boost::shared_ptr< electrical::Cellelement< Matrix > > &elem, mCellElements )
elem->UpdateThermalStatePowerDissipation();
}
template < typename Matrix, typename T, bool filterTypeChoice >
void ElectricalSimulation< Matrix, T, filterTypeChoice >::ResetAllThermalStatesPowerDissipation()