31 Action(0, (const char**)NULL, NULL, NULL, (char *)
"InterpolateBase"),
32 agent(ag), bkagent(bkag), conditional(cond)
51 for (
int i=0;
i<4;
i++) {
59 std::cout <<
"Rocstar Warning: Could not find attribute " <<
attr[2] << std::endl;
61 std::cout <<
"Rocstar Error: Could not find attribute " <<
attr[2] << std::endl;
99 if (time_out == time_new) {
102 else if (a_old <= 0) {
103 printf(
"Rocstar Error: Could not find the old attribute correspond to the attribute with handle %d\n", a_out);
106 else if (time_out == time_old) {
115 else if (time_old == -0.5) {
116 if (a_grad != -100 && a_grad>0) {
117 double time = (dt_old+dt)/2.0;
120 a = (time_out - 0.5)*dt;
123 a = 2.*(time_out - 0.5)*dt/(dt_old+dt);
125 else if (time_old == -1) {
129 printf(
"Rocstar Error: Unsupported interpolation mode with old time stamp %f\n", time_old);
143 atts[1] = attr +
"_old";
144 atts[2] = attr + alpsuf;
145 atts[3] = attr +
"_grad";
169 MAN_DEBUG(3, (
"Extrapolate_Linear::run (%s) called with t:%e dt:%e alpha:%e.\n",
attr[0], t, dt, alpha));
194 atts[1] = attr +
"_old";
195 atts[2] = attr + alpsuf;
196 atts[3] = attr +
"_grad";
227 std::string attribute =
attr[0];
228 std::string::size_type pos = attribute.find(
".");
230 std::string wname = attribute.substr( 0, pos);
246 MAN_DEBUG(3, (
"Extrapolate_Central::run (%s) called with t:%e dt:%e alpha:%e.\n",
attr[0], t, dt, alpha));
248 COM_assertion_msg(alpha>=0.0,
"ERROR: Extrapolate_Central called with invalid alpha!");
274 atts[1] = attr +
"_old";
275 atts[2] = attr + alpsuf;
276 atts[3] = attr +
"_grad";
289 MAN_DEBUG(3, (
"Interpolate_Linear::run (%s) called with t:%e dt:%e alpha:%e.\n",
attr[0], t, dt, alpha));
291 COM_assertion_msg(alpha>=0.0,
"ERROR: Interpolate_Linear called with invalid alpha!");
313 atts[1] = attr +
"_old";
314 atts[2] = attr + alpsuf;
315 atts[3] = attr +
"_grad";
323 std::string::size_type pos = attr.find(
".");
324 std::string wname, aname;
325 if ( pos == std::string::npos) {
329 wname = attr.substr( 0, pos);
330 aname = attr.substr( pos, attr.size()-pos);
340 MAN_DEBUG(3, (
"Interpolate_Constant::run (bc) called with alpha:%e.\n", alpha));
351 atts[1] = attr +
"_old";
352 atts[2] = attr + alpsuf;
353 atts[3] = attr +
"_grad";
396 MAN_DEBUG(3, (
"Interpolate_Central::run (%s) called with t:%e dt:%e alpha:%e.\n",
attr[0], t, dt, alpha));
398 COM_assertion_msg(alpha>=0.0,
"ERROR: Extrapolate_Central called with invalid alpha!");
InterpolateBase(Agent *ag, Agent *bkag, int cond=0)
double get_old_dt() const
#define COM_assertion_msg(EX, msg)
Interpolate_Central(Agent *ag, Agent *bkag, const std::string attr, const std::string alpsuf="_alp")
int get_attribute_handle(int i)
int COM_get_attribute_handle(const char *waname)
int get_attribute_handle_const(int i)
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to and or **sell copies of the and to permit persons to whom the **Software is furnished to do subject to the following this list of conditions and the following disclaimers ****Redistributions in binary form must reproduce the above **copyright this list of conditions and the following **disclaimers in the documentation and or other materials **provided with the distribution ****Neither the names of the Center for Simulation of Advanced the University of nor the names of its **contributors may be used to endorse or promote products derived **from this Software without specific prior written permission ****THE SOFTWARE IS PROVIDED AS WITHOUT WARRANTY OF ANY **EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES **OF FITNESS FOR A PARTICULAR PURPOSE AND **NONINFRINGEMENT IN NO EVENT SHALL THE CONTRIBUTORS OR **COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR **ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE **USE OR OTHER DEALINGS WITH THE SOFTWARE v
std::string get_surface_window() const
Coupling * get_coupling()
void set_io(int n, const int *io)
Interpolate_Constant(Agent *ag, Agent *bkag, const std::string attr, const std::string alpsuf="_alp")
void run(double t, double dt, double alpha)
void run(double t, double dt, double alpha)
void COM_call_function(const int wf, int argc,...)
int new_start(double t) const
int COM_get_attribute_handle_const(const char *waname)
int COM_get_window_handle(const char *wname)
void run(double t, double dt, double alpha)
void register_interpolate(InterpolateBase *ip)
virtual void init(double t)
unsigned long time()
Get the value of a system timer with a millisecond precision.
void set_attr(int n, const std::string at[], int *id=NULL)
const RocmanControl_parameters * get_rocmancontrol_param()
Interpolate_Linear(Agent *ag, Agent *bkag, const std::string attr, const std::string alpsuf="_alp")
void extrapolate_Linear(double dt, double dt_old, double time_old, int a_old, double time_new, int a_new, double time_out, int a_out, int a_gra=-100)