[6200] | 1 | /*!\file ControlInput.c
|
---|
| 2 | * \brief: implementation of the ControlInput object
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #ifdef HAVE_CONFIG_H
|
---|
| 6 | #include "config.h"
|
---|
| 7 | #else
|
---|
| 8 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 9 | #endif
|
---|
| 10 |
|
---|
| 11 | #include "stdio.h"
|
---|
| 12 | #include <string.h>
|
---|
| 13 | #include "../objects.h"
|
---|
| 14 | #include "../../EnumDefinitions/EnumDefinitions.h"
|
---|
| 15 | #include "../../shared/shared.h"
|
---|
| 16 | #include "../../Container/Container.h"
|
---|
| 17 | #include "../../include/include.h"
|
---|
| 18 |
|
---|
| 19 | /*ControlInput constructors and destructor*/
|
---|
| 20 | /*FUNCTION ControlInput::ControlInput(){{{1*/
|
---|
| 21 | ControlInput::ControlInput(){
|
---|
[6260] | 22 | control_id = 0;
|
---|
| 23 | values = NULL;
|
---|
| 24 | savedvalues = NULL;
|
---|
[8129] | 25 | minvalues = NULL;
|
---|
| 26 | maxvalues = NULL;
|
---|
[6260] | 27 | gradient = NULL;
|
---|
[6200] | 28 | }
|
---|
| 29 | /*}}}*/
|
---|
[8129] | 30 | /*FUNCTION ControlInput::ControlInput(int enum_type,int enum_input,double* pvalues,double* pmin,double* pmax,int id){{{1*/
|
---|
| 31 | ControlInput::ControlInput(int in_enum_type,int enum_input,double* pvalues,double* pmin,double* pmax,int id){
|
---|
[6260] | 32 |
|
---|
| 33 | control_id=id;
|
---|
[6200] | 34 | enum_type=in_enum_type;
|
---|
[6260] | 35 |
|
---|
[6200] | 36 | switch(enum_input){
|
---|
| 37 | case TriaVertexInputEnum:
|
---|
| 38 | values =new TriaVertexInput(enum_type,pvalues);
|
---|
| 39 | savedvalues=new TriaVertexInput(enum_type,pvalues);
|
---|
[8129] | 40 | minvalues =new TriaVertexInput(enum_type,pmin);
|
---|
| 41 | maxvalues =new TriaVertexInput(enum_type,pmax);
|
---|
[6200] | 42 | break;
|
---|
| 43 | case PentaVertexInputEnum:
|
---|
| 44 | values =new PentaVertexInput(enum_type,pvalues);
|
---|
| 45 | savedvalues=new PentaVertexInput(enum_type,pvalues);
|
---|
[8129] | 46 | minvalues =new PentaVertexInput(enum_type,pmin);
|
---|
| 47 | maxvalues =new PentaVertexInput(enum_type,pmax);
|
---|
[6200] | 48 | break;
|
---|
| 49 | default:
|
---|
[8224] | 50 | _error_("Input of Enum %s not supported yet by ControlInput",EnumToStringx(enum_input));
|
---|
[6200] | 51 | }
|
---|
| 52 | gradient =NULL;
|
---|
| 53 | }
|
---|
| 54 | /*}}}*/
|
---|
| 55 | /*FUNCTION ControlInput::~ControlInput(){{{1*/
|
---|
| 56 | ControlInput::~ControlInput(){
|
---|
| 57 | delete values;
|
---|
| 58 | delete savedvalues;
|
---|
[8129] | 59 | delete minvalues;
|
---|
| 60 | delete maxvalues;
|
---|
[6200] | 61 | delete gradient;
|
---|
| 62 | }
|
---|
| 63 | /*}}}*/
|
---|
| 64 |
|
---|
| 65 | /*Object virtual functions definitions:*/
|
---|
| 66 | /*FUNCTION ControlInput::Echo {{{1*/
|
---|
| 67 | void ControlInput::Echo(void){
|
---|
| 68 | this->DeepEcho();
|
---|
| 69 | }
|
---|
| 70 | /*}}}*/
|
---|
| 71 | /*FUNCTION ControlInput::DeepEcho{{{1*/
|
---|
| 72 | void ControlInput::DeepEcho(void){
|
---|
| 73 |
|
---|
| 74 | printf("ControlInput:\n");
|
---|
[8224] | 75 | printf(" enum: %i (%s)\n",this->enum_type,EnumToStringx(this->enum_type));
|
---|
[8129] | 76 | printf("---values: \n"); if (values) values->Echo();
|
---|
| 77 | printf("---savedvalues: \n");if (savedvalues) savedvalues->Echo();
|
---|
| 78 | printf("---minvalues: \n"); if (minvalues) minvalues->Echo();
|
---|
| 79 | printf("---maxvalues: \n"); if (maxvalues) maxvalues->Echo();
|
---|
| 80 | printf("---gradient: \n"); if (gradient) gradient->Echo();
|
---|
[6200] | 81 | }
|
---|
| 82 | /*}}}*/
|
---|
| 83 | /*FUNCTION ControlInput::Id{{{1*/
|
---|
| 84 | int ControlInput::Id(void){ return -1; }
|
---|
| 85 | /*}}}*/
|
---|
| 86 | /*FUNCTION ControlInput::MyRank{{{1*/
|
---|
| 87 | int ControlInput::MyRank(void){
|
---|
| 88 | extern int my_rank;
|
---|
| 89 | return my_rank;
|
---|
| 90 | }
|
---|
| 91 | /*}}}*/
|
---|
| 92 | /*FUNCTION ControlInput::Marshall{{{1*/
|
---|
| 93 | void ControlInput::Marshall(char** pmarshalled_dataset){
|
---|
| 94 |
|
---|
| 95 | char* marshalled_dataset=NULL;
|
---|
| 96 | int enum_value=0;
|
---|
| 97 | int flag;
|
---|
| 98 |
|
---|
| 99 | /*recover marshalled_dataset: */
|
---|
| 100 | marshalled_dataset=*pmarshalled_dataset;
|
---|
| 101 |
|
---|
| 102 | /*get enum value of ControlInput: */
|
---|
| 103 | enum_value=ControlInputEnum;
|
---|
| 104 |
|
---|
| 105 | /*marshall enum: */
|
---|
| 106 | memcpy(marshalled_dataset,&enum_value,sizeof(enum_value));marshalled_dataset+=sizeof(enum_value);
|
---|
| 107 |
|
---|
| 108 | /*marshall enum_type: */
|
---|
| 109 | memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
|
---|
[6260] | 110 | memcpy(marshalled_dataset,&control_id,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
|
---|
[6200] | 111 |
|
---|
| 112 | /*marshal values*/
|
---|
| 113 | if(!values){
|
---|
| 114 | flag=0;
|
---|
| 115 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 116 | }
|
---|
| 117 | else{
|
---|
| 118 | flag=1;
|
---|
| 119 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 120 | this->values->Marshall(&marshalled_dataset);
|
---|
| 121 | }
|
---|
| 122 |
|
---|
| 123 | /*marshal savedvalues*/
|
---|
| 124 | if(!savedvalues){
|
---|
| 125 | flag=0;
|
---|
| 126 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 127 | }
|
---|
| 128 | else{
|
---|
| 129 | flag=1;
|
---|
| 130 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 131 | this->savedvalues->Marshall(&marshalled_dataset);
|
---|
| 132 | }
|
---|
| 133 |
|
---|
[8129] | 134 | /*marshal minvalues*/
|
---|
| 135 | if(!minvalues){
|
---|
| 136 | flag=0;
|
---|
| 137 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 138 | }
|
---|
| 139 | else{
|
---|
| 140 | flag=1;
|
---|
| 141 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 142 | this->minvalues->Marshall(&marshalled_dataset);
|
---|
| 143 | }
|
---|
| 144 |
|
---|
| 145 | /*marshal maxvalues*/
|
---|
| 146 | if(!maxvalues){
|
---|
| 147 | flag=0;
|
---|
| 148 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 149 | }
|
---|
| 150 | else{
|
---|
| 151 | flag=1;
|
---|
| 152 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 153 | this->maxvalues->Marshall(&marshalled_dataset);
|
---|
| 154 | }
|
---|
| 155 |
|
---|
[6200] | 156 | /*marshal gradient*/
|
---|
| 157 | if(!gradient){
|
---|
| 158 | flag=0;
|
---|
| 159 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 160 | }
|
---|
| 161 | else{
|
---|
| 162 | flag=1;
|
---|
| 163 | memcpy(marshalled_dataset,&flag,sizeof(flag));marshalled_dataset+=sizeof(flag);
|
---|
| 164 | this->gradient->Marshall(&marshalled_dataset);
|
---|
| 165 | }
|
---|
| 166 |
|
---|
| 167 | /*clean up and assign output pointer*/
|
---|
| 168 | *pmarshalled_dataset=marshalled_dataset;
|
---|
| 169 | }
|
---|
| 170 | /*}}}*/
|
---|
| 171 | /*FUNCTION ControlInput::MarshallSize{{{1*/
|
---|
| 172 | int ControlInput::MarshallSize(){
|
---|
| 173 |
|
---|
| 174 | int size=0;
|
---|
| 175 |
|
---|
| 176 | size=sizeof(enum_type)+
|
---|
[6260] | 177 | +sizeof(control_id)
|
---|
[8129] | 178 | +5*sizeof(int) //5 flags
|
---|
[6200] | 179 | +sizeof(int); //sizeof(int) for enum value
|
---|
| 180 |
|
---|
| 181 | if(values) size+=values->MarshallSize();
|
---|
| 182 | if(savedvalues)size+=savedvalues->MarshallSize();
|
---|
[8129] | 183 | if(minvalues)size+=minvalues->MarshallSize();
|
---|
| 184 | if(maxvalues)size+=maxvalues->MarshallSize();
|
---|
[6200] | 185 | if(gradient) size+=gradient->MarshallSize();
|
---|
| 186 | return size;
|
---|
| 187 | }
|
---|
| 188 | /*}}}*/
|
---|
| 189 | /*FUNCTION ControlInput::Demarshall{{{1*/
|
---|
| 190 | void ControlInput::Demarshall(char** pmarshalled_dataset){
|
---|
| 191 |
|
---|
| 192 | char* marshalled_dataset=NULL;
|
---|
| 193 | int flag,input_enum_type;
|
---|
| 194 |
|
---|
| 195 | /*recover marshalled_dataset: */
|
---|
| 196 | marshalled_dataset=*pmarshalled_dataset;
|
---|
| 197 |
|
---|
| 198 | /*this time, no need to get enum type, the pointer directly points to the beginning of the
|
---|
| 199 | *object data (thanks to DataSet::Demarshall):*/
|
---|
| 200 | memcpy(&enum_type,marshalled_dataset,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type);
|
---|
[6260] | 201 | memcpy(&control_id,marshalled_dataset,sizeof(control_id));marshalled_dataset+=sizeof(control_id);
|
---|
[6200] | 202 |
|
---|
| 203 | /*Demarshal values*/
|
---|
| 204 | memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
|
---|
| 205 | if(flag){
|
---|
| 206 | memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
|
---|
| 207 | if(input_enum_type==PentaVertexInputEnum){
|
---|
| 208 | values=new PentaVertexInput();
|
---|
| 209 | values->Demarshall(&marshalled_dataset);
|
---|
| 210 | }
|
---|
| 211 | else if(input_enum_type==TriaVertexInputEnum){
|
---|
| 212 | values=new TriaVertexInput();
|
---|
| 213 | values->Demarshall(&marshalled_dataset);
|
---|
| 214 | }
|
---|
[6412] | 215 | else _error_("Not supported yet");
|
---|
[6200] | 216 | }
|
---|
| 217 | else{
|
---|
| 218 | values=NULL;
|
---|
| 219 | }
|
---|
| 220 |
|
---|
| 221 | /*Demarshal savedvalues*/
|
---|
| 222 | memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
|
---|
| 223 | if(flag){
|
---|
| 224 | memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
|
---|
| 225 | if(input_enum_type==PentaVertexInputEnum){
|
---|
| 226 | savedvalues=new PentaVertexInput();
|
---|
| 227 | savedvalues->Demarshall(&marshalled_dataset);
|
---|
| 228 | }
|
---|
| 229 | else if(input_enum_type==TriaVertexInputEnum){
|
---|
| 230 | savedvalues=new TriaVertexInput();
|
---|
| 231 | savedvalues->Demarshall(&marshalled_dataset);
|
---|
| 232 | }
|
---|
[6412] | 233 | else _error_("Not supported yet");
|
---|
[6200] | 234 | }
|
---|
| 235 | else{
|
---|
| 236 | savedvalues=NULL;
|
---|
| 237 | }
|
---|
| 238 |
|
---|
[8129] | 239 | /*Demarshal minvalues*/
|
---|
| 240 | memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
|
---|
| 241 | if(flag){
|
---|
| 242 | memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
|
---|
| 243 | if(input_enum_type==PentaVertexInputEnum){
|
---|
| 244 | minvalues=new PentaVertexInput();
|
---|
| 245 | minvalues->Demarshall(&marshalled_dataset);
|
---|
| 246 | }
|
---|
| 247 | else if(input_enum_type==TriaVertexInputEnum){
|
---|
| 248 | minvalues=new TriaVertexInput();
|
---|
| 249 | minvalues->Demarshall(&marshalled_dataset);
|
---|
| 250 | }
|
---|
| 251 | else _error_("Not supported yet");
|
---|
| 252 | }
|
---|
| 253 | else{
|
---|
| 254 | minvalues=NULL;
|
---|
| 255 | }
|
---|
| 256 |
|
---|
| 257 | /*Demarshal maxvalues*/
|
---|
| 258 | memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
|
---|
| 259 | if(flag){
|
---|
| 260 | memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
|
---|
| 261 | if(input_enum_type==PentaVertexInputEnum){
|
---|
| 262 | maxvalues=new PentaVertexInput();
|
---|
| 263 | maxvalues->Demarshall(&marshalled_dataset);
|
---|
| 264 | }
|
---|
| 265 | else if(input_enum_type==TriaVertexInputEnum){
|
---|
| 266 | maxvalues=new TriaVertexInput();
|
---|
| 267 | maxvalues->Demarshall(&marshalled_dataset);
|
---|
| 268 | }
|
---|
| 269 | else _error_("Not supported yet");
|
---|
| 270 | }
|
---|
| 271 | else{
|
---|
| 272 | maxvalues=NULL;
|
---|
| 273 | }
|
---|
| 274 |
|
---|
[6200] | 275 | /*Demarshal gradient*/
|
---|
| 276 | memcpy(&flag,marshalled_dataset,sizeof(int));marshalled_dataset+=sizeof(int);
|
---|
| 277 | if(flag){
|
---|
| 278 | memcpy(&input_enum_type,marshalled_dataset,sizeof(int)); marshalled_dataset+=sizeof(int);
|
---|
| 279 | if(input_enum_type==PentaVertexInputEnum){
|
---|
| 280 | gradient=new PentaVertexInput();
|
---|
| 281 | gradient->Demarshall(&marshalled_dataset);
|
---|
| 282 | }
|
---|
| 283 | else if(input_enum_type==TriaVertexInputEnum){
|
---|
| 284 | gradient=new TriaVertexInput();
|
---|
| 285 | gradient->Demarshall(&marshalled_dataset);
|
---|
| 286 | }
|
---|
[6412] | 287 | else _error_("Not supported yet");
|
---|
[6200] | 288 | }
|
---|
| 289 | else{
|
---|
| 290 | gradient=NULL;
|
---|
| 291 | }
|
---|
| 292 |
|
---|
| 293 | /*return: */
|
---|
| 294 | *pmarshalled_dataset=marshalled_dataset;
|
---|
| 295 | return;
|
---|
| 296 | }
|
---|
| 297 | /*}}}*/
|
---|
| 298 | /*FUNCTION ControlInput::Enum{{{1*/
|
---|
| 299 | int ControlInput::Enum(void){
|
---|
| 300 |
|
---|
| 301 | return ControlInputEnum;
|
---|
| 302 |
|
---|
| 303 | }
|
---|
| 304 | /*}}}*/
|
---|
| 305 | /*FUNCTION ControlInput::copy{{{1*/
|
---|
| 306 | Object* ControlInput::copy() {
|
---|
| 307 |
|
---|
| 308 | ControlInput* output=NULL;
|
---|
| 309 |
|
---|
| 310 | output = new ControlInput();
|
---|
| 311 | output->enum_type=this->enum_type;
|
---|
[6260] | 312 | output->control_id=this->control_id;
|
---|
[6200] | 313 |
|
---|
| 314 | if(values) output->values=(Input*)this->values->copy();
|
---|
| 315 | if(savedvalues) output->savedvalues=(Input*)this->savedvalues->copy();
|
---|
[8129] | 316 | if(minvalues) output->minvalues=(Input*)this->minvalues->copy();
|
---|
| 317 | if(maxvalues) output->maxvalues=(Input*)this->maxvalues->copy();
|
---|
[6200] | 318 | if(gradient) output->gradient=(Input*)this->gradient->copy();
|
---|
| 319 |
|
---|
| 320 | return output;
|
---|
| 321 | }
|
---|
| 322 | /*}}}*/
|
---|
| 323 |
|
---|
| 324 | /*ControlInput management*/
|
---|
| 325 | /*FUNCTION ControlInput::EnumType{{{1*/
|
---|
| 326 | int ControlInput::EnumType(void){
|
---|
| 327 |
|
---|
| 328 | return this->enum_type;
|
---|
| 329 |
|
---|
| 330 | }
|
---|
| 331 | /*}}}*/
|
---|
| 332 |
|
---|
| 333 | /*Object functions*/
|
---|
[8129] | 334 | /*FUNCTION ControlInput::Constrain(){{{1*/
|
---|
| 335 | void ControlInput::Constrain(void){
|
---|
| 336 |
|
---|
| 337 | Input* newvalues=NULL;
|
---|
| 338 |
|
---|
| 339 | newvalues=this->values->PointwiseMin(maxvalues);
|
---|
| 340 | delete values; this->values=newvalues;
|
---|
| 341 | newvalues=this->values->PointwiseMax(minvalues);
|
---|
| 342 | delete values; this->values=newvalues;
|
---|
[6200] | 343 | }/*}}}*/
|
---|
[8129] | 344 | /*FUNCTION ControlInput::Constrain(double min, double max){{{1*/
|
---|
| 345 | void ControlInput::Constrain(double min, double max){
|
---|
| 346 | values->Constrain(min,max);
|
---|
| 347 | }/*}}}*/
|
---|
[6200] | 348 | /*FUNCTION ControlInput::Extrude{{{1*/
|
---|
| 349 | void ControlInput::Extrude(void){
|
---|
| 350 | values->Extrude();
|
---|
| 351 | savedvalues->Extrude();
|
---|
| 352 | //gradient->Extrude();
|
---|
| 353 | }/*}}}*/
|
---|
| 354 | /*FUNCTION ControlInput::GetGradient{{{1*/
|
---|
| 355 | void ControlInput::GetGradient(Vec gradient_vec,int* doflist){
|
---|
| 356 | if(gradient) gradient->GetVectorFromInputs(gradient_vec,doflist);
|
---|
| 357 | }/*}}}*/
|
---|
[6238] | 358 | /*FUNCTION ControlInput::ScaleGradient{{{1*/
|
---|
| 359 | void ControlInput::ScaleGradient(double scaling_factor){
|
---|
[8224] | 360 | if(!gradient) _error_("Gradient of ControlInput %s not found",EnumToStringx(enum_type));
|
---|
[6238] | 361 | gradient->Scale(scaling_factor);
|
---|
| 362 | }/*}}}*/
|
---|
[6200] | 363 | /*FUNCTION ControlInput::SetGradient{{{1*/
|
---|
| 364 | void ControlInput::SetGradient(Input* gradient_in){
|
---|
[6260] | 365 |
|
---|
| 366 | /*Get enum for current gradient*/
|
---|
| 367 | switch(this->control_id){
|
---|
| 368 | case 1:
|
---|
| 369 | gradient_in->ChangeEnum(Gradient1Enum);
|
---|
| 370 | break;
|
---|
| 371 | case 2:
|
---|
| 372 | gradient_in->ChangeEnum(Gradient2Enum);
|
---|
| 373 | break;
|
---|
| 374 | case 3:
|
---|
| 375 | gradient_in->ChangeEnum(Gradient3Enum);
|
---|
| 376 | break;
|
---|
| 377 | default:
|
---|
[6412] | 378 | _error_("more than 3 controls not implemented yet (Gradient %i was requested). EnumDefinitions.h needs to be updated.",this->control_id);
|
---|
[6260] | 379 | }
|
---|
| 380 |
|
---|
| 381 | /*Delete old gradient and assign new gradient*/
|
---|
[6200] | 382 | if(gradient) delete gradient;
|
---|
| 383 | gradient=gradient_in;
|
---|
[6260] | 384 |
|
---|
[6200] | 385 | }/*}}}*/
|
---|
| 386 | /*FUNCTION ControlInput::SpawnResult{{{1*/
|
---|
| 387 | ElementResult* ControlInput::SpawnResult(int step, double time){
|
---|
| 388 | return savedvalues->SpawnResult(step,time);
|
---|
| 389 | }/*}}}*/
|
---|
| 390 | /*FUNCTION ControlInput::SpawnTriaInput{{{1*/
|
---|
| 391 | Input* ControlInput::SpawnTriaInput(int* indices){
|
---|
| 392 | return values->SpawnTriaInput(indices);
|
---|
| 393 | }/*}}}*/
|
---|
| 394 | /*FUNCTION ControlInput::SpawnGradient{{{1*/
|
---|
| 395 | ElementResult* ControlInput::SpawnGradient(int step, double time){
|
---|
[6260] | 396 | return gradient->SpawnResult(step,time);
|
---|
[6200] | 397 | }/*}}}*/
|
---|
| 398 | /*FUNCTION ControlInput::GetParameterAverage(double* pvalue){{{1*/
|
---|
| 399 | void ControlInput::GetParameterAverage(double* pvalue){
|
---|
| 400 | values->GetParameterAverage(pvalue);
|
---|
| 401 | }/*}}}*/
|
---|
| 402 | /*FUNCTION ControlInput::GetParameterValue(bool* pvalue){{{1*/
|
---|
| 403 | void ControlInput::GetParameterValue(bool* pvalue){
|
---|
| 404 | values->GetParameterValue(pvalue);
|
---|
| 405 | }/*}}}*/
|
---|
| 406 | /*FUNCTION ControlInput::GetParameterValue(int* pvalue){{{1*/
|
---|
| 407 | void ControlInput::GetParameterValue(int* pvalue){
|
---|
| 408 | values->GetParameterValue(pvalue);
|
---|
| 409 | }/*}}}*/
|
---|
| 410 | /*FUNCTION ControlInput::GetParameterValue(double* pvalue){{{1*/
|
---|
| 411 | void ControlInput::GetParameterValue(double* pvalue){
|
---|
| 412 | values->GetParameterValue(pvalue);
|
---|
| 413 | }/*}}}*/
|
---|
| 414 | /*FUNCTION ControlInput::GetParameterValue(double* pvalue){{{1*/
|
---|
| 415 | void ControlInput::GetParameterValue(double* pvalue,GaussTria* gauss){
|
---|
| 416 | values->GetParameterValue(pvalue,gauss);
|
---|
| 417 | }/*}}}*/
|
---|
| 418 | /*FUNCTION ControlInput::GetParameterValue(double* pvalue){{{1*/
|
---|
| 419 | void ControlInput::GetParameterValue(double* pvalue,GaussPenta* gauss){
|
---|
| 420 | values->GetParameterValue(pvalue,gauss);
|
---|
| 421 | }/*}}}*/
|
---|
| 422 | /*FUNCTION ControlInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss){{{1*/
|
---|
| 423 | void ControlInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, GaussTria* gauss){
|
---|
| 424 | values->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss);
|
---|
| 425 | }/*}}}*/
|
---|
| 426 | /*FUNCTION ControlInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss){{{1*/
|
---|
| 427 | void ControlInput::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, GaussPenta* gauss){
|
---|
| 428 | values->GetParameterDerivativeValue(derivativevalues,xyz_list,gauss);
|
---|
| 429 | }/*}}}*/
|
---|
| 430 | /*FUNCTION ControlInput::SaveValue{{{1*/
|
---|
| 431 | void ControlInput::SaveValue(void){
|
---|
[8224] | 432 | if(!values) _error_("Values of %s not found",EnumToStringx(this->enum_type));
|
---|
[6200] | 433 |
|
---|
| 434 | if(savedvalues) delete this->savedvalues;
|
---|
| 435 | this->savedvalues=(Input*)this->values->copy();
|
---|
| 436 | }/*}}}*/
|
---|
| 437 | /*FUNCTION ControlInput::UpdateValue{{{1*/
|
---|
| 438 | void ControlInput::UpdateValue(double scalar){
|
---|
[8224] | 439 | if(!gradient) _error_("Gradient of %s not found",EnumToStringx(this->enum_type));
|
---|
| 440 | if(!savedvalues) _error_("Values of %s not found",EnumToStringx(this->enum_type));
|
---|
[6200] | 441 |
|
---|
| 442 | if(values) delete this->values;
|
---|
| 443 | this->values=(Input*)this->savedvalues->copy();
|
---|
| 444 | this->values->AXPY(gradient,scalar);
|
---|
| 445 | }/*}}}*/
|
---|
| 446 | /*FUNCTION ControlInput::VerticallyIntegrate{{{1*/
|
---|
| 447 | void ControlInput::VerticallyIntegrate(Input* thickness_input){
|
---|
| 448 | values->VerticallyIntegrate(thickness_input);
|
---|
| 449 | }/*}}}*/
|
---|
[8363] | 450 | /*FUNCTION ControlInput::Configure{{{1*/
|
---|
| 451 | void ControlInput::Configure(Parameters* parameters){
|
---|
| 452 | /*do nothing: */
|
---|
| 453 | }
|
---|
| 454 | /*}}}*/
|
---|