# PhasicFlow: src/phasicFlow/repository/systemControl/systemControl.hpp Source File

systemControl.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
#ifndef __systemControl_hpp__
#define __systemControl_hpp__
// top-level entity repository for the whole application
// Each application that is executed in pFlow, should have
// settings/systemControl file in it.
#include "types.hpp"
#include "Time.hpp"
#include "dictionary.hpp"
#include "box.hpp"
#include "Timers.hpp"
#include "dynamicLinkLibs.hpp"
namespace pFlow
{
class systemControl
:
public repository
{
protected:
// run name
const word runName_;
// - path to top-level folder
const fileSystem topLevelFolder_;
// - settings folder repository
repository settings_;
// - caseSetup folder repository
repository caseSetup_;
// - settingsDict fileDictionary
dictionary& settingsDict_;
// - extra libs to be loaded
dynamicLinkLibs libs_;
// - precision for writing to file
size_t outFilePrecision_ = 6;
// - time repository
Time Time_;
// - if time control is managed externaly
bool externalTimeControl_ = false;
// - acceleration
realx3 g_;
// - domain for dem world
box domain_;
// all timers
Timers timers_;
Logical timersReport_;
Timer writeToFileTimer_;
static word getRunName( const fileSystem& path);
static word getTopFolder(const fileSystem& path);
public:
systemControl(const fileSystem path = CWD());
systemControl(
const real startTime,
const real endTime,
const real saveInterval,
const word startTimeName,
const fileSystem path = CWD() );
const repository& settings() const{
return settings_;
}
repository& settings(){
return settings_;
}
const repository& caseSetup()const{
return caseSetup_;
}
repository& caseSetup(){
return caseSetup_;
}
const Time& time() const
{
return const_cast< Time&>(Time_);
}
Time& time()
{
return Time_;
}
const repository& geometry()const
{
return Time_.geometry();
}
repository& geometry()
{
return Time_.geometry();
}
const Timers& timers()const
{
return timers_;
}
Timers& timers()
{
return timers_;
}
inline bool timersReport()const
{
return timersReport_();
}
const dictionary& settingsDict()const{
return settingsDict_;
}
dictionary& settingsDict(){
return settingsDict_;
}
virtual word runName() const
{
return runName_;
}
inline const realx3& g()const
{
return g_;
}
inline const box& domain()const
{
return domain_;
}
bool operator ++(int);
void setSaveTimeFolder(
bool saveToFile,
const word& timeName = "wrongTimeFolder")
{
Time_.setSaveTimeFolder(saveToFile, timeName);
}
size_t outFilePrecision() const override
{
return outFilePrecision_;
}
};
} // pFlow
#endif // __systemControl_hpp__
pFlow::systemControl::settingsDict
const dictionary & settingsDict() const
Definition: systemControl.hpp:158
pFlow::systemControl::domain_
box domain_
Definition: systemControl.hpp:81
pFlow::systemControl::settings
repository & settings()
Definition: systemControl.hpp:110
pFlow::systemControl::settings_
repository settings_
Definition: systemControl.hpp:56
pFlow::systemControl::setSaveTimeFolder
void setSaveTimeFolder(bool saveToFile, const word &timeName="wrongTimeFolder")
Definition: systemControl.hpp:183
pFlow::systemControl::writeToFileTimer_
Timer writeToFileTimer_
Definition: systemControl.hpp:88
pFlow::systemControl::topLevelFolder_
const fileSystem topLevelFolder_
Definition: systemControl.hpp:51
pFlow::systemControl::timers
Timers & timers()
Definition: systemControl.hpp:148
pFlow::systemControl::caseSetup
repository & caseSetup()
Definition: systemControl.hpp:118
pFlow::real
float real
Definition: builtinTypes.hpp:46
pFlow::systemControl::settingsDict
dictionary & settingsDict()
Definition: systemControl.hpp:162
pFlow::systemControl::timersReport
bool timersReport() const
Definition: systemControl.hpp:153
types.hpp
pFlow::word
std::string word
Definition: builtinTypes.hpp:63
box.hpp
pFlow::systemControl
Definition: systemControl.hpp:41
pFlow::systemControl::timers_
Timers timers_
Definition: systemControl.hpp:84
pFlow::systemControl::outFilePrecision_
size_t outFilePrecision_
Definition: systemControl.hpp:68
pFlow::Time::geometry
const repository & geometry() const
Definition: Time.hpp:74
pFlow::Timers
Definition: Timers.hpp:33
pFlow::systemControl::outFilePrecision
size_t outFilePrecision() const override
Definition: systemControl.hpp:190
pFlow::systemControl::caseSetup
const repository & caseSetup() const
Definition: systemControl.hpp:114
pFlow
Definition: demComponent.hpp:28
pFlow::systemControl::runName_
const word runName_
Definition: systemControl.hpp:48
pFlow::systemControl::geometry
repository & geometry()
Definition: systemControl.hpp:138
pFlow::fileSystem
Definition: fileSystem.hpp:63
pFlow::systemControl::settingsDict_
dictionary & settingsDict_
Definition: systemControl.hpp:62
pFlow::systemControl::getTopFolder
static word getTopFolder(const fileSystem &path)
Definition: systemControl.cpp:61
pFlow::systemControl::g_
realx3 g_
Definition: systemControl.hpp:78
pFlow::systemControl::systemControl
systemControl(const fileSystem path=CWD())
Definition: systemControl.cpp:93
pFlow::systemControl::timersReport_
Logical timersReport_
Definition: systemControl.hpp:86
pFlow::systemControl::time
const Time & time() const
Definition: systemControl.hpp:123
pFlow::Timer
Definition: Timer.hpp:39
dictionary.hpp
Time.hpp
pFlow::systemControl::getRunName
static word getRunName(const fileSystem &path)
Definition: systemControl.cpp:30
pFlow::systemControl::time
Time & time()
Definition: systemControl.hpp:128
pFlow::dynamicLinkLibs
Definition: dynamicLinkLibs.hpp:32
pFlow::systemControl::settings
const repository & settings() const
Definition: systemControl.hpp:106
pFlow::systemControl::caseSetup_
repository caseSetup_
Definition: systemControl.hpp:59
pFlow::repository::path
virtual fileSystem path() const
Definition: repository.cpp:61
pFlow::systemControl::Time_
Time Time_
Definition: systemControl.hpp:71
pFlow::systemControl::operator++
bool operator++(int)
Definition: systemControl.cpp:235
pFlow::Logical
Definition: Logical.hpp:35
Timers.hpp
pFlow::box
Definition: box.hpp:32
pFlow::systemControl::geometry
const repository & geometry() const
Definition: systemControl.hpp:133
dynamicLinkLibs.hpp
pFlow::systemControl::runName
virtual word runName() const
Definition: systemControl.hpp:166
pFlow::CWD
fileSystem CWD()
Definition: fileSystem.hpp:186
pFlow::systemControl::g
const realx3 & g() const
Definition: systemControl.hpp:171
pFlow::repository
Definition: repository.hpp:34
pFlow::timeControl::setSaveTimeFolder
void setSaveTimeFolder(bool saveToFile, const word &timeName="wrongTimeFolder")
Definition: timeControl.cpp:163
pFlow::triple< real >
pFlow::systemControl::libs_
dynamicLinkLibs libs_
Definition: systemControl.hpp:65
pFlow::systemControl::domain
const box & domain() const
Definition: systemControl.hpp:176
pFlow::dictionary
Definition: dictionary.hpp:38
pFlow::systemControl::externalTimeControl_
bool externalTimeControl_
Definition: systemControl.hpp:75
pFlow::systemControl::timers
const Timers & timers() const
Definition: systemControl.hpp:143
pFlow::Time
Definition: Time.hpp:39