9 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
32 this->numberofelements_local = 0;
33 this->numberofvertices_local = 0;
36 for(
int i=0;i<
NUMINPUTS;i++) this->inputs[i] = NULL;
41 this->numberofelements_local = nbe;
42 this->numberofvertices_local = nbv;
45 for(
int i=0;i<
NUMINPUTS;i++) this->inputs[i] = NULL;
50 if(this->inputs[i])
delete this->inputs[i];
58 Inputs2* output =
new Inputs2(this->numberofelements_local,this->numberofvertices_local);
61 if(this->inputs[i]) output->
inputs[i]=this->inputs[i]->
copy();
68 if(this->inputs[i]) this->inputs[i]->DeepEcho();
81 void Inputs2::Marshall(
char** pmarshalled_data,
int* pmarshalled_data_size,
int marshall_direction){
93 if(this->inputs[i]) num_inputs2++;
100 obj_enum = this->inputs[i]->ObjectEnum();
103 this->inputs[i]->Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
113 for(
int i=0;i<num_inputs2;i++){
121 boolinput2->
Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
122 this->inputs[index]=boolinput2;
126 intinput2->
Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
127 this->inputs[index]=intinput2;
131 triainput2->
Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
132 this->inputs[index]=triainput2;
136 pentainput2->
Marshall(pmarshalled_data,pmarshalled_data_size,marshall_direction);
137 this->inputs[index]=pentainput2;
161 if(this->inputs[index]){
162 delete this->inputs[index];
163 this->inputs[index] = NULL;
167 this->inputs[index] = newinput;
173 int index_old = EnumToIndex(oldenumtype);
174 int index_new = EnumToIndex(newenumtype);
177 if(this->inputs[index_new])
delete this->inputs[index_new];
180 if(!this->inputs[index_old]){
185 this->inputs[index_old]->ChangeEnum(newenumtype);
186 this->inputs[index_new] = this->inputs[index_old];
187 this->inputs[index_old] = NULL;
191 if(this->inputs[i]) this->inputs[i]->Configure(parameters);
197 int index = EnumToIndex(input_enum);
198 if(this->inputs[index]){
199 delete this->inputs[index];
200 this->inputs[index] = NULL;
211 int index_ori = EnumToIndex(original_enum);
212 int index_new = EnumToIndex(new_enum);
215 if(this->inputs[index_new])
delete this->inputs[index_new];
218 if(!this->inputs[index_ori]){
226 this->inputs[index_new] = copy;
249 int index = EnumToIndex(enum_in);
250 if(this->inputs[index])
return true;
258 int index = EnumToIndex(enum_in);
260 return this->inputs[index]->ObjectEnum();
268 if(this->inputs[i]) count++;
270 int numinputs = count;
273 int* interpolations = xNew<int>(count);
274 int* enumlist = xNew<int>(count);
280 Input2* input=this->inputs[i];
300 *pnuminputs = numinputs;
301 *pinterpolations = interpolations;
302 *pinputenums = enumlist;
310 int id = EnumToIndex(enum_in);
313 Input2* input = this->inputs[id];
314 if(!input)
return NULL;
323 int id = EnumToIndex(enum_in);
326 Input2* input = this->inputs[id];
327 if(!input)
return NULL;
334 int id = EnumToIndex(enum_in);
337 Input2* input = this->inputs[id];
338 if(!input)
return NULL;
341 return xDynamicCast<TransientInput2*>(input)->
GetTriaInput(time);
350 int id = EnumToIndex(enum_in);
353 Input2* input = this->inputs[id];
354 if(!input)
return NULL;
357 return xDynamicCast<TransientInput2*>(input)->
GetTriaInput(start_time,end_time,averaging_method);
366 int id = EnumToIndex(enum_in);
369 Input2* input = this->inputs[id];
370 if(!input)
return NULL;
377 int id = EnumToIndex(enum_in);
380 Input2* input = this->inputs[id];
381 if(!input)
return NULL;
384 return xDynamicCast<TransientInput2*>(input)->
GetPentaInput(time);
393 int id = EnumToIndex(enum_in);
396 Input2* input = this->inputs[id];
397 if(!input)
return NULL;
400 return xDynamicCast<TransientInput2*>(input)->
GetPentaInput(start_time,end_time,averaging_method);
409 int id = EnumToIndex(enum_in);
412 Input2* input = this->inputs[id];
413 if(!input)
return NULL;
426 int id = EnumToIndex(enum_in);
429 Input2* input = this->inputs[id];
430 if(!input)
return NULL;
436 return xDynamicCast<ControlInput2*>(input)->GetInput2(data);
441 int id = EnumToIndex(enum_in);
444 Input2* input = this->inputs[id];
445 if(!input)
return NULL;
451 return xDynamicCast<DatasetInput2*>(input);
456 int id = EnumToIndex(enum_in);
459 Input2* input = this->inputs[id];
460 if(!input)
return NULL;
466 return xDynamicCast<ControlInput2*>(input);
471 int id = EnumToIndex(enum_in);
474 if(this->inputs[
id]){
482 ArrayInput2* input = xDynamicCast<ArrayInput2*>(this->inputs[
id]);
488 int id = EnumToIndex(enum_in);
491 if(this->inputs[
id]){
499 ArrayInput2* input = xDynamicCast<ArrayInput2*>(this->inputs[
id]);
505 int id = EnumToIndex(enum_in);
508 if(this->inputs[
id]){
516 BoolInput2* input = xDynamicCast<BoolInput2*>(this->inputs[
id]);
522 int id = EnumToIndex(enum_in);
525 if(this->inputs[
id]){
529 int* temp = xNew<int>(3);
534 IntInput2* input = xDynamicCast<IntInput2*>(this->inputs[
id]);
540 int id = EnumToIndex(enum_in);
543 if(this->inputs[
id]){
547 int* temp = xNew<int>(3);
552 DoubleInput2* input = xDynamicCast<DoubleInput2*>(this->inputs[
id]);
559 int index = EnumToIndex(output_enum);
560 Input2* input = this->inputs[index];
564 _error_(
"Input "<<
EnumToStringx(output_enum)<<
" not found and cannot be added to model results");
575 int id = EnumToIndex(enum_in);
578 if(this->inputs[
id]){
582 this->inputs[id] =
new BoolInput2(this->numberofelements_local);
586 BoolInput2* input = xDynamicCast<BoolInput2*>(this->inputs[
id]);
592 int id = EnumToIndex(enum_in);
595 if(this->inputs[
id]){
599 this->inputs[id] =
new IntInput2(this->numberofelements_local);
603 IntInput2* input = xDynamicCast<IntInput2*>(this->inputs[
id]);
609 int id = EnumToIndex(enum_in);
612 if(this->inputs[
id]){
616 this->inputs[id] =
new DoubleInput2(this->numberofelements_local);
620 DoubleInput2* input = xDynamicCast<DoubleInput2*>(this->inputs[
id]);
625 bool recreate =
false;
628 int id = EnumToIndex(enum_in);
631 if(this->inputs[
id]){
633 delete this->inputs[id];
642 this->inputs[id] =
new ArrayInput2(this->numberofelements_local);
646 ArrayInput2* input = xDynamicCast<ArrayInput2*>(this->inputs[
id]);
647 input->
SetInput(row,numlayers,values);
651 bool recreate =
false;
653 int id = EnumToIndex(enum_in);
656 if(this->inputs[
id]){
658 delete this->inputs[id];
667 this->inputs[id] =
new DatasetInput2(this->numberofelements_local,this->numberofvertices_local);
671 DatasetInput2* input = xDynamicCast<DatasetInput2*>(this->inputs[
id]);
679 int id = EnumToIndex(enum_in);
682 if(this->inputs[
id]){
689 this->inputs[id] =
new TransientInput2(enum_in,this->numberofelements_local,this->numberofvertices_local,times,numtimes);
694 bool recreate =
false;
696 int id = EnumToIndex(enum_in);
699 if(this->inputs[
id]){
701 delete this->inputs[id];
710 this->inputs[id] =
new ControlInput2(this->numberofelements_local,this->numberofvertices_local,layout,interpolation,control_id);
714 ControlInput2* input = xDynamicCast<ControlInput2*>(this->inputs[
id]);
715 input->
SetControl(interpolation,numindices,indices,values,values_min,values_max);
720 int id = EnumToIndex(enum_in);
727 ControlInput2* input = xDynamicCast<ControlInput2*>(this->inputs[
id]);
728 input->
SetGradient(interpolation,numindices,indices,values);
733 int id = EnumToIndex(enum_in);
740 ControlInput2* input = xDynamicCast<ControlInput2*>(this->inputs[
id]);
741 input->
SetGradient(interpolation,numindices,indices,values,n);
745 bool recreate =
false;
747 int id = EnumToIndex(enum_in);
750 if(this->inputs[
id]){
752 delete this->inputs[id];
761 this->inputs[id] =
new DatasetInput2(this->numberofelements_local,this->numberofvertices_local);
765 DatasetInput2* input = xDynamicCast<DatasetInput2*>(this->inputs[
id]);
774 int id = EnumToIndex(enum_in);
777 if(this->inputs[
id]){
781 this->inputs[id] =
new TriaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
785 TriaInput2* input = xDynamicCast<TriaInput2*>(this->inputs[
id]);
786 input->
SetInput(interpolation,row,value);
791 int id = EnumToIndex(enum_in);
794 if(this->inputs[
id]){
800 this->inputs[id] =
new TriaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
804 TriaInput2* input = xDynamicCast<TriaInput2*>(this->inputs[
id]);
805 input->
SetInput(interpolation,numindices,indices,values);
810 int id = EnumToIndex(enum_in);
813 if(this->inputs[
id]){
817 this->inputs[id] =
new TriaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
821 TriaInput2* input = xDynamicCast<TriaInput2*>(this->inputs[
id]);
822 input->
SetInput(interpolation,row,numindices,values);
826 bool recreate =
false;
828 int id = EnumToIndex(enum_in);
831 if(this->inputs[
id]){
833 delete this->inputs[id];
842 this->inputs[id] =
new ControlInput2(this->numberofelements_local,this->numberofvertices_local,layout,interpolation,control_id);
846 ControlInput2* input = xDynamicCast<ControlInput2*>(this->inputs[
id]);
847 input->
SetControl(interpolation,numindices,indices,values,values_min,values_max);
852 int id = EnumToIndex(enum_in);
859 ControlInput2* input = xDynamicCast<ControlInput2*>(this->inputs[
id]);
860 input->
SetGradient(interpolation,numindices,indices,values);
864 bool recreate =
false;
866 int id = EnumToIndex(enum_in);
869 if(this->inputs[
id]){
871 delete this->inputs[id];
880 this->inputs[id] =
new DatasetInput2(this->numberofelements_local,this->numberofvertices_local);
884 DatasetInput2* input = xDynamicCast<DatasetInput2*>(this->inputs[
id]);
893 int id = EnumToIndex(enum_in);
896 if(this->inputs[
id]){
900 this->inputs[id] =
new PentaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
904 PentaInput2* input = xDynamicCast<PentaInput2*>(this->inputs[
id]);
905 input->
SetInput(interpolation,row,value);
910 int id = EnumToIndex(enum_in);
913 if(this->inputs[
id]){
917 this->inputs[id] =
new PentaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
921 PentaInput2* input = xDynamicCast<PentaInput2*>(this->inputs[
id]);
922 input->
SetInput(interpolation,numindices,indices,values);
927 int id = EnumToIndex(enum_in);
930 if(this->inputs[
id]){
934 this->inputs[id] =
new PentaInput2(this->numberofelements_local,this->numberofvertices_local,interpolation);
938 PentaInput2* input = xDynamicCast<PentaInput2*>(this->inputs[
id]);
939 input->
SetInput(interpolation,row,numindices,values);