MOOSE - Multiscale Object Oriented Simulation Environment
|
#include <Adaptor.h>
Public Member Functions | |
Adaptor () | |
double | getInputOffset () const |
double | getOutput () const |
double | getOutputOffset () const |
double | getScale () const |
void | innerProcess () |
void | input (double val) |
void | process (const Eref &e, ProcPtr p) |
void | reinit (const Eref &e, ProcPtr p) |
void | setInputOffset (double offset) |
void | setOutputOffset (double offset) |
void | setScale (double scale) |
Static Public Member Functions | |
static const Cinfo * | initCinfo () |
Private Attributes | |
unsigned int | counter_ |
double | inputOffset_ |
string | molName_ |
unsigned int | numRequestOut_ |
Counts number of inputs received. More... | |
double | output_ |
double | outputOffset_ |
double | scale_ |
double | sum_ |
Used for placeholding in cellreader mode. More... | |
This is the adaptor class. It is used in interfacing different kinds of solver with each other, especially for electrical to chemical signeur models. The Adaptor class is the core of the API for interfacing between different solution engines. It is currently in use for interfacing between chemical and electrical simulations, but could be used for other cases such as mechanical models.
The API for interfacing between solution engines rests on the following capabilities of MOOSE.
(y = scale * (x + inputOffset) + outputOffset )
where y is output and x is the input. The input is the average of any number of sources (through messages) and any number of timesteps. The output goes to any number of targets, again through messages.
It is worth adding that messages can transport arbitrary data structures, so it would also be possible to devise a complicated opaque message directly between solvers. The implementation of Adaptors working on visible fields does this much more transparently and gives the user facile control over the scaling transformatoin.
These adaptors are used especially in the rdesigneur framework of MOOSE, which enables multiscale reaction-diffusion and electrical signaling models. As an example of this API in operation, I consider two mappings:
Messaging couples the 'electrical' calcium pool concentration to the adaptor (see point 5). This can either be a 'push' operation, where the solver pushes out the calcium value at its internal update rate, or a 'pull' operation where the adaptor requests the calcium concentration.
In much the same manner, the phosphorylation state can regulate channel properties.
Adaptor::Adaptor | ( | ) |
Definition at line 293 of file Adaptor.cpp.
double Adaptor::getInputOffset | ( | ) | const |
Definition at line 314 of file Adaptor.cpp.
References inputOffset_.
Referenced by initCinfo().
double Adaptor::getOutput | ( | ) | const |
Definition at line 337 of file Adaptor.cpp.
References output_.
Referenced by initCinfo().
double Adaptor::getOutputOffset | ( | ) | const |
Definition at line 323 of file Adaptor.cpp.
References outputOffset_.
Referenced by initCinfo().
double Adaptor::getScale | ( | ) | const |
Definition at line 332 of file Adaptor.cpp.
References scale_.
Referenced by initCinfo().
|
static |
Definition at line 59 of file Adaptor.cpp.
References adaptorCinfo, getInputOffset(), getOutput(), getOutputOffset(), getScale(), Neutral::initCinfo(), input(), output(), process(), reinit(), requestOut(), setInputOffset(), setOutputOffset(), and setScale().
void Adaptor::innerProcess | ( | ) |
Definition at line 354 of file Adaptor.cpp.
References counter_, inputOffset_, output_, outputOffset_, scale_, and sum_.
Referenced by process().
void Adaptor::input | ( | double | val | ) |
Definition at line 347 of file Adaptor.cpp.
References counter_, and sum_.
Referenced by initCinfo().
Definition at line 366 of file Adaptor.cpp.
References counter_, innerProcess(), numRequestOut_, output(), output_, requestOut(), and sum_.
Referenced by initCinfo(), and reinit().
Definition at line 382 of file Adaptor.cpp.
References Eref::dataIndex(), Eref::element(), Element::getMsgTargets(), numRequestOut_, process(), and requestOut().
Referenced by initCinfo().
void Adaptor::setInputOffset | ( | double | offset | ) |
Definition at line 310 of file Adaptor.cpp.
References inputOffset_, and value.
Referenced by initCinfo().
void Adaptor::setOutputOffset | ( | double | offset | ) |
Definition at line 319 of file Adaptor.cpp.
References outputOffset_, and value.
Referenced by initCinfo().
void Adaptor::setScale | ( | double | scale | ) |
Definition at line 328 of file Adaptor.cpp.
Referenced by initCinfo().
|
private |
Definition at line 171 of file Adaptor.h.
Referenced by innerProcess(), input(), and process().
|
private |
Definition at line 166 of file Adaptor.h.
Referenced by getInputOffset(), innerProcess(), and setInputOffset().
|
private |
|
private |
Definition at line 165 of file Adaptor.h.
Referenced by getOutput(), innerProcess(), and process().
|
private |
Definition at line 167 of file Adaptor.h.
Referenced by getOutputOffset(), innerProcess(), and setOutputOffset().
|
private |
Definition at line 168 of file Adaptor.h.
Referenced by getScale(), innerProcess(), and setScale().
|
private |
Used for placeholding in cellreader mode.
Definition at line 170 of file Adaptor.h.
Referenced by innerProcess(), input(), and process().