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