Changeset 4927
- Timestamp:
- 08/02/10 13:40:10 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 6 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Container/DataSet.cpp
r4899 r4927 234 234 dataset->AddObject(pentavertexinput); 235 235 } 236 else if(enum_type==BeamVertexInputEnum){237 BeamVertexInput* beamvertexinput=NULL;238 beamvertexinput=new BeamVertexInput();239 beamvertexinput->Demarshall(&marshalled_dataset);240 dataset->AddObject(beamvertexinput);241 }242 236 else if(enum_type==TriaVertexElementResultEnum){ 243 237 TriaVertexElementResult* triavertexelementresult=NULL; … … 252 246 dataset->AddObject(pentavertexelementresult); 253 247 } 254 else if(enum_type==BeamEnum){255 Beam* beam=NULL;256 beam=new Beam();257 beam->Demarshall(&marshalled_dataset);258 dataset->AddObject(beam);259 }260 248 else if(enum_type==PentaEnum){ 261 249 Penta* penta=NULL; -
issm/trunk/src/c/Container/Inputs.cpp
r4905 r4927 382 382 } 383 383 /*}}}*/ 384 /*FUNCTION Inputs::SpawnBeamInputs{{{1*/385 Inputs* Inputs::SpawnBeamInputs(int* indices){386 387 /*Intermediary*/388 vector<Object*>::iterator object;389 Input* inputin=NULL;390 Input* inputout=NULL;391 392 /*Output*/393 Inputs* newinputs=new Inputs();394 395 /*Go through inputs and call Spawn function*/396 for ( object=objects.begin() ; object < objects.end(); object++ ){397 398 /*Create new input*/399 inputin=(Input*)(*object);400 inputout=inputin->SpawnBeamInput(indices);401 402 /*Add input to new inputs*/403 newinputs->AddObject(inputout);404 }405 406 /*Assign output pointer*/407 return newinputs;408 }409 /*}}}*/410 384 /*FUNCTION Inputs::SpawnTriaInputs{{{1*/ 411 385 Inputs* Inputs::SpawnTriaInputs(int* indices){ -
issm/trunk/src/c/Container/Inputs.h
r4905 r4927 32 32 Input* GetInput(int enum_name); 33 33 Inputs* SpawnTriaInputs(int* indices); 34 Inputs* SpawnBeamInputs(int* indices);35 34 36 35 void GetParameterValue(bool* pvalue,int enum_type); -
issm/trunk/src/c/Container/Results.cpp
r4899 r4927 43 43 44 44 /*Object management*/ 45 /*FUNCTION Results::SpawnBeamResults{{{1*/46 Results* Results::SpawnBeamResults(int* indices){47 48 /*Intermediary*/49 vector<Object*>::iterator object;50 ElementResult* resultin=NULL;51 ElementResult* resultout=NULL;52 53 /*Output*/54 Results* newresults=new Results();55 56 /*Go through results and call Spawn function*/57 for ( object=objects.begin() ; object < objects.end(); object++ ){58 59 /*Create new result*/60 resultin=(ElementResult*)(*object);61 resultout=resultin->SpawnBeamElementResult(indices);62 63 /*Add result to new results*/64 newresults->AddObject((Object*)resultout);65 }66 67 /*Assign output pointer*/68 return newresults;69 }70 /*}}}*/71 45 /*FUNCTION Results::SpawnTriaResults{{{1*/ 72 46 Results* Results::SpawnTriaResults(int* indices){ -
issm/trunk/src/c/Container/Results.h
r4899 r4927 27 27 /*numerics: {{{1*/ 28 28 Results* SpawnTriaResults(int* indices); 29 Results* SpawnBeamResults(int* indices);30 29 /*}}}*/ 31 30 -
issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp
r4914 r4927 84 84 case SegmentEnum : return "Segment"; 85 85 case ElementEnum : return "Element"; 86 case BeamEnum : return "Beam";87 86 case DofIndexingEnum : return "DofIndexing"; 88 87 case ElementPropertiesEnum : return "ElementProperties"; … … 106 105 case MatparEnum : return "Matpar"; 107 106 case InputEnum : return "Input"; 108 case BeamVertexInputEnum : return "BeamVertexInput";109 107 case BoolInputEnum : return "BoolInput"; 110 108 case DoubleInputEnum : return "DoubleInput"; … … 228 226 case TriaVertexElementResultEnum : return "TriaVertexElementResult"; 229 227 case PentaVertexElementResultEnum : return "PentaVertexElementResult"; 230 case BeamVertexElementResultEnum : return "BeamVertexElementResult";231 228 case BoolExternalResultEnum : return "BoolExternalResult"; 232 229 case DoubleExternalResultEnum : return "DoubleExternalResult"; -
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r4910 r4927 97 97 /*Elements: */ 98 98 ElementEnum, 99 BeamEnum,100 99 DofIndexingEnum, 101 100 ElementPropertiesEnum, … … 123 122 /*Inputs: */ 124 123 InputEnum, 125 BeamVertexInputEnum,126 124 BoolInputEnum, 127 125 DoubleInputEnum, … … 259 257 TriaVertexElementResultEnum, 260 258 PentaVertexElementResultEnum, 261 BeamVertexElementResultEnum,262 259 BoolExternalResultEnum, 263 260 DoubleExternalResultEnum, -
issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp
r4914 r4927 82 82 else if (strcmp(name,"Segment")==0) return SegmentEnum; 83 83 else if (strcmp(name,"Element")==0) return ElementEnum; 84 else if (strcmp(name,"Beam")==0) return BeamEnum;85 84 else if (strcmp(name,"DofIndexing")==0) return DofIndexingEnum; 86 85 else if (strcmp(name,"ElementProperties")==0) return ElementPropertiesEnum; … … 104 103 else if (strcmp(name,"Matpar")==0) return MatparEnum; 105 104 else if (strcmp(name,"Input")==0) return InputEnum; 106 else if (strcmp(name,"BeamVertexInput")==0) return BeamVertexInputEnum;107 105 else if (strcmp(name,"BoolInput")==0) return BoolInputEnum; 108 106 else if (strcmp(name,"DoubleInput")==0) return DoubleInputEnum; … … 226 224 else if (strcmp(name,"TriaVertexElementResult")==0) return TriaVertexElementResultEnum; 227 225 else if (strcmp(name,"PentaVertexElementResult")==0) return PentaVertexElementResultEnum; 228 else if (strcmp(name,"BeamVertexElementResult")==0) return BeamVertexElementResultEnum;229 226 else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum; 230 227 else if (strcmp(name,"DoubleExternalResult")==0) return DoubleExternalResultEnum; -
issm/trunk/src/c/Makefile.am
r4910 r4927 114 114 ./objects/ElementResults/PentaVertexElementResult.h\ 115 115 ./objects/ElementResults/PentaVertexElementResult.cpp\ 116 ./objects/ElementResults/BeamVertexElementResult.h\117 ./objects/ElementResults/BeamVertexElementResult.cpp\118 116 ./objects/ExternalResults/ExternalResult.h\ 119 117 ./objects/ExternalResults/BoolExternalResult.h\ … … 141 139 ./objects/Inputs/TriaVertexInput.h\ 142 140 ./objects/Inputs/TriaVertexInput.cpp\ 143 ./objects/Inputs/BeamVertexInput.h\144 ./objects/Inputs/BeamVertexInput.cpp\145 141 ./objects/Inputs/PentaVertexInput.h\ 146 142 ./objects/Inputs/PentaVertexInput.cpp\ … … 151 147 ./objects/Inputs/DoubleInput.h\ 152 148 ./objects/Inputs/DoubleInput.cpp\ 153 ./objects/Elements/Beam.h\154 ./objects/Elements/Beam.cpp\155 149 ./objects/Elements/BeamRef.h\ 156 150 ./objects/Elements/BeamRef.cpp\ … … 672 666 ./objects/ElementResults/PentaVertexElementResult.h\ 673 667 ./objects/ElementResults/PentaVertexElementResult.cpp\ 674 ./objects/ElementResults/BeamVertexElementResult.h\675 ./objects/ElementResults/BeamVertexElementResult.cpp\676 668 ./objects/ExternalResults/ExternalResult.h\ 677 669 ./objects/ExternalResults/BoolExternalResult.h\ … … 699 691 ./objects/Inputs/TriaVertexInput.h\ 700 692 ./objects/Inputs/TriaVertexInput.cpp\ 701 ./objects/Inputs/BeamVertexInput.h\702 ./objects/Inputs/BeamVertexInput.cpp\703 693 ./objects/Inputs/PentaVertexInput.h\ 704 694 ./objects/Inputs/PentaVertexInput.cpp\ … … 709 699 ./objects/Inputs/DoubleInput.h\ 710 700 ./objects/Inputs/DoubleInput.cpp\ 711 ./objects/Elements/Beam.h\712 ./objects/Elements/Beam.cpp\713 701 ./objects/Elements/BeamRef.h\ 714 702 ./objects/Elements/BeamRef.cpp\ -
issm/trunk/src/c/objects/ElementResults/DoubleElementResult.cpp
r4899 r4927 142 142 } 143 143 /*}}}*/ 144 /*FUNCTION DoubleElementResult::SpawnBeamElementResult{{{1*/145 ElementResult* DoubleElementResult::SpawnBeamElementResult(int* indices){146 147 /*output*/148 DoubleElementResult* outresult=new DoubleElementResult();149 150 /*copy fields: */151 outresult->enum_type=this->enum_type;152 outresult->value=this->value;153 outresult->time=this->time;154 outresult->step=this->step;155 156 157 /*Assign output*/158 return outresult;159 160 }161 /*}}}*/162 144 /*FUNCTION DoubleElementResult::SpawnTriaElementResult{{{1*/ 163 145 ElementResult* DoubleElementResult::SpawnTriaElementResult(int* indices){ -
issm/trunk/src/c/objects/ElementResults/DoubleElementResult.h
r4899 r4927 42 42 /*}}}*/ 43 43 /*ElementResult virtual functions definitions: {{{1*/ 44 ElementResult* SpawnBeamElementResult(int* indices);45 44 ElementResult* SpawnTriaElementResult(int* indices); 46 45 void ProcessUnits(Parameters* parameters); -
issm/trunk/src/c/objects/ElementResults/ElementResult.h
r4899 r4927 18 18 virtual ~ElementResult(){}; 19 19 20 virtual ElementResult* SpawnBeamElementResult(int* indices)=0;21 20 virtual ElementResult* SpawnTriaElementResult(int* indices)=0; 22 21 virtual void ProcessUnits(Parameters* parameters)=0; -
issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.cpp
r4899 r4927 145 145 } 146 146 /*}}}*/ 147 /*FUNCTION PentaVertexElementResult::SpawnBeamElementResult{{{1*/148 ElementResult* PentaVertexElementResult::SpawnBeamElementResult(int* indices){149 150 /*output*/151 BeamVertexElementResult* outresult=NULL;152 double newvalues[2];153 154 /*Loop over the new indices*/155 for(int i=0;i<2;i++){156 157 /*Check index value*/158 ISSMASSERT(indices[i]>=0 && indices[i]<6);159 160 /*Assign value to new result*/161 newvalues[i]=this->values[indices[i]];162 }163 164 /*Create new Beam result*/165 outresult=new BeamVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);166 167 /*Assign output*/168 return outresult;169 170 }171 /*}}}*/172 147 /*FUNCTION PentaVertexElementResult::SpawnTriaElementResult{{{1*/ 173 148 ElementResult* PentaVertexElementResult::SpawnTriaElementResult(int* indices){ -
issm/trunk/src/c/objects/ElementResults/PentaVertexElementResult.h
r4899 r4927 41 41 /*}}}*/ 42 42 /*ElementResult virtual functions definitions: {{{1*/ 43 ElementResult* SpawnBeamElementResult(int* indices);44 43 ElementResult* SpawnTriaElementResult(int* indices); 45 44 void ProcessUnits(Parameters* parameters); -
issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.cpp
r4899 r4927 145 145 } 146 146 /*}}}*/ 147 /*FUNCTION BeamVertexElementResult::SpawnBeamElementResult{{{1*/148 ElementResult* TriaVertexElementResult::SpawnBeamElementResult(int* indices){149 150 /*output*/151 BeamVertexElementResult* outresult=NULL;152 double newvalues[2];153 154 /*Loop over the new indices*/155 for(int i=0;i<2;i++){156 157 /*Check index value*/158 ISSMASSERT(indices[i]>=0 && indices[i]<3);159 160 /*Assign value to new result*/161 newvalues[i]=this->values[indices[i]];162 }163 164 /*Create new Beam result*/165 outresult=new BeamVertexElementResult(this->enum_type,&newvalues[0],this->step,this->time);166 167 /*Assign output*/168 return outresult;169 170 }171 /*}}}*/172 147 /*FUNCTION TriaVertexElementResult::SpawnTriaElementResult{{{1*/ 173 148 ElementResult* TriaVertexElementResult::SpawnTriaElementResult(int* indices){ -
issm/trunk/src/c/objects/ElementResults/TriaVertexElementResult.h
r4899 r4927 40 40 /*}}}*/ 41 41 /*ElementResult virtual functions definitions: {{{1*/ 42 ElementResult* SpawnBeamElementResult(int* indices);43 42 ElementResult* SpawnTriaElementResult(int* indices); 44 43 void ProcessUnits(Parameters* parameters); -
issm/trunk/src/c/objects/Elements/Penta.cpp
r4926 r4927 5470 5470 } 5471 5471 /*}}}*/ 5472 /*FUNCTION Penta::SpawnBeam {{{1*/5473 void* Penta::SpawnBeam(int g0, int g1){5474 5475 int i;5476 5477 /*out of grids g0,g1 and g2 from Penta, build a beam element: */5478 Beam* beam=NULL;5479 int indices[2];5480 int zero=0;5481 Parameters *beam_parameters = NULL;5482 Inputs *beam_inputs = NULL;5483 5484 indices[0]=g0;5485 indices[1]=g1;5486 5487 beam_parameters=this->parameters;5488 beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices);5489 5490 beam=new Beam();5491 beam->id=this->id;5492 beam->inputs=beam_inputs;5493 beam->parameters=beam_parameters;5494 5495 /*now deal with ndoes,matice and matpar: */5496 beam->nodes=(Node**)xmalloc(2*sizeof(Node*));5497 for(i=0;i<2;i++)beam->nodes[i]=this->nodes[indices[i]];5498 beam->matice=this->matice;5499 beam->matpar=this->matpar;5500 5501 return beam;5502 }5503 /*}}}*/5504 5472 /*FUNCTION Penta::SurfaceNormal {{{1*/ 5505 5473 void Penta::SurfaceNormal(double* surface_normal, double xyz_list[3][3]){ -
issm/trunk/src/c/objects/Elements/Penta.h
r4921 r4927 173 173 void ReduceVectorStokes(double* Pe_reduced, double* Ke_temp, double* Pe_temp); 174 174 void SetClone(int* minranks); 175 void* SpawnBeam(int g0, int g1);176 175 Tria* SpawnTria(int g0, int g1, int g2); 177 176 void SurfaceNormal(double* surface_normal, double xyz_list[3][3]); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r4921 r4927 6065 6065 } 6066 6066 /*}}}1*/ 6067 /*FUNCTION Tria::SpawnBeam {{{1*/6068 void* Tria::SpawnBeam(int g0, int g1){6069 6070 int i;6071 6072 /*out of grids g0,g1 and g2 from Tria, build a beam element: */6073 Beam* beam=NULL;6074 int indices[2];6075 int zero=0;6076 Parameters *beam_parameters = NULL;6077 Inputs *beam_inputs = NULL;6078 6079 indices[0]=g0;6080 indices[1]=g1;6081 6082 beam_parameters=this->parameters;6083 beam_inputs=(Inputs*)this->inputs->SpawnBeamInputs(indices);6084 6085 beam=new Beam();6086 beam->id=this->id;6087 beam->inputs=beam_inputs;6088 beam->parameters=beam_parameters;6089 6090 /*now deal with nodes, matice and matpar: */6091 beam->nodes=(Node**)xmalloc(2*sizeof(Node*));6092 for(i=0;i<2;i++)beam->nodes[i]=this->nodes[indices[i]];6093 beam->matice=this->matice;6094 beam->matpar=this->matpar;6095 6096 6097 return beam;6098 }6099 /*}}}*/6100 6067 /*FUNCTION Tria::SurfaceNormal{{{1*/ 6101 6068 -
issm/trunk/src/c/objects/Elements/Tria.h
r4921 r4927 156 156 bool IsInput(int name); 157 157 void SetClone(int* minranks); 158 void* SpawnBeam(int g0, int g1);159 158 void SurfaceNormal(double* surface_normal, double xyz_list[3][3]); 160 159 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r4922 r4927 131 131 } 132 132 /*}}}*/ 133 /*FUNCTION BoolInput::SpawnBeamInput{{{1*/134 Input* BoolInput::SpawnBeamInput(int* indices){135 136 /*output*/137 BoolInput* outinput=new BoolInput();138 139 /*only copy current value*/140 outinput->enum_type=this->enum_type;141 outinput->value=this->value;142 143 /*Assign output*/144 return outinput;145 146 }147 /*}}}*/148 133 /*FUNCTION BoolInput::SpawnTriaInput{{{1*/ 149 134 Input* BoolInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r4922 r4927 38 38 /*BoolInput management: {{{1*/ 39 39 int EnumType(); 40 Input* SpawnBeamInput(int* indices);41 40 Input* SpawnTriaInput(int* indices); 42 41 Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");}; -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r4922 r4927 131 131 } 132 132 /*}}}*/ 133 /*FUNCTION DoubleInput::SpawnBeamInput{{{1*/134 Input* DoubleInput::SpawnBeamInput(int* indices){135 136 /*output*/137 DoubleInput* outinput=new DoubleInput();138 139 /*only copy current value*/140 outinput->enum_type=this->enum_type;141 outinput->value=this->value;142 143 /*Assign output*/144 return outinput;145 146 }147 /*}}}*/148 133 /*FUNCTION DoubleInput::SpawnTriaInput{{{1*/ 149 134 Input* DoubleInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r4922 r4927 37 37 /*DoubleInput management: {{{1*/ 38 38 int EnumType(); 39 Input* SpawnBeamInput(int* indices);40 39 Input* SpawnTriaInput(int* indices); 41 40 Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");}; -
issm/trunk/src/c/objects/Inputs/Input.h
r4922 r4927 37 37 virtual void ChangeEnum(int newenumtype)=0; 38 38 39 virtual Input* SpawnBeamInput(int* indices)=0;40 39 virtual Input* SpawnTriaInput(int* indices)=0; 41 40 virtual Input* PointwiseDivide(Input* inputB)=0; -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r4922 r4927 131 131 } 132 132 /*}}}*/ 133 /*FUNCTION IntInput::SpawnBeamInput{{{1*/134 Input* IntInput::SpawnBeamInput(int* indices){135 136 /*output*/137 IntInput* outinput=new IntInput();138 139 /*only copy current value*/140 outinput->enum_type=this->enum_type;141 outinput->value=this->value;142 143 /*Assign output*/144 return outinput;145 }146 /*}}}*/147 133 /*FUNCTION IntInput::SpawnTriaInput{{{1*/ 148 134 Input* IntInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r4922 r4927 38 38 /*IntInput management: {{{1*/ 39 39 int EnumType(); 40 Input* SpawnBeamInput(int* indices);41 40 Input* SpawnTriaInput(int* indices); 42 41 Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");}; -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r4922 r4927 142 142 } 143 143 /*}}}*/ 144 /*FUNCTION PentaVertexInput::SpawnBeamInput{{{1*/145 Input* PentaVertexInput::SpawnBeamInput(int* indices){146 147 /*output*/148 BeamVertexInput* outinput=NULL;149 double newvalues[2];150 151 /*Loop over the new indices*/152 for(int i=0;i<2;i++){153 154 /*Check index value*/155 ISSMASSERT(indices[i]>=0 && indices[i]<6);156 157 /*Assign value to new input*/158 newvalues[i]=this->values[indices[i]];159 }160 161 /*Create new Beam input*/162 outinput=new BeamVertexInput(this->enum_type,&newvalues[0]);163 164 /*Assign output*/165 return outinput;166 167 }168 /*}}}*/169 144 /*FUNCTION PentaVertexInput::SpawnTriaInput{{{1*/ 170 145 Input* PentaVertexInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r4922 r4927 38 38 /*PentaVertexInput management: {{{1*/ 39 39 int EnumType(); 40 Input* SpawnBeamInput(int* indices);41 40 Input* SpawnTriaInput(int* indices); 42 41 Input* PointwiseDivide(Input* inputB); -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r4921 r4927 142 142 } 143 143 /*}}}*/ 144 /*FUNCTION TriaVertexInput::SpawnBeamInput{{{1*/145 Input* TriaVertexInput::SpawnBeamInput(int* indices){146 147 /*output*/148 BeamVertexInput* outinput=NULL;149 double newvalues[2];150 151 /*Loop over the new indices*/152 for(int i=0;i<2;i++){153 154 /*Check index value*/155 ISSMASSERT(indices[i]>=0 && indices[i]<3);156 157 /*Assign value to new input*/158 newvalues[i]=this->values[indices[i]];159 }160 161 /*Create new Beam input*/162 outinput=new BeamVertexInput(this->enum_type,&newvalues[0]);163 164 /*Assign output*/165 return outinput;166 167 }168 /*}}}*/169 144 /*FUNCTION TriaVertexInput::SpawnTriaInput{{{1*/ 170 145 Input* TriaVertexInput::SpawnTriaInput(int* indices){ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r4922 r4927 38 38 /*TriaVertexInput management: {{{1*/ 39 39 int EnumType(); 40 Input* SpawnBeamInput(int* indices);41 40 Input* SpawnTriaInput(int* indices); 42 41 Input* PointwiseDivide(Input* inputB){ISSMERROR("not implemented yet");}; -
issm/trunk/src/c/objects/objects.h
r4910 r4927 33 33 34 34 /*Elements: */ 35 #include "./Elements/Beam.h"36 35 #include "./Elements/BeamRef.h" 37 36 #include "./Elements/Element.h" … … 48 47 #include "./Inputs/DoubleInput.h" 49 48 #include "./Inputs/IntInput.h" 50 #include "./Inputs/BeamVertexInput.h"51 49 #include "./Inputs/PentaVertexInput.h" 52 50 #include "./Inputs/TriaVertexInput.h" … … 57 55 #include "./ElementResults/TriaVertexElementResult.h" 58 56 #include "./ElementResults/PentaVertexElementResult.h" 59 #include "./ElementResults/BeamVertexElementResult.h"60 57 61 58 /*ExternalResults: */
Note:
See TracChangeset
for help on using the changeset viewer.