Page MenuHomec4science

component_libmultiscale.cc
No OneTemporary

File Metadata

Created
Sat, Jun 29, 02:24

component_libmultiscale.cc

/* -------------------------------------------------------------------------- */
#include "component_libmultiscale.hh"
#include "comm_group.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
void Component::compute() {
bool need_recompute = this->checkDependency(this->inputs);
bool amIinGroup = comm_group == nullptr || comm_group->amIinGroup();
if (not amIinGroup) {
throw NotInCommGroup{"For component '" + this->getID() +
" I am not in the right group"};
}
if (!need_recompute && calculated_once)
return;
this->compute_make_call();
this->acquireRelease(this->inputs);
for (auto &pair : this->outputs) {
auto &arg = pair.second;
arg.setRelease(this->getRelease());
}
calculated_once = true;
}
__END_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */

Event Timeline