Changeset 4050
- Timestamp:
- 06/17/10 11:06:40 (15 years ago)
- Location:
- issm/trunk/src/c/objects
- Files:
-
- 29 added
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/objects/Elements/Beam.cpp
r4048 r4050 1002 1002 } 1003 1003 /*}}}*/ 1004 /*FUNCTION Beam::AXPY (int YEnum, double scalar, int XEnum);{{{1*/1005 void Beam::AXPY (int YEnum, double scalar, int XEnum){1004 /*FUNCTION Beam::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/ 1005 void Beam::AXPYInput(int YEnum, double scalar, int XEnum){ 1006 1006 1007 1007 Input* xinput=NULL; … … 1020 1020 } 1021 1021 /*}}}*/ 1022 /*FUNCTION Beam::ControlConstrain (int control_type, double cm_min, double cm_max){{{1*/1023 void Beam::ControlConstrain (int control_type, double cm_min, double cm_max){1022 /*FUNCTION Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/ 1023 void Beam::ControlConstrainInput(int control_type, double cm_min, double cm_max){ 1024 1024 1025 1025 Input* input=NULL; … … 1039 1039 void Beam::GetVectorFromInputs(Vec vector,int NameEnum){ 1040 1040 1041 int i; 1041 1042 const int numvertices=2; 1042 1043 int doflist1[numvertices]; … … 1045 1046 for(i=0;i<this->inputs->Size();i++){ 1046 1047 Input* input=(Input*)this->inputs->GetObjectByOffset(i); 1047 if(input->EnumType ==NameEnum){1048 if(input->EnumType()==NameEnum){ 1048 1049 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ 1049 1050 this->GetDofList1(&doflist1[0]); -
issm/trunk/src/c/objects/Elements/Beam.h
r4048 r4050 96 96 void DuplicateInput(int original_enum,int new_enum); 97 97 void ScaleInput(int enum_type,double scale_factor); 98 void AXPY (int YEnum, double scalar, int XEnum);99 void ControlConstrain (int control_type,double cm_min, double cm_max);98 void AXPYInput(int YEnum, double scalar, int XEnum); 99 void ControlConstrainInput(int control_type,double cm_min, double cm_max); 100 100 101 101 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Element.h
r4048 r4050 67 67 virtual void ScaleInput(int enum_type,double scale_factor)=0; 68 68 virtual void GetVectorFromInputs(Vec vector,int NameEnum)=0; 69 virtual void AXPY (int YEnum, double scalar, int XEnum)=0;70 virtual void ControlConstrain (int control_type,double cm_min, double cm_max)=0;69 virtual void AXPYInput(int YEnum, double scalar, int XEnum)=0; 70 virtual void ControlConstrainInput(int control_type,double cm_min, double cm_max)=0; 71 71 /*Implementation: */ 72 72 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4048 r4050 616 616 617 617 for(i=0;i<this->results->Size();i++){ 618 Result* result=(Result*)this->results->GetObjectByOffset(i);619 result->ProcessUnits(this->parameters);618 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 619 elementresult->ProcessUnits(this->parameters); 620 620 } 621 621 … … 4578 4578 void Penta::GradjDrag(void){ 4579 4579 4580 int i; 4580 4581 Tria* tria=NULL; 4581 4582 TriaVertexInput* triavertexinput=NULL; … … 4621 4622 4622 4623 /*Now, the tria has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */ 4623 triavertexinput= tria->inputs->GetInput(GradientEnum);4624 triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum); 4624 4625 for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i]; 4625 4626 this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0])); … … 4632 4633 void Penta::GradjB(void){ 4633 4634 4635 int i; 4634 4636 Tria* tria=NULL; 4635 4637 TriaVertexInput* triavertexinput=NULL; … … 4665 4667 4666 4668 /*Now, the tria has a GradientEnum input. Take it, and make a PentaVertexInput out of it, then delete the tria: */ 4667 triavertexinput= tria->inputs->GetInput(GradientEnum);4669 triavertexinput=(TriaVertexInput*)tria->inputs->GetInput(GradientEnum); 4668 4670 for(i=0;i<3;i++)gradient[i]=triavertexinput->values[i]; 4669 4671 this->inputs->AddInput(new PentaVertexInput(GradientEnum,&gradient[0])); … … 4959 4961 /*Go through all the results objects, and update the counters: */ 4960 4962 for (i=0;i<this->results->Size();i++){ 4961 Result* result=(Result*)this->results->GetObjectByOffset(i);4963 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 4962 4964 /*first, we have one more result: */ 4963 4965 numrows++; 4964 4966 /*now, how many vertices and how many nodal values for this result? :*/ 4965 4967 numvertices=6; //this is a penta element, with 6 vertices 4966 numnodes= result->NumberOfNodalValues(); //ask result object.4968 numnodes=elementresult->NumberOfNodalValues(); //ask result object. 4967 4969 } 4968 4970 … … 4989 4991 4990 4992 for(i=0;i<this->results->Size();i++){ 4991 Result* result=(Result*)this->results->GetObjectByOffset(i);4993 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 4992 4994 4993 4995 /*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 4994 4996 *it to the result object, to fill the rest: */ 4995 4997 patch->fillelementinfo(count,this->id,vertices_ids,6); 4996 result->PatchFill(count,patch);4998 elementresult->PatchFill(count,patch); 4997 4999 4998 5000 /*increment counter: */ … … 5352 5354 } 5353 5355 /*}}}*/ 5354 /*FUNCTION Penta::AXPY (int YEnum, double scalar, int XEnum);{{{1*/5355 void Penta::AXPY (int YEnum, double scalar, int XEnum){5356 /*FUNCTION Penta::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/ 5357 void Penta::AXPYInput(int YEnum, double scalar, int XEnum){ 5356 5358 5357 5359 Input* xinput=NULL; … … 5370 5372 } 5371 5373 /*}}}*/ 5372 /*FUNCTION Penta::ControlConstrain (int control_type, double cm_min, double cm_max){{{1*/5373 void Penta::ControlConstrain (int control_type, double cm_min, double cm_max){5374 /*FUNCTION Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/ 5375 void Penta::ControlConstrainInput(int control_type, double cm_min, double cm_max){ 5374 5376 5375 5377 Input* input=NULL; … … 5389 5391 void Penta::GetVectorFromInputs(Vec vector,int NameEnum){ 5390 5392 5393 int i; 5391 5394 const int numvertices=6; 5392 5395 int doflist1[numvertices]; … … 5395 5398 for(i=0;i<this->inputs->Size();i++){ 5396 5399 Input* input=(Input*)this->inputs->GetObjectByOffset(i); 5397 if(input->EnumType ==NameEnum){5400 if(input->EnumType()==NameEnum){ 5398 5401 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ 5399 5402 this->GetDofList1(&doflist1[0]); -
issm/trunk/src/c/objects/Elements/Penta.h
r4048 r4050 163 163 void DuplicateInput(int original_enum,int new_enum); 164 164 void ScaleInput(int enum_type,double scale_factor); 165 void AXPY (int YEnum, double scalar, int XEnum);166 void ControlConstrain (int control_type,double cm_min, double cm_max);165 void AXPYInput(int YEnum, double scalar, int XEnum); 166 void ControlConstrainInput(int control_type,double cm_min, double cm_max); 167 167 void GetVectorFromInputs(Vec vector,int NameEnum); 168 168 -
issm/trunk/src/c/objects/Elements/Sing.cpp
r4048 r4050 708 708 } 709 709 /*}}}*/ 710 /*FUNCTION Sing::AXPY (int YEnum, double scalar, int XEnum);{{{1*/711 void Sing::AXPY (int YEnum, double scalar, int XEnum){710 /*FUNCTION Sing::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/ 711 void Sing::AXPYInput(int YEnum, double scalar, int XEnum){ 712 712 713 713 Input* xinput=NULL; … … 726 726 } 727 727 /*}}}*/ 728 /*FUNCTION Sing::ControlConstrain (int control_type, double cm_min, double cm_max){{{1*/729 void Sing::ControlConstrain (int control_type, double cm_min, double cm_max){728 /*FUNCTION Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/ 729 void Sing::ControlConstrainInput(int control_type, double cm_min, double cm_max){ 730 730 731 731 Input* input=NULL; … … 745 745 void Sing::GetVectorFromInputs(Vec vector,int NameEnum){ 746 746 747 int i; 747 748 const int numvertices=1; 748 749 int doflist1[numvertices]; … … 751 752 for(i=0;i<this->inputs->Size();i++){ 752 753 Input* input=(Input*)this->inputs->GetObjectByOffset(i); 753 if(input->EnumType ==NameEnum){754 if(input->EnumType()==NameEnum){ 754 755 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ 755 756 this->GetDofList1(&doflist1[0]); -
issm/trunk/src/c/objects/Elements/Sing.h
r4048 r4050 95 95 void DuplicateInput(int original_enum,int new_enum); 96 96 void ScaleInput(int enum_type,double scale_factor); 97 void AXPY (int YEnum, double scalar, int XEnum);98 void ControlConstrain (int control_type,double cm_min, double cm_max);97 void AXPYInput(int YEnum, double scalar, int XEnum); 98 void ControlConstrainInput(int control_type,double cm_min, double cm_max); 99 99 100 100 -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4048 r4050 512 512 513 513 for(i=0;i<this->results->Size();i++){ 514 Result* result=(Result*)this->results->GetObjectByOffset(i);515 result->ProcessUnits(this->parameters);514 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 515 elementresult->ProcessUnits(this->parameters); 516 516 } 517 517 … … 4308 4308 /*}}}*/ 4309 4309 /*FUNCTION Tria::GradjDragStokes {{{1*/ 4310 void Tria::GradjDragStokes( Vec grad_g){4310 void Tria::GradjDragStokes(void){ 4311 4311 4312 4312 int i; … … 4478 4478 /*}}}*/ 4479 4479 /*FUNCTION Tria::GradjB{{{1*/ 4480 void Tria::GradjB( Vec grad_g){4480 void Tria::GradjB(void){ 4481 4481 4482 4482 int i; … … 5057 5057 /*Go through all the results objects, and update the counters: */ 5058 5058 for (i=0;i<this->results->Size();i++){ 5059 Result* result=(Result*)this->results->GetObjectByOffset(i);5059 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 5060 5060 /*first, we have one more result: */ 5061 5061 numrows++; 5062 5062 /*now, how many vertices and how many nodal values for this result? :*/ 5063 5063 numvertices=3; //this is a tria element, with 3 vertices 5064 numnodes= result->NumberOfNodalValues(); //ask result object.5064 numnodes=elementresult->NumberOfNodalValues(); //ask result object. 5065 5065 } 5066 5066 … … 5087 5087 5088 5088 for(i=0;i<this->results->Size();i++){ 5089 Result* result=(Result*)this->results->GetObjectByOffset(i);5089 ElementResult* elementresult=(ElementResult*)this->results->GetObjectByOffset(i); 5090 5090 5091 5091 /*For this result,fill the information in the Patch object (element id + vertices ids), and then hand 5092 5092 *it to the result object, to fill the rest: */ 5093 5093 patch->fillelementinfo(row,this->id,vertices_ids,3); 5094 result->PatchFill(row,patch);5094 elementresult->PatchFill(row,patch); 5095 5095 5096 5096 /*increment rower: */ … … 5450 5450 } 5451 5451 /*}}}*/ 5452 /*FUNCTION Tria::AXPY (int YEnum, double scalar, int XEnum);{{{1*/5453 void Tria::AXPY (int YEnum, double scalar, int XEnum){5452 /*FUNCTION Tria::AXPYInput(int YEnum, double scalar, int XEnum);{{{1*/ 5453 void Tria::AXPYInput(int YEnum, double scalar, int XEnum){ 5454 5454 5455 5455 Input* xinput=NULL; … … 5468 5468 } 5469 5469 /*}}}*/ 5470 /*FUNCTION Tria::ControlConstrain (int control_type, double cm_min, double cm_max){{{1*/5471 void Tria::ControlConstrain (int control_type, double cm_min, double cm_max){5470 /*FUNCTION Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){{{1*/ 5471 void Tria::ControlConstrainInput(int control_type, double cm_min, double cm_max){ 5472 5472 5473 5473 Input* input=NULL; … … 5487 5487 void Tria::GetVectorFromInputs(Vec vector,int NameEnum){ 5488 5488 5489 int i; 5489 5490 const int numvertices=3; 5490 5491 int doflist1[numvertices]; … … 5493 5494 for(i=0;i<this->inputs->Size();i++){ 5494 5495 Input* input=(Input*)this->inputs->GetObjectByOffset(i); 5495 if(input->EnumType ==NameEnum){5496 if(input->EnumType()==NameEnum){ 5496 5497 /*We found the enum. Use its values to fill into the vector, using the vertices ids: */ 5497 5498 this->GetDofList1(&doflist1[0]); -
issm/trunk/src/c/objects/Elements/Tria.h
r4048 r4050 141 141 void DuplicateInput(int original_enum,int new_enum); 142 142 void ScaleInput(int enum_type,double scale_factor); 143 void AXPY (int YEnum, double scalar, int XEnum);144 void ControlConstrain (int control_type,double cm_min, double cm_max);143 void AXPYInput(int YEnum, double scalar, int XEnum); 144 void ControlConstrainInput(int control_type,double cm_min, double cm_max); 145 145 void GetVectorFromInputs(Vec vector,int NameEnum); 146 146 -
issm/trunk/src/c/objects/FemModel.cpp
r4034 r4050 31 31 this->solution_type=in_solution_type; 32 32 analysis_counter=nummodels-1; //point to last analysis_type carried out. 33 this->results=new DataSet(); //not initialized by CreateDataSets 33 34 34 35 /*Dynamically allocate whatever is a list of length nummodels: */ … … 100 101 delete materials; 101 102 delete parameters; 103 delete results; 102 104 delete partition; 103 105 delete tpartition; -
issm/trunk/src/c/objects/FemModel.h
r4028 r4050 35 35 DataSet* materials; //one set of materials, for each element 36 36 Parameters* parameters; //one set of parameters, independent of the analysis_type 37 DataSet* results; //results that cannot be fit into the elements (such as one time constants, arrays, strings, etc ...) 37 38 38 39 DofVec* partition; //one partitioning for all elements -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r4048 r4050 167 167 /*}}}*/ 168 168 /*FUNCTION BeamVertexInput::SpawnResult{{{1*/ 169 Result* BeamVertexInput::SpawnResult(int step, double time){170 171 return new BeamVertex Result(this->enum_type,this->values,step,time);169 ElementResult* BeamVertexInput::SpawnResult(int step, double time){ 170 171 return new BeamVertexElementResult(this->enum_type,this->values,step,time); 172 172 173 173 } … … 267 267 268 268 /*xinput is of the same type, so cast it: */ 269 xbeamvertexinput=(BeamVertexInput )xinput;269 xbeamvertexinput=(BeamVertexInput*)xinput; 270 270 271 271 /*Carry out the AXPY operation:*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r4048 r4050 48 48 Input* SpawnBeamInput(int* indices); 49 49 Input* SpawnTriaInput(int* indices); 50 Result* SpawnResult(int step, double time);50 ElementResult* SpawnResult(int step, double time); 51 51 52 52 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r4048 r4050 175 175 /*}}}*/ 176 176 /*FUNCTION BoolInput::SpawnResult{{{1*/ 177 Result* BoolInput::SpawnResult(int step, double time){177 ElementResult* BoolInput::SpawnResult(int step, double time){ 178 178 179 179 ISSMERROR(" not supported yet!"); … … 234 234 235 235 /*xinput is of the same type, so cast it: */ 236 xboolinput=(BoolInput )xinput;236 xboolinput=(BoolInput*)xinput; 237 237 238 238 /*Carry out the AXPY operation:*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r4048 r4050 48 48 Input* SpawnBeamInput(int* indices); 49 49 Input* SpawnTriaInput(int* indices); 50 Result* SpawnResult(int step, double time);50 ElementResult* SpawnResult(int step, double time); 51 51 52 52 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r4048 r4050 175 175 /*}}}*/ 176 176 /*FUNCTION DoubleInput::SpawnResult{{{1*/ 177 Result* DoubleInput::SpawnResult(int step, double time){178 179 return new Double Result(this->enum_type,this->value,step,time);177 ElementResult* DoubleInput::SpawnResult(int step, double time){ 178 179 return new DoubleElementResult(this->enum_type,this->value,step,time); 180 180 181 181 } … … 245 245 246 246 /*xinput is of the same type, so cast it: */ 247 xdoubleinput=(DoubleInput )xinput;247 xdoubleinput=(DoubleInput*)xinput; 248 248 249 249 /*Carry out the AXPY operation:*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r4048 r4050 49 49 Input* SpawnBeamInput(int* indices); 50 50 Input* SpawnTriaInput(int* indices); 51 Result* SpawnResult(int step, double time);51 ElementResult* SpawnResult(int step, double time); 52 52 53 53 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/Input.h
r4048 r4050 11 11 #include "../Object.h" 12 12 class Node; 13 class Result;13 class ElementResult; 14 14 #include "../Node.h" 15 15 /*}}}*/ … … 49 49 virtual Input* SpawnBeamInput(int* indices)=0; 50 50 virtual Input* SpawnTriaInput(int* indices)=0; 51 virtual Result* SpawnResult(int step, double time)=0;51 virtual ElementResult* SpawnResult(int step, double time)=0; 52 52 virtual void SquareMin(double* psquaremin, bool process_units,Parameters* parameters)=0; 53 53 virtual void Scale(double scale_factor)=0; -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r4048 r4050 172 172 /*}}}*/ 173 173 /*FUNCTION IntInput::SpawnResult{{{1*/ 174 Result* IntInput::SpawnResult(int step, double time){174 ElementResult* IntInput::SpawnResult(int step, double time){ 175 175 176 176 ISSMERROR(" not supported yet!"); … … 223 223 /*FUNCTION IntInput::Scale(double scale_factor){{{1*/ 224 224 void IntInput::Scale(double scale_factor){ 225 value=value*scale_factor; 225 double dvalue=(double)value*scale_factor; 226 value=(int)dvalue; 226 227 } 227 228 /*}}}*/ 228 229 /*FUNCTION IntInput::AXPY(Input* xinput,int scalar);{{{1*/ 229 void IntInput::AXPY(Input* xinput,int scalar){ 230 230 void IntInput::AXPY(Input* xinput,double scalar){ 231 232 double dvalue; 231 233 IntInput* xintinput=NULL; 232 234 233 235 /*xinput is of the same type, so cast it: */ 234 xintinput=(IntInput )xinput;236 xintinput=(IntInput*)xinput; 235 237 236 238 /*Carry out the AXPY operation:*/ 237 this->value=this->value+scalar*xintinput->value; 239 dvalue=(double)this->value+scalar*(double)xintinput->value; 240 this->value=(int)dvalue; 238 241 239 242 } … … 242 245 void IntInput::Constrain(double cm_min, double cm_max){ 243 246 244 if(!isnan(cm_min)) if (this->value<cm_min)this->value= cm_min;245 if(!isnan(cm_max)) if (this->value>cm_max)this->value= cm_max;247 if(!isnan(cm_min)) if (this->value<cm_min)this->value=(int)cm_min; 248 if(!isnan(cm_max)) if (this->value>cm_max)this->value=(int)cm_max; 246 249 247 250 } -
issm/trunk/src/c/objects/Inputs/IntInput.h
r4048 r4050 48 48 Input* SpawnBeamInput(int* indices); 49 49 Input* SpawnTriaInput(int* indices); 50 Result* SpawnResult(int step, double time);50 ElementResult* SpawnResult(int step, double time); 51 51 52 52 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r4048 r4050 200 200 /*}}}*/ 201 201 /*FUNCTION PentaVertexInput::SpawnResult{{{1*/ 202 Result* PentaVertexInput::SpawnResult(int step, double time){203 204 return new PentaVertex Result(this->enum_type,this->values,step,time);202 ElementResult* PentaVertexInput::SpawnResult(int step, double time){ 203 204 return new PentaVertexElementResult(this->enum_type,this->values,step,time); 205 205 206 206 } … … 916 916 917 917 /*xinput is of the same type, so cast it: */ 918 xpentavertexinput=(PentaVertexInput )xinput;918 xpentavertexinput=(PentaVertexInput*)xinput; 919 919 920 920 /*Carry out the AXPY operation:*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r4048 r4050 47 47 Input* SpawnBeamInput(int* indices); 48 48 Input* SpawnTriaInput(int* indices); 49 Result* SpawnResult(int step, double time);49 ElementResult* SpawnResult(int step, double time); 50 50 51 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r4048 r4050 158 158 /*}}}*/ 159 159 /*FUNCTION SingVertexInput::SpawnResult{{{1*/ 160 Result* SingVertexInput::SpawnResult(int step, double time){161 162 return new SingVertex Result(this->enum_type,this->value,step,time);160 ElementResult* SingVertexInput::SpawnResult(int step, double time){ 161 162 return new SingVertexElementResult(this->enum_type,this->value,step,time); 163 163 164 164 } … … 235 235 236 236 /*xinput is of the same type, so cast it: */ 237 xsingvertexinput=(SingVertexInput )xinput;237 xsingvertexinput=(SingVertexInput*)xinput; 238 238 239 239 /*Carry out the AXPY operation:*/ 240 this->value=this->value+scalar*x ngvertexinput->value;240 this->value=this->value+scalar*xsingvertexinput->value; 241 241 242 242 } -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r4048 r4050 47 47 Input* SpawnBeamInput(int* indices); 48 48 Input* SpawnTriaInput(int* indices); 49 Result* SpawnResult(int step, double time);49 ElementResult* SpawnResult(int step, double time); 50 50 51 51 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r4048 r4050 186 186 /*}}}*/ 187 187 /*FUNCTION TriaVertexInput::SpawnResult{{{1*/ 188 Result* TriaVertexInput::SpawnResult(int step, double time){189 190 return new TriaVertex Result(this->enum_type,this->values,step,time);188 ElementResult* TriaVertexInput::SpawnResult(int step, double time){ 189 190 return new TriaVertexElementResult(this->enum_type,this->values,step,time); 191 191 192 192 } … … 490 490 491 491 /*xinput is of the same type, so cast it: */ 492 xtriavertexinput=(TriaVertexInput )xinput;492 xtriavertexinput=(TriaVertexInput*)xinput; 493 493 494 494 /*Carry out the AXPY operation:*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r4048 r4050 47 47 Input* SpawnBeamInput(int* indices); 48 48 Input* SpawnTriaInput(int* indices); 49 Result* SpawnResult(int step, double time);49 ElementResult* SpawnResult(int step, double time); 50 50 51 51 /*}}}*/ -
issm/trunk/src/c/objects/Loads/Pengrid.cpp
r4043 r4050 466 466 parameters->FindParam(&penalty_offset,PenaltyOffsetEnum); 467 467 468 //Create elementary matrix: add penalty to con train wb (wb=ub*db/dx+vb*db/dy)468 //Create elementary matrix: add penalty to constrain wb (wb=ub*db/dx+vb*db/dy) 469 469 Ke[2][0]=-slope[0]*kmax*pow((double)10.0,penalty_offset); 470 470 Ke[2][1]=-slope[1]*kmax*pow((double)10.0,penalty_offset); -
issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
r3834 r4050 26 26 } 27 27 /*}}}*/ 28 /*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec value ,int M){{{1*/29 DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_value , int in_M){28 /*FUNCTION DoubleVecParam::DoubleVecParam(int enum_type,IssmDoubleVec values,int M){{{1*/ 29 DoubleVecParam::DoubleVecParam(int in_enum_type,double* in_values, int in_M){ 30 30 31 31 enum_type=in_enum_type; 32 32 M=in_M; 33 33 34 value =(double*)xmalloc(M*sizeof(double));35 memcpy(value ,in_value,M*sizeof(double));34 values=(double*)xmalloc(M*sizeof(double)); 35 memcpy(values,in_values,M*sizeof(double)); 36 36 } 37 37 /*}}}*/ 38 38 /*FUNCTION DoubleVecParam::~DoubleVecParam(){{{1*/ 39 39 DoubleVecParam::~DoubleVecParam(){ 40 xfree((void**)&value );40 xfree((void**)&values); 41 41 return; 42 42 } … … 47 47 Object* DoubleVecParam::copy() { 48 48 49 return new DoubleVecParam(this->enum_type,this->value ,this->M);49 return new DoubleVecParam(this->enum_type,this->values,this->M); 50 50 51 51 } … … 60 60 printf(" vector size: %i\n",this->M); 61 61 for(i=0;i<this->M;i++){ 62 printf("%i %g\n",i,this->value [i]);62 printf("%i %g\n",i,this->values[i]); 63 63 } 64 64 } … … 79 79 /*data: */ 80 80 memcpy(&M,marshalled_dataset,sizeof(M));marshalled_dataset+=sizeof(M); 81 value =(double*)xmalloc(M*sizeof(double));82 memcpy(value ,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double);81 values=(double*)xmalloc(M*sizeof(double)); 82 memcpy(values,marshalled_dataset,M*sizeof(double));marshalled_dataset+=M*sizeof(double); 83 83 84 84 /*return: */ … … 124 124 memcpy(marshalled_dataset,&enum_type,sizeof(enum_type));marshalled_dataset+=sizeof(enum_type); 125 125 memcpy(marshalled_dataset,&M,sizeof(M));marshalled_dataset+=sizeof(M); 126 memcpy(marshalled_dataset,value ,M*sizeof(double));marshalled_dataset+=M*sizeof(double);126 memcpy(marshalled_dataset,values,M*sizeof(double));marshalled_dataset+=M*sizeof(double); 127 127 128 128 *pmarshalled_dataset=marshalled_dataset; … … 152 152 M=this->M; 153 153 output=(double*)xmalloc(M*sizeof(double)); 154 memcpy(output,value ,M*sizeof(double));154 memcpy(output,values,M*sizeof(double)); 155 155 156 156 /*Assign output pointers:*/ … … 168 168 169 169 int i; 170 double* newvalue =NULL;170 double* newvalues=NULL; 171 171 172 172 /*This param holds a vector of size numberofvertices, which means we are being asked to … … 175 175 if(this->M==numberofvertices){ 176 176 177 newvalue =(double*)xmalloc(this->M*sizeof(double));177 newvalues=(double*)xmalloc(this->M*sizeof(double)); 178 178 179 179 for(i=0;i<this->M;i++){ 180 newvalue [(int)(partition[i])]=this->value[i];180 newvalues[(int)(partition[i])]=this->values[i]; 181 181 } 182 182 183 /*Reassign value to new value: */184 xfree((void**)&this->value );185 this->value =newvalue;183 /*Reassign values to new values: */ 184 xfree((void**)&this->values); 185 this->values=newvalues; 186 186 } 187 187 -
issm/trunk/src/c/objects/Params/DoubleVecParam.h
r4043 r4050 31 31 32 32 private: 33 /*just hold 3 values for 3 vertices: */34 33 int enum_type; 35 IssmDouble* value ;34 IssmDouble* values; 36 35 int M; 37 36 … … 39 38 /*constructors, destructors: {{{1*/ 40 39 DoubleVecParam(); 41 DoubleVecParam(int enum_type,IssmDouble* value ,int M);40 DoubleVecParam(int enum_type,IssmDouble* values,int M); 42 41 ~DoubleVecParam(); 43 42 /*}}}*/ -
issm/trunk/src/c/objects/objects.h
r4043 r4050 50 50 #include "./Inputs/TriaVertexInput.h" 51 51 52 /*Results: */ 53 #include "./Results/Result.h" 54 #include "./Results/DoubleResult.h" 55 #include "./Results/TriaVertexResult.h" 56 #include "./Results/PentaVertexResult.h" 57 #include "./Results/SingVertexResult.h" 58 #include "./Results/BeamVertexResult.h" 52 /*ElementResults: */ 53 #include "./ElementResults/ElementResult.h" 54 #include "./ElementResults/DoubleElementResult.h" 55 #include "./ElementResults/TriaVertexElementResult.h" 56 #include "./ElementResults/PentaVertexElementResult.h" 57 #include "./ElementResults/SingVertexElementResult.h" 58 #include "./ElementResults/BeamVertexElementResult.h" 59 60 /*ExternalResults: */ 61 #include "./ExternalResults/ExternalResult.h" 62 #include "./ExternalResults/BoolExternalResult.h" 63 #include "./ExternalResults/DoubleExternalResult.h" 64 #include "./ExternalResults/DoubleVecExternalResult.h" 65 #include "./ExternalResults/IntExternalResult.h" 66 #include "./ExternalResults/PetscVecExternalResult.h" 67 #include "./ExternalResults/StringExternalResult.h" 59 68 60 69 /*Materials: */
Note:
See TracChangeset
for help on using the changeset viewer.