Changeset 18237 for issm/trunk-jpl/src
- Timestamp:
- 07/11/14 11:33:15 (11 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 79 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
r18136 r18237 69 69 iomodel->FetchDataToInput(elements,PressureEnum); 70 70 71 bool dakota_analysis;72 iomodel->Constant(&dakota_analysis,QmuIsdakotaEnum);73 if(dakota_analysis){74 elements->InputDuplicate(DamageDEnum, QmuDamageDEnum);75 }76 71 }/*}}}*/ 77 72 void DamageEvolutionAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r18068 r18237 78 78 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 79 79 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 80 if(dakota_analysis){81 elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);82 elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);83 elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);84 elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);85 elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);86 }87 80 if(islevelset){ 88 81 iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum); -
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r18074 r18237 71 71 if(stabilization==3){ 72 72 iomodel->FetchDataToInput(elements,MasstransportSpcthicknessEnum); //for DG, we need the spc in the element 73 }74 75 if(dakota_analysis){76 elements->InputDuplicate(BaseEnum,QmuBaseEnum);77 elements->InputDuplicate(ThicknessEnum,QmuThicknessEnum);78 elements->InputDuplicate(SurfaceEnum,QmuSurfaceEnum);79 elements->InputDuplicate(MaskIceLevelsetEnum,QmuMaskIceLevelsetEnum);80 if(isgroundingline) elements->InputDuplicate(MaskGroundediceLevelsetEnum,QmuMaskGroundediceLevelsetEnum);81 73 } 82 74 -
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r18235 r18237 213 213 iomodel->FetchDataToInput(elements,MaterialsRheologyNEnum); 214 214 iomodel->FetchDataToInput(elements,VxEnum,0.); 215 if(dakota_analysis)elements->InputDuplicate(VxEnum,QmuVxEnum);216 215 iomodel->FetchDataToInput(elements,VyEnum,0.); 217 if(dakota_analysis)elements->InputDuplicate(VyEnum,QmuVyEnum);218 216 iomodel->FetchDataToInput(elements,LoadingforceXEnum); 219 217 iomodel->FetchDataToInput(elements,LoadingforceYEnum); … … 228 226 iomodel->FetchDataToInput(elements,LoadingforceZEnum); 229 227 iomodel->FetchDataToInput(elements,VzEnum,0.); 230 if(dakota_analysis)elements->InputDuplicate(VzEnum,QmuVzEnum);231 228 } 232 229 if(isFS){ 233 230 iomodel->FetchDataToInput(elements,PressureEnum,0.); 234 231 iomodel->FetchDataToInput(elements,BasalforcingsFloatingiceMeltingRateEnum,0.); 235 if(dakota_analysis)elements->InputDuplicate(PressureEnum,QmuPressureEnum);236 232 } 237 233 if(islevelset){ -
issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
r18068 r18237 75 75 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 76 76 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 77 if(dakota_analysis){78 elements->InputDuplicate(TemperatureEnum,QmuTemperatureEnum);79 elements->InputDuplicate(BasalforcingsGroundediceMeltingRateEnum,QmuMeltingEnum);80 elements->InputDuplicate(VxMeshEnum,QmuVxMeshEnum);81 elements->InputDuplicate(VxMeshEnum,QmuVyMeshEnum);82 elements->InputDuplicate(VxMeshEnum,QmuVzMeshEnum);83 }84 77 if(islevelset){ 85 78 iomodel->FetchDataToInput(elements,IceMaskNodeActivationEnum); -
issm/trunk-jpl/src/c/classes/Constraints/SpcDynamic.cpp
r18064 r18237 54 54 } 55 55 /*}}}*/ 56 int 56 int SpcDynamic::Id(void){ return sid; }/*{{{*/ 57 57 /*}}}*/ 58 58 int SpcDynamic::ObjectEnum(void){/*{{{*/ … … 63 63 /*}}}*/ 64 64 Object* SpcDynamic::copy() {/*{{{*/ 65 return new SpcDynamic(*this); 65 66 SpcDynamic* spcdyn = new SpcDynamic(*this); 67 68 spcdyn->sid=this->sid; 69 spcdyn->nodeid=this->nodeid; 70 spcdyn->dof=this->dof; 71 spcdyn->value=this->value; 72 spcdyn->analysis_type=this->analysis_type; 73 spcdyn->isset=this->isset; 74 75 return (Object*) spcdyn; 66 76 } 67 77 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Constraints/SpcStatic.cpp
r18064 r18237 57 57 } 58 58 /*}}}*/ 59 int 59 int SpcStatic::Id(void){ return sid; }/*{{{*/ 60 60 /*}}}*/ 61 61 int SpcStatic::ObjectEnum(void){/*{{{*/ … … 66 66 /*}}}*/ 67 67 Object* SpcStatic::copy() {/*{{{*/ 68 return new SpcStatic(*this); 68 69 SpcStatic* spcstat = new SpcStatic(*this); 70 71 spcstat->sid=this->sid; 72 spcstat->nodeid=this->nodeid; 73 spcstat->dof=this->dof; 74 spcstat->value=this->value; 75 spcstat->analysis_type=this->analysis_type; 76 77 return (Object*) spcstat; 69 78 } 70 79 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Contour.h
r18064 r18237 77 77 /*}}}*/ 78 78 Object* copy() {/*{{{*/ 79 return new Contour(*this); 79 80 Contour* contour = new Contour(this->id,this->nods,this->x,this->y,this->closed); 81 82 return (Object*) contour; 80 83 } 81 84 /*}}}*/ -
issm/trunk-jpl/src/c/classes/DofIndexing.cpp
r18064 r18237 55 55 this->s_set=xNew<bool>(this->gsize); 56 56 this->svalues=xNew<IssmDouble>(this->gsize); 57 if(in->doftype)this->doftype=xNew<int>(this->gsize); 57 if(in->doftype){ 58 this->doftype=xNew<int>(this->gsize); 59 } 60 else{ 61 this->doftype=NULL; 62 } 58 63 this->gdoflist=xNew<int>(this->gsize); 59 64 } … … 65 70 this->gdoflist = NULL; 66 71 } 67 if(this->fsize>0 && this->fsize!=UNDEF)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL;68 if(this->ssize>0 && this->ssize!=UNDEF)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL;72 if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL; 73 if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL; 69 74 70 75 if(this->gsize>0){ … … 75 80 memcpy(this->gdoflist,in->gdoflist,this->gsize*sizeof(int)); 76 81 } 77 if(this->fsize>0 && this->fsize!=UNDEF)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int));78 if(this->ssize>0 && this->ssize!=UNDEF)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int));82 if(this->fsize>0)memcpy(this->fdoflist,in->fdoflist,this->fsize*sizeof(int)); 83 if(this->ssize>0)memcpy(this->sdoflist,in->sdoflist,this->ssize*sizeof(int)); 79 84 80 85 } … … 82 87 DofIndexing::~DofIndexing(){ //destructor/*{{{*/ 83 88 84 xDelete<bool>(f_set); 85 xDelete<bool>(s_set); 86 xDelete<IssmDouble>(svalues); 87 xDelete<int>(doftype); 88 xDelete<int>(gdoflist); 89 xDelete<int>(fdoflist); 90 xDelete<int>(sdoflist); 91 89 if(this->f_set) xDelete<bool>(f_set); 90 if(this->s_set) xDelete<bool>(s_set); 91 if(this->svalues) xDelete<IssmDouble>(svalues); 92 if(this->doftype) xDelete<int>(doftype); 93 if(this->gdoflist) xDelete<int>(gdoflist); 94 if(this->fdoflist) xDelete<int>(fdoflist); 95 if(this->sdoflist) xDelete<int>(sdoflist); 96 97 } 98 /*}}}*/ 99 DofIndexing DofIndexing::operator=( const DofIndexing& in ){/*{{{*/ 100 101 this->copy(in); 102 103 return this; 104 } 105 /*}}}*/ 106 void DofIndexing::copy(const DofIndexing& in ){/*{{{*/ 107 108 this->gsize = in.gsize; 109 this->fsize = in.fsize; 110 this->ssize = in.ssize; 111 this->clone = in.clone; 112 this->active = in.active; 113 114 if(this->gsize>0){ 115 this->f_set=xNew<bool>(this->gsize); 116 this->s_set=xNew<bool>(this->gsize); 117 this->svalues=xNew<IssmDouble>(this->gsize); 118 if(in.doftype){ 119 this->doftype=xNew<int>(this->gsize); 120 } 121 else{ 122 this->doftype=NULL; 123 } 124 this->gdoflist=xNew<int>(this->gsize); 125 } 126 else{ 127 this->f_set = NULL; 128 this->s_set = NULL; 129 this->svalues = NULL; 130 this->doftype = NULL; 131 this->gdoflist = NULL; 132 } 133 if(this->fsize>0)this->fdoflist=xNew<int>(this->fsize); else this->fdoflist=NULL; 134 if(this->ssize>0)this->sdoflist=xNew<int>(this->ssize); else this->sdoflist=NULL; 135 136 if(this->gsize>0){ 137 memcpy(this->f_set,in.f_set,this->gsize*sizeof(bool)); 138 memcpy(this->s_set,in.s_set,this->gsize*sizeof(bool)); 139 xMemCpy<IssmDouble>(this->svalues,in.svalues,this->gsize); 140 if(this->doftype)memcpy(this->doftype,in.doftype,this->gsize*sizeof(int)); 141 memcpy(this->gdoflist,in.gdoflist,this->gsize*sizeof(int)); 142 } 143 if(this->fsize>0)memcpy(this->fdoflist,in.fdoflist,this->fsize*sizeof(int)); 144 if(this->ssize>0)memcpy(this->sdoflist,in.sdoflist,this->ssize*sizeof(int)); 145 146 return; 92 147 } 93 148 /*}}}*/ … … 101 156 /*memory allocation */ 102 157 if(this->gsize>0){ 103 this->f_set = xNew<bool>( this->gsize);104 this->s_set = xNew<bool>( this->gsize);105 this->svalues = xNew<IssmDouble>( this->gsize);106 this->gdoflist = xNew<int>( this->gsize);107 108 if(in_doftype) 109 this->doftype = xNew<int>(this->gsize);158 this->f_set = xNew<bool>((unsigned int)in_gsize); 159 this->s_set = xNew<bool>((unsigned int)in_gsize); 160 this->svalues = xNew<IssmDouble>((unsigned int)in_gsize); 161 this->gdoflist = xNew<int>((unsigned int)in_gsize); 162 163 if(in_doftype) this->doftype = xNew<int>((unsigned int)in_gsize); 164 else this->doftype = NULL; 110 165 } 111 166 … … 117 172 this->gdoflist[i] = UNDEF; 118 173 119 if(this->doftype) 120 this->doftype[i]=in_doftype[i]; 174 if(this->doftype) this->doftype[i]=in_doftype[i]; 121 175 } 122 176 } -
issm/trunk-jpl/src/c/classes/DofIndexing.h
r15223 r18237 41 41 DofIndexing(DofIndexing* properties); 42 42 ~DofIndexing(); 43 DofIndexing operator=(const DofIndexing& in); 43 44 /*}}}*/ 44 45 /*Object like functionality: {{{*/ 45 46 void Echo(void); 46 47 void DeepEcho(void); 47 void copy( DofIndexing* properties);48 void copy(const DofIndexing& in); 48 49 /*}}}*/ 49 50 /*DofIndexing management: {{{*/ -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r18194 r18237 289 289 if(nodes){ 290 290 int numnodes = this->GetNumberOfNodes(); 291 for(int i=0;i<numnodes;i++) nodes[i]->Echo(); 291 for(int i=0;i<numnodes;i++) { 292 _printf_("nodes[" << i << "] = " << nodes[i]); 293 nodes[i]->Echo(); 294 } 292 295 } 293 296 else _printf_("nodes = NULL\n"); -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r18194 r18237 165 165 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 166 166 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0; 167 virtual void ResetHooks()=0; 167 168 virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0; 168 169 -
issm/trunk-jpl/src/c/classes/Elements/ElementHook.cpp
r17962 r18237 29 29 int i; 30 30 31 for(i=0;i<this->numanalyses;i++){ 32 if (this->hnodes[i]) delete this->hnodes[i]; 33 } 34 delete [] this->hnodes; 31 if (this->hnodes) delete [] this->hnodes; 35 32 delete hvertices; 36 33 delete hmaterial; … … 76 73 77 74 void ElementHook::SetHookNodes(int* node_ids,int numnodes,int analysis_counter){/*{{{*/ 78 this->hnodes[analysis_counter]= new Hook(node_ids,numnodes);75 if(this->hnodes) this->hnodes[analysis_counter]= new Hook(node_ids,numnodes); 79 76 } 80 77 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Elements/Elements.cpp
r17962 r18237 62 62 } 63 63 /*}}}*/ 64 void Elements::ResetHooks(){/*{{{*/ 65 66 vector<Object*>::iterator object; 67 Element* element=NULL; 68 69 for ( object=objects.begin() ; object < objects.end(); object++ ){ 70 71 element=dynamic_cast<Element*>((*object)); 72 element->ResetHooks(); 73 74 } 75 76 } 77 /*}}}*/ 64 78 int Elements::MaxNumNodes(void){/*{{{*/ 65 79 -
issm/trunk-jpl/src/c/classes/Elements/Elements.h
r16486 r18237 27 27 int MaxNumNodes(void); 28 28 void SetCurrentConfiguration(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 29 void ResetHooks(); 29 30 int NumberOfElements(void); 30 31 void InputDuplicate(int input_enum,int output_enum); -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r18212 r18237 64 64 65 65 int i; 66 67 66 Penta* penta=NULL; 68 67 … … 70 69 71 70 //deal with PentaRef mother class 72 penta->element_type_list=xNew<int>(this->numanalyses); 73 for(i=0;i<this->numanalyses;i++) penta->element_type_list[i]=this->element_type_list[i]; 74 75 //deal with ElementHook 76 penta->numanalyses=this->numanalyses; 77 penta->hnodes=new Hook*[penta->numanalyses]; 78 for(i=0;i<penta->numanalyses;i++)penta->hnodes[i]=(Hook*)this->hnodes[i]->copy(); 79 penta->hvertices=(Hook*)this->hvertices->copy(); 80 penta->hmaterial=(Hook*)this->hmaterial->copy(); 81 penta->hmatpar=(Hook*)this->hmatpar->copy(); 82 penta->hneighbors=(Hook*)this->hneighbors->copy(); 83 84 /*deal with Penta copy fields: */ 85 penta->id=this->id; 86 penta->sid=this->sid; 87 if(this->inputs){ 88 penta->inputs=(Inputs*)this->inputs->Copy(); 89 } 90 else{ 91 penta->inputs=new Inputs(); 92 } 71 int nanalyses = this->numanalyses; 72 if(nanalyses > 0){ 73 penta->element_type_list=xNew<int>(nanalyses); 74 for(i=0;i<nanalyses;i++) { 75 if (this->element_type_list[i]) penta->element_type_list[i]=this->element_type_list[i]; 76 else penta->element_type_list[i] = NULL; 77 } 78 } 79 else penta->element_type_list = NULL; 80 penta->element_type=this->element_type; 81 penta->numanalyses=nanalyses; 82 83 //deal with ElementHook mother class 84 if (this->hnodes){ 85 penta->hnodes=xNew<Hook*>(penta->numanalyses); 86 for(i=0;i<penta->numanalyses;i++){ 87 if (this->hnodes[i]) penta->hnodes[i] = (Hook*)(this->hnodes[i]->copy()); 88 else penta->hnodes[i] = NULL; 89 } 90 } 91 else penta->hnodes = NULL; 92 93 penta->hvertices = (Hook*)this->hvertices->copy(); 94 penta->hmaterial = (Hook*)this->hmaterial->copy(); 95 penta->hmatpar = (Hook*)this->hmatpar->copy(); 96 if (this->hneighbors) penta->hneighbors = (Hook*)(this->hneighbors->copy()); 97 else penta->hneighbors = NULL; 98 99 /*deal with Tria fields: */ 100 penta->id = this->id; 101 penta->sid = this->sid; 102 if(this->inputs) penta->inputs = (Inputs*)(this->inputs->Copy()); 103 else penta->inputs=new Inputs(); 104 93 105 /*point parameters: */ 94 106 penta->parameters=this->parameters; 95 107 96 108 /*recover objects: */ 97 penta->nodes=xNew<Node*>(6); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 98 for(i=0;i<6;i++)penta->nodes[i]=this->nodes[i]; 99 penta->vertices=(Vertex**)penta->hvertices->deliverp(); 100 penta->material=(Material*)penta->hmaterial->delivers(); 101 penta->matpar=(Matpar*)penta->hmatpar->delivers(); 102 penta->verticalneighbors=(Penta**)penta->hneighbors->deliverp(); 109 if (this->nodes) { 110 unsigned int num_nodes = 6; 111 penta->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 112 for(i=0;i<num_nodes;i++) if(this->nodes[i]) penta->nodes[i]=this->nodes[i]; else penta->nodes[i] = NULL; 113 } 114 else penta->nodes = NULL; 115 116 penta->vertices = (Vertex**)this->hvertices->deliverp(); 117 penta->material = (Material*)this->hmaterial->delivers(); 118 penta->matpar = (Matpar*)this->hmatpar->delivers(); 119 penta->verticalneighbors = (Penta**)this->hneighbors->deliverp(); 103 120 104 121 return penta; 122 105 123 } 106 124 /*}}}*/ … … 1897 1915 if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 1898 1916 else this->nodes=NULL; 1917 1918 } 1919 /*}}}*/ 1920 void Penta::ResetHooks(){/*{{{*/ 1921 1922 this->nodes=NULL; 1923 this->vertices=NULL; 1924 this->material=NULL; 1925 this->matpar=NULL; 1926 this->verticalneighbors=NULL; 1927 this->parameters=NULL; 1928 1929 //deal with ElementHook mother class 1930 for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset(); 1931 this->hvertices->reset(); 1932 this->hmaterial->reset(); 1933 this->hmatpar->reset(); 1934 if(this->hneighbors) this->hneighbors->reset(); 1899 1935 1900 1936 } -
issm/trunk-jpl/src/c/classes/Elements/Penta.h
r18192 r18237 62 62 void FSContactMigration(Vector<IssmDouble>* vertexgrounded,Vector<IssmDouble>* vertexfloating); 63 63 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters); 64 void ResetHooks(); 64 65 void Delta18oParameterization(void); 65 66 Penta* GetUpperPenta(void); -
issm/trunk-jpl/src/c/classes/Elements/Seg.h
r18192 r18237 59 59 void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters){_error_("not implemented yet");}; 60 60 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters){_error_("not implemented yet");}; 61 void ResetHooks(){_error_("not implemented yet");}; 61 62 void Delta18oParameterization(void){_error_("not implemented yet");}; 62 63 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz){_error_("not implemented yet");}; -
issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
r18179 r18237 48 48 /*}}}*/ 49 49 Object* Tetra::copy() {/*{{{*/ 50 _error_("not implemented yet"); 50 51 int i; 52 Tetra* tetra=NULL; 53 54 tetra=new Tetra(); 55 56 //deal with TetraRef mother class 57 int nanalyses = this->numanalyses; 58 if(nanalyses > 0){ 59 tetra->element_type_list=xNew<int>(nanalyses); 60 for(i=0;i<nanalyses;i++){ 61 if (this->element_type_list[i]) tetra->element_type_list[i]=this->element_type_list[i]; 62 else tetra->element_type_list[i] = NULL; 63 } 64 } 65 else tetra->element_type_list = NULL; 66 tetra->element_type=this->element_type; 67 tetra->numanalyses=nanalyses; 68 69 //deal with ElementHook mother class 70 if (this->hnodes){ 71 tetra->hnodes=xNew<Hook*>(tetra->numanalyses); 72 for(i=0;i<tetra->numanalyses;i++){ 73 if (this->hnodes[i]) tetra->hnodes[i] = (Hook*)(this->hnodes[i]->copy()); 74 else tetra->hnodes[i] = NULL; 75 } 76 } 77 else tetra->hnodes = NULL; 78 79 tetra->hvertices = (Hook*)this->hvertices->copy(); 80 tetra->hmaterial = (Hook*)this->hmaterial->copy(); 81 tetra->hmatpar = (Hook*)this->hmatpar->copy(); 82 tetra->hneighbors = NULL; 83 84 /*deal with Tria fields: */ 85 tetra->id = this->id; 86 tetra->sid = this->sid; 87 if(this->inputs) tetra->inputs = (Inputs*)(this->inputs->Copy()); 88 else tetra->inputs=new Inputs(); 89 90 /*point parameters: */ 91 tetra->parameters=this->parameters; 92 93 /*recover objects: */ 94 unsigned int num_nodes = 3; 95 tetra->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 96 for(i=0;i<num_nodes;i++) if(this->nodes[i]) tetra->nodes[i]=this->nodes[i]; else tetra->nodes[i] = NULL; 97 98 tetra->vertices = (Vertex**)this->hvertices->deliverp(); 99 tetra->material = (Material*)this->hmaterial->delivers(); 100 tetra->matpar = (Matpar*)this->hmatpar->delivers(); 101 102 return tetra; 51 103 } 52 104 /*}}}*/ … … 727 779 } 728 780 /*}}}*/ 781 void Tetra::ResetHooks(){/*{{{*/ 782 783 this->nodes=NULL; 784 this->vertices=NULL; 785 this->material=NULL; 786 this->matpar=NULL; 787 this->parameters=NULL; 788 789 //deal with ElementHook mother class 790 for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset(); 791 this->hvertices->reset(); 792 this->hmaterial->reset(); 793 this->hmatpar->reset(); 794 if(this->hneighbors) this->hneighbors->reset(); 795 } 796 /*}}}*/ 729 797 Element* Tetra::SpawnBasalElement(void){/*{{{*/ 730 798 -
issm/trunk-jpl/src/c/classes/Elements/Tetra.h
r18192 r18237 59 59 void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters); 60 60 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters); 61 void ResetHooks(); 61 62 void Delta18oParameterization(void){_error_("not implemented yet");}; 62 63 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r18192 r18237 42 42 this->material = NULL; 43 43 this->matpar = NULL; 44 this->element_type_list=xNew<int>(nummodels); 44 if(nummodels>0){ 45 this->element_type_list=xNew<int>(nummodels); 46 for(int i=0;i<nummodels;i++) this->element_type_list[i] = NULL; 47 } 48 else this->element_type_list = NULL; 49 45 50 } 46 51 /*}}}*/ … … 57 62 58 63 //deal with TriaRef mother class 59 tria->element_type_list=xNew<int>(this->numanalyses); 60 for(i=0;i<this->numanalyses;i++) tria->element_type_list[i]=this->element_type_list[i]; 64 int nanalyses = this->numanalyses; 65 if(nanalyses > 0){ 66 tria->element_type_list=xNew<int>(nanalyses); 67 for(i=0;i<nanalyses;i++){ 68 if (this->element_type_list[i]) tria->element_type_list[i]=this->element_type_list[i]; 69 else tria->element_type_list[i] = NULL; 70 } 71 } 72 else tria->element_type_list = NULL; 73 tria->element_type=this->element_type; 74 tria->numanalyses=nanalyses; 61 75 62 76 //deal with ElementHook mother class 63 tria->numanalyses=this->numanalyses; 64 tria->hnodes=new Hook*[tria->numanalyses]; 65 for(i=0;i<tria->numanalyses;i++)tria->hnodes[i]=(Hook*)this->hnodes[i]->copy(); 77 if (this->hnodes){ 78 tria->hnodes=xNew<Hook*>(tria->numanalyses); 79 for(i=0;i<tria->numanalyses;i++){ 80 if (this->hnodes[i]) tria->hnodes[i] = (Hook*)(this->hnodes[i]->copy()); 81 else tria->hnodes[i] = NULL; 82 } 83 } 84 else tria->hnodes = NULL; 85 66 86 tria->hvertices = (Hook*)this->hvertices->copy(); 67 87 tria->hmaterial = (Hook*)this->hmaterial->copy(); 68 88 tria->hmatpar = (Hook*)this->hmatpar->copy(); 89 tria->hneighbors = NULL; 69 90 70 91 /*deal with Tria fields: */ 71 92 tria->id = this->id; 72 93 tria->sid = this->sid; 73 if(this->inputs){ 74 tria->inputs=(Inputs*)this->inputs->Copy(); 75 } 76 else{ 77 tria->inputs=new Inputs(); 78 } 94 if(this->inputs) tria->inputs = (Inputs*)(this->inputs->Copy()); 95 else tria->inputs=new Inputs(); 96 79 97 /*point parameters: */ 80 98 tria->parameters=this->parameters; 81 99 82 100 /*recover objects: */ 83 tria->nodes = xNew<Node*>(3); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 84 for(i=0;i<3;i++)tria->nodes[i]=this->nodes[i]; 85 86 tria->vertices = (Vertex**)tria->hvertices->deliverp(); 87 tria->material = (Material*)tria->hmaterial->delivers(); 88 tria->matpar = (Matpar*)tria->hmatpar->delivers(); 101 if (this->nodes){ 102 unsigned int num_nodes = 3; 103 tria->nodes = xNew<Node*>(num_nodes); //we cannot rely on an analysis_counter to tell us which analysis_type we are running, so we just copy the nodes. 104 for(i=0;i<num_nodes;i++) if(this->nodes[i]) tria->nodes[i]=this->nodes[i]; else tria->nodes[i] = NULL; 105 } 106 else tria->nodes = NULL; 107 108 109 tria->vertices = (Vertex**)this->hvertices->deliverp(); 110 tria->material = (Material*)this->hmaterial->delivers(); 111 tria->matpar = (Matpar*)this->hmatpar->delivers(); 89 112 90 113 return tria; … … 307 330 308 331 /*Get Element type*/ 309 this->element_type=this->element_type_list[analysis_counter];332 if (this->element_type_list) this->element_type=this->element_type_list[analysis_counter]; 310 333 311 334 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective 312 335 * datasets, using internal ids and offsets hidden in hooks: */ 313 if(this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); 336 if(this->hnodes){ 337 if (this->hnodes[analysis_counter]) this->hnodes[analysis_counter]->configure(nodesin); 338 else this->hnodes[analysis_counter] = NULL; 339 } 340 else this->hnodes = NULL; 314 341 this->hvertices->configure(verticesin); 315 342 this->hmaterial->configure(materialsin); … … 317 344 318 345 /*Now, go pick up the objects inside the hooks: */ 319 if(this->hnodes [analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp();346 if(this->hnodes && this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 320 347 else this->nodes=NULL; 321 348 this->vertices = (Vertex**)this->hvertices->deliverp(); … … 327 354 328 355 /*get inputs configured too: */ 329 this->inputs->Configure( parameters);356 this->inputs->Configure(this->parameters); 330 357 331 358 } … … 856 883 /*}}}*/ 857 884 int Tria::GetNumberOfNodes(void){/*{{{*/ 858 return this->NumberofNodes(this->element_type); 885 if (this->nodes) return this->NumberofNodes(this->element_type); 886 else return 0; 859 887 } 860 888 /*}}}*/ … … 1684 1712 } 1685 1713 /*}}}*/ 1714 void Tria::ResetHooks(){/*{{{*/ 1715 1716 this->nodes=NULL; 1717 this->vertices=NULL; 1718 this->material=NULL; 1719 this->matpar=NULL; 1720 this->parameters=NULL; 1721 1722 //deal with ElementHook mother class 1723 for(int i=0;i<this->numanalyses;i++) if(this->hnodes[i]) this->hnodes[i]->reset(); 1724 this->hvertices->reset(); 1725 this->hmaterial->reset(); 1726 this->hmatpar->reset(); 1727 if(this->hneighbors) this->hneighbors->reset(); 1728 1729 } 1730 /*}}}*/ 1686 1731 void Tria::SetClone(int* minranks){/*{{{*/ 1687 1732 … … 1759 1804 1760 1805 /*Get Element type*/ 1761 this->element_type=this->element_type_list[analysis_counter];1806 if(this->element_type_list) this->element_type=this->element_type_list[analysis_counter]; 1762 1807 1763 1808 /*Pick up nodes*/ 1764 if(this->hnodes[analysis_counter]) this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 1765 else this->nodes=NULL; 1809 if(this->hnodes && this->hnodes[analysis_counter]){ 1810 this->nodes=(Node**)this->hnodes[analysis_counter]->deliverp(); 1811 } 1766 1812 1767 1813 } -
issm/trunk-jpl/src/c/classes/Elements/Tria.h
r18192 r18237 58 58 void Configure(Elements* elements,Loads* loads,Nodes* nodesin,Vertices* verticesin,Materials* materials,Parameters* parameters); 59 59 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters); 60 void ResetHooks(); 60 61 void Delta18oParameterization(void); 61 62 void ElementSizes(IssmDouble* hx,IssmDouble* hy,IssmDouble* hz); -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r18222 r18237 106 106 char *outbinfilename = NULL; 107 107 char *lockfilename = NULL; 108 bool waitonlock = false; 109 110 /*Close output file: */ 111 this->parameters->FindParam(&output_fid,OutputFilePointerEnum); 112 this->parameters->FindParam(&outbinfilename,OutputFileNameEnum); 113 pfclose(output_fid,outbinfilename); 114 115 /*Write lock file if requested: */ 116 this->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum); 108 109 this->parameters->FindParam(&outbinfilename,OutputFileNameEnum); 117 110 this->parameters->FindParam(&lockfilename,LockFileNameEnum); 118 if(waitonlock){119 _printf0_("write lock file:\n");120 WriteLockFile(lockfilename);121 }122 111 123 112 /*Delete all the datasets: */ … … 134 123 delete results; 135 124 125 /*Now delete: */ 126 delete profiler; 127 128 } 129 /*}}}*/ 130 131 /*Object management*/ 132 void FemModel::Echo(void){/*{{{*/ 133 134 _printf_("FemModel echo: \n"); 135 _printf_(" number of fem models: " << nummodels << "\n"); 136 _printf_(" analysis_type_list: \n"); 137 for(int i=0;i<nummodels;i++)_printf_(" " << i << ": " << EnumToStringx(analysis_type_list[i]) << "\n"); 138 _printf_(" current analysis_type: \n"); 139 _printf_(" " << analysis_counter << ": " << EnumToStringx(analysis_type_list[analysis_counter]) << "\n"); 140 141 } 142 /*}}}*/ 143 void FemModel::InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){/*{{{*/ 144 145 /*intermediary*/ 146 int i; 147 int analysis_type; 148 FILE *IOMODEL = NULL; 149 FILE *toolkitsoptionsfid = NULL; 150 FILE *output_fid = NULL; 151 int my_rank; 152 153 /*recover my_rank:*/ 154 my_rank=IssmComm::GetRank(); 155 156 /*Open input file on cpu 0: */ 157 if(my_rank==0) IOMODEL = pfopen0(inputfilename ,"rb"); 158 159 /*Open toolkits file: */ 160 toolkitsoptionsfid=pfopen(toolkitsfilename,"r"); 161 162 /*Initialize internal data: */ 163 this->nummodels = nummodels; 164 this->solution_type = in_solution_type; 165 this->analysis_counter = nummodels-1; //point to last analysis_type carried out. 166 this->results = new Results(); //not initialized by CreateDataSets 167 168 /*Dynamically allocate whatever is a list of length nummodels: */ 169 analysis_type_list=xNew<int>(nummodels); 170 171 /*Initialize: */ 172 for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i]; 173 174 /*create datasets for all analyses*/ 175 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,toolkitsoptionsfid,rootpath,this->solution_type,nummodels,analyses); 176 177 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ 178 for(i=0;i<nummodels;i++){ 179 180 if(VerboseMProcessor()) _printf0_(" Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":\n"); 181 analysis_type=analysis_type_list[i]; 182 this->SetCurrentConfiguration(analysis_type); 183 184 if(i==0){ 185 if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n"); 186 VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices 187 } 188 189 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n"); 190 SpcNodesx(nodes,constraints,parameters,analysis_type); 191 192 if(VerboseMProcessor()) _printf0_(" creating nodal degrees of freedom\n"); 193 NodesDofx(nodes,parameters,analysis_type); 194 195 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n"); 196 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters); 197 } 198 199 /*Close input file and toolkits file descriptors: */ 200 if(my_rank==0) pfclose(IOMODEL,inputfilename); 201 pfclose(toolkitsoptionsfid,toolkitsfilename); 202 203 /*Open output file once for all and add output file name and file descriptor to parameters*/ 204 output_fid=pfopen(outputfilename,"wb"); 205 this->parameters->AddObject(new StringParam(OutputFileNameEnum,outputfilename)); 206 this->parameters->SetParam(output_fid,OutputFilePointerEnum); 207 208 /*Save lock file name for later: */ 209 this->parameters->AddObject(new StringParam(LockFileNameEnum,lockfilename)); 210 211 } 212 /*}}}*/ 213 void FemModel::CleanUp(void){/*{{{*/ 214 215 /*Intermediary*/ 216 FILE *output_fid; 217 char *outbinfilename = NULL; 218 char *lockfilename = NULL; 219 bool waitonlock = false; 220 221 /*Close output file: */ 222 this->parameters->FindParam(&output_fid,OutputFilePointerEnum); 223 this->parameters->FindParam(&outbinfilename,OutputFileNameEnum); 224 pfclose(output_fid,outbinfilename); 225 226 /*Write lock file if requested: */ 227 this->parameters->FindParam(&waitonlock,SettingsWaitonlockEnum); 228 this->parameters->FindParam(&lockfilename,LockFileNameEnum); 229 if(waitonlock){ 230 _printf0_("write lock file:\n"); 231 WriteLockFile(lockfilename); 232 } 233 136 234 /*Before we delete the profiler, report statistics for this run: */ 137 235 profiler->Tag(Finish); //final tagging … … 141 239 _printf0_("\n"); 142 240 _printf0_(" Total elapsed time:" 143 <<profiler->DeltaTimeModHour(Start,Finish)<<" hrs "144 <<profiler->DeltaTimeModMin(Start,Finish)<<" min "145 <<profiler->DeltaTimeModSec(Start,Finish)<<" sec"146 );241 <<profiler->DeltaTimeModHour(Start,Finish)<<" hrs " 242 <<profiler->DeltaTimeModMin(Start,Finish)<<" min " 243 <<profiler->DeltaTimeModSec(Start,Finish)<<" sec" 244 ); 147 245 _printf0_("\n"); 148 149 /*Now delete: */150 delete profiler;151 246 152 247 /*Finalize PETSC for this model: */ 153 248 #ifdef _HAVE_PETSC_ 154 249 _printf0_("closing PETSc\n"); 155 PetscFinalize(); 250 PetscFinalize(); 156 251 #endif 157 252 158 253 } 159 /*}}}*/160 161 /*Object management*/162 void FemModel::Echo(void){/*{{{*/163 164 _printf_("FemModel echo: \n");165 _printf_(" number of fem models: " << nummodels << "\n");166 _printf_(" analysis_type_list: \n");167 for(int i=0;i<nummodels;i++)_printf_(" " << i << ": " << EnumToStringx(analysis_type_list[i]) << "\n");168 _printf_(" current analysis_type: \n");169 _printf_(" " << analysis_counter << ": " << EnumToStringx(analysis_type_list[analysis_counter]) << "\n");170 171 }172 /*}}}*/173 void FemModel::InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* toolkitsfilename, char* lockfilename, const int in_solution_type,const int* analyses,const int nummodels){/*{{{*/174 175 /*intermediary*/176 int i;177 int analysis_type;178 FILE *IOMODEL = NULL;179 FILE *toolkitsoptionsfid = NULL;180 FILE *output_fid = NULL;181 int my_rank;182 183 /*recover my_rank:*/184 my_rank=IssmComm::GetRank();185 186 /*Open input file on cpu 0: */187 if(my_rank==0) IOMODEL = pfopen0(inputfilename ,"rb");188 189 /*Open toolkits file: */190 toolkitsoptionsfid=pfopen(toolkitsfilename,"r");191 192 /*Initialize internal data: */193 this->nummodels = nummodels;194 this->solution_type = in_solution_type;195 this->analysis_counter = nummodels-1; //point to last analysis_type carried out.196 this->results = new Results(); //not initialized by CreateDataSets197 198 /*Dynamically allocate whatever is a list of length nummodels: */199 analysis_type_list=xNew<int>(nummodels);200 201 /*Initialize: */202 for(i=0;i<nummodels;i++)analysis_type_list[i]=analyses[i];203 204 /*create datasets for all analyses*/205 ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,toolkitsoptionsfid,rootpath,this->solution_type,nummodels,analyses);206 207 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */208 for(i=0;i<nummodels;i++){209 210 if(VerboseMProcessor()) _printf0_(" Processing finite element model of analysis " << EnumToStringx(analysis_type_list[i]) << ":\n");211 analysis_type=analysis_type_list[i];212 this->SetCurrentConfiguration(analysis_type);213 214 if(i==0){215 if(VerboseMProcessor()) _printf0_(" creating vertex PIDs\n");216 VerticesDofx(vertices,parameters); //only call once, we only have one set of vertices217 }218 219 if(VerboseMProcessor()) _printf0_(" resolving node constraints\n");220 SpcNodesx(nodes,constraints,parameters,analysis_type);221 222 if(VerboseMProcessor()) _printf0_(" creating nodal degrees of freedom\n");223 NodesDofx(nodes,parameters,analysis_type);224 225 if(VerboseMProcessor()) _printf0_(" configuring element and loads\n");226 ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);227 }228 229 /*Close input file and toolkits file descriptors: */230 if(my_rank==0) pfclose(IOMODEL,inputfilename);231 pfclose(toolkitsoptionsfid,toolkitsfilename);232 233 /*Open output file once for all and add output file name and file descriptor to parameters*/234 output_fid=pfopen(outputfilename,"wb");235 this->parameters->AddObject(new StringParam(OutputFileNameEnum,outputfilename));236 this->parameters->SetParam(output_fid,OutputFilePointerEnum);237 238 /*Save lock file name for later: */239 this->parameters->AddObject(new StringParam(LockFileNameEnum,lockfilename));240 241 }242 254 /*}}}*/ 243 255 void FemModel::SetStaticComm(void){/*{{{*/ … … 348 360 } 349 361 /*}}}*/ 362 FemModel* FemModel::copy(void){/*{{{*/ 363 364 FemModel* output=NULL; 365 int i; 366 int analysis_type; 367 368 output=new FemModel(*this); //Use default copy constructor. 369 370 output->comm = this->comm; 371 output->nummodels = this->nummodels; 372 output->solution_type = this->solution_type; 373 output->analysis_counter = this->analysis_counter; 374 375 /*Now, deep copy arrays: */ 376 output->analysis_type_list=xNew<int>(nummodels); 377 xMemCpy<int>(output->analysis_type_list,this->analysis_type_list,this->nummodels); 378 379 output->profiler=static_cast<Profiler*>(this->profiler->copy()); 380 381 output->loads=static_cast<Loads*>(this->loads->Copy()); 382 output->materials=static_cast<Materials*>(this->materials->Copy()); 383 output->parameters=static_cast<Parameters*>(this->parameters->Copy()); 384 output->constraints=static_cast<Constraints*>(this->constraints->Copy()); 385 output->results=static_cast<Results*>(this->results->Copy()); 386 387 output->nodes=static_cast<Nodes*>(this->nodes->Copy()); 388 output->vertices=static_cast<Vertices*>(this->vertices->Copy()); 389 output->elements=static_cast<Elements*>(this->elements->Copy()); 390 391 /*reset hooks for elements, loads and nodes: */ 392 output->elements->ResetHooks(); 393 output->loads->ResetHooks(); 394 output->materials->ResetHooks(); 395 396 /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ 397 for(i=0;i<nummodels;i++){ 398 analysis_type=output->analysis_type_list[i]; 399 output->SetCurrentConfiguration(analysis_type); 400 if(i==0) VerticesDofx(output->vertices,output->parameters); //only call once, we only have one set of vertices 401 SpcNodesx(output->nodes,output->constraints,output->parameters,analysis_type); 402 NodesDofx(output->nodes,output->parameters,analysis_type); 403 ConfigureObjectsx(output->elements,output->loads,output->nodes,output->vertices,output->materials,output->parameters); 404 } 405 406 return output; 407 } 408 /*}}}*/ 409 350 410 /*Modules:*/ 351 411 int FemModel::UpdateVertexPositionsx(void){ /*{{{*/ -
issm/trunk-jpl/src/c/classes/FemModel.h
r18003 r18237 52 52 /*Methods:*/ 53 53 void Echo(); 54 FemModel* copy(); 54 55 void InitFromFiles(char* rootpath, char* inputfilename, char* outputfilename, char* petscfilename, char* lockfilename, const int solution_type,const int* analyses,const int nummodels); 56 void CleanUp(void); 55 57 void Solve(void); 56 58 void SetStaticComm(); -
issm/trunk-jpl/src/c/classes/Hook.cpp
r18064 r18237 29 29 30 30 /*Get out if num=0*/ 31 if ( num==0){31 if (this->num<=0){ 32 32 /*Empty hook*/ 33 33 this->ids = NULL; 34 34 this->objects = NULL; 35 35 this->offsets = NULL; 36 this->num = 0; 36 37 } 37 38 else{ 38 39 /*Allocate: */ 39 this->objects=xNew<Object*>( this->num);40 this->ids=xNew<int>( this->num);41 this->offsets=xNew<int>( this->num);40 this->objects=xNew<Object*>(in_num); 41 this->ids=xNew<int>(in_num); 42 this->offsets=xNew<int>(in_num); 42 43 43 44 /*Copy ids: */ … … 109 110 110 111 /*initalize output: */ 111 output=new Hook(); 112 113 /*copy in the fields: */ 114 output->num=this->num; 115 if(output->num){ 116 output->objects = xNew<Object*>(output->num); 117 output->ids = xNew<int>(output->num); 118 output->offsets = xNew<int>(output->num); 119 } 112 output=new Hook(this->ids,this->num); 120 113 121 114 for(int i=0;i<output->num;i++){ 122 115 output->objects[i] = this->objects[i]; 123 116 output->offsets[i] = this->offsets[i]; 124 output->ids[i] = this->ids[i];125 117 } 126 118 … … 130 122 131 123 /*Hook management: */ 124 void Hook::reset(){/*{{{*/ 125 126 /*intermediary: */ 127 Object* object=NULL; 128 int i; 129 130 for(i=0;i<this->num;i++){ 131 this->objects[i]=NULL; //reset this node. 132 } 133 } 134 /*}}}*/ 132 135 void Hook::configure(DataSet* dataset){/*{{{*/ 133 136 … … 161 164 else this->offsets[i]=UNDEF; //object offset was wrong, reset it. 162 165 } 166 else this->offsets[i]=UNDEF; 163 167 164 168 /*Now, for this->objects that did not get resolved, and for which we have no offset, chase them in the dataset, by id: */ … … 174 178 175 179 /*first, check that we only have one T object in our object list: */ 176 if (this->num!=1) _error_("trying to deliver ya single hook object when hook holds " << this->num << " objects" << "\n");180 if (this->num!=1) _error_("trying to deliver a single hook object when hook holds " << this->num << " objects" << "\n"); 177 181 178 182 /*check NULL: */ -
issm/trunk-jpl/src/c/classes/Hook.h
r16233 r18237 39 39 Object** deliverp(void); //deliver all objects 40 40 void configure(DataSet* dataset); 41 void reset(void); 41 42 Hook* Spawn(int* indices, int numindices); 42 43 int* Ids(void); -
issm/trunk-jpl/src/c/classes/Inputs/DatasetInput.cpp
r18064 r18237 65 65 output = new DatasetInput(); 66 66 output->enum_type=this->enum_type; 67 output->inputs=(Inputs*)this->inputs->Copy(); 67 output->numids=this->numids; 68 output->ids=xNew<int>(output->numids); 69 xMemCpy(output->ids,this->ids,output->numids); 70 output->inputs=static_cast<Inputs*>(this->inputs->Copy()); 68 71 69 return output;72 return (Object*)output; 70 73 } 71 74 /*}}}*/ … … 152 155 /*Get requested input within dataset*/ 153 156 for(int i=0;i<this->numids;i++) if(this->ids[i]==id) offset=i; 154 if(offset<0) _error_("Could not find input of id "<<id );157 if(offset<0) _error_("Could not find input of id "<<id ); 155 158 156 159 Input* input=dynamic_cast<Input*>(this->inputs->GetObjectByOffset(offset)); -
issm/trunk-jpl/src/c/classes/Inputs/PentaInput.cpp
r18078 r18237 20 20 21 21 /*Set Enum*/ 22 enum_type=in_enum_type;22 this->enum_type=in_enum_type; 23 23 this->interpolation_type=interpolation_type_in; 24 24 25 int numnodes = this->NumberofNodes(this->interpolation_type); 26 25 27 /*Set values*/ 26 this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type)); 27 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 28 if (numnodes > 0){ 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 31 } 32 else{ 33 this->values = NULL; 34 } 35 28 36 } 29 37 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/TetraInput.cpp
r18078 r18237 20 20 21 21 /*Set Enum*/ 22 enum_type=in_enum_type;22 this->enum_type=in_enum_type; 23 23 this->interpolation_type=interpolation_type_in; 24 24 25 int numnodes = this->NumberofNodes(this->interpolation_type); 26 25 27 /*Set values*/ 26 this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type)); 27 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 28 if (numnodes > 0){ 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 31 } 32 else{ 33 this->values = NULL; 34 } 35 28 36 } 29 37 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Inputs/TransientInput.cpp
r18064 r18237 80 80 } 81 81 /*}}}*/ 82 int 83 /*}}}*/ 84 int TransientInput::ObjectEnum(void){/*{{{*/82 int TransientInput::Id(void){ return -1; }/*{{{*/ 83 /*}}}*/ 84 int TransientInput::ObjectEnum(void){/*{{{*/ 85 85 86 86 return TransientInputEnum; … … 96 96 output->numtimesteps=this->numtimesteps; 97 97 output->timesteps=xNew<IssmDouble>(this->numtimesteps); 98 99 output->inputs= (Inputs*)this->inputs->Copy();98 xMemCpy(output->timesteps,this->timesteps,this->numtimesteps); 99 output->inputs=static_cast<Inputs*>(this->inputs->Copy()); 100 100 output->parameters=this->parameters; 101 101 102 return output;102 return (Object*)output; 103 103 104 104 } … … 315 315 } 316 316 /*}}}*/ 317 int TransientInput::GetResultInterpolation(void){/*{{{*/317 int TransientInput::GetResultInterpolation(void){/*{{{*/ 318 318 319 319 IssmDouble time; … … 330 330 } 331 331 /*}}}*/ 332 int TransientInput::GetResultNumberOfNodes(void){/*{{{*/332 int TransientInput::GetResultNumberOfNodes(void){/*{{{*/ 333 333 334 334 IssmDouble time; -
issm/trunk-jpl/src/c/classes/Inputs/TriaInput.cpp
r18078 r18237 20 20 21 21 /*Set Enum*/ 22 enum_type=in_enum_type;22 this->enum_type=in_enum_type; 23 23 this->interpolation_type=interpolation_type_in; 24 24 25 int numnodes = this->NumberofNodes(this->interpolation_type); 26 25 27 /*Set values*/ 26 this->values=xNew<IssmDouble>(this->NumberofNodes(this->interpolation_type)); 27 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 28 if (numnodes > 0){ 29 this->values=xNew<IssmDouble>((unsigned int)numnodes); 30 for(int i=0;i<this->NumberofNodes(this->interpolation_type);i++) values[i]=in_values[i]; 31 } 32 else{ 33 this->values = NULL; 34 } 28 35 } 29 36 /*}}}*/ … … 45 52 } 46 53 /*}}}*/ 47 int 48 /*}}}*/ 49 int TriaInput::ObjectEnum(void){/*{{{*/54 int TriaInput::Id(void){ return -1; }/*{{{*/ 55 /*}}}*/ 56 int TriaInput::ObjectEnum(void){/*{{{*/ 50 57 51 58 return TriaInputEnum; -
issm/trunk-jpl/src/c/classes/Loads/Load.h
r17266 r18237 26 26 virtual ~Load(){}; 27 27 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0; 28 virtual void ResetHooks()=0; 28 29 virtual bool IsPenalty(void)=0; 29 30 virtual int GetNumberOfNodes(void)=0; -
issm/trunk-jpl/src/c/classes/Loads/Loads.cpp
r18064 r18237 43 43 load=dynamic_cast<Load*>(*object); 44 44 load->Configure(elements,loads,nodes,vertices,materials,parameters); 45 46 } 47 48 } 49 /*}}}*/ 50 void Loads::ResetHooks(){/*{{{*/ 51 52 vector<Object*>::iterator object; 53 Load* load=NULL; 54 55 for ( object=objects.begin() ; object < objects.end(); object++ ){ 56 57 load=dynamic_cast<Load*>((*object)); 58 load->ResetHooks(); 45 59 46 60 } -
issm/trunk-jpl/src/c/classes/Loads/Loads.h
r15067 r18237 24 24 /*numerics*/ 25 25 void Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 26 void ResetHooks(); 26 27 bool IsPenalty(int analysis); 27 28 int MaxNumNodes(int analysis); -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.cpp
r18078 r18237 158 158 } 159 159 /*}}}*/ 160 int 160 int Numericalflux::Id(void){/*{{{*/ 161 161 return id; 162 162 } … … 215 215 /*}}}*/ 216 216 void Numericalflux::SetCurrentConfiguration(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/ 217 218 } 219 /*}}}*/ 220 void Numericalflux::ResetHooks(){/*{{{*/ 221 222 this->nodes=NULL; 223 this->vertices=NULL; 224 this->element=NULL; 225 this->parameters=NULL; 226 227 /*Get Element type*/ 228 this->hnodes->reset(); 229 this->hvertices->reset(); 230 this->helement->reset(); 217 231 218 232 } … … 277 291 } 278 292 /*}}}*/ 279 void Numericalflux::GetNodesSidList(int* sidlist){/*{{{*/293 void Numericalflux::GetNodesSidList(int* sidlist){/*{{{*/ 280 294 281 295 _assert_(sidlist); … … 294 308 } 295 309 /*}}}*/ 296 void Numericalflux::GetNodesLidList(int* lidlist){/*{{{*/310 void Numericalflux::GetNodesLidList(int* lidlist){/*{{{*/ 297 311 298 312 _assert_(lidlist); … … 311 325 } 312 326 /*}}}*/ 313 int Numericalflux::GetNumberOfNodes(void){/*{{{*/327 int Numericalflux::GetNumberOfNodes(void){/*{{{*/ 314 328 315 329 switch(this->flux_type){ … … 324 338 } 325 339 /*}}}*/ 326 bool Numericalflux::IsPenalty(void){/*{{{*/340 bool Numericalflux::IsPenalty(void){/*{{{*/ 327 341 return false; 328 342 } … … 342 356 } 343 357 /*}}}*/ 344 bool Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/358 bool Numericalflux::InAnalysis(int in_analysis_type){/*{{{*/ 345 359 if (in_analysis_type==this->analysis_type) return true; 346 360 else return false; 347 361 } 348 362 /*}}}*/ 349 void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/363 void Numericalflux::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/ 350 364 351 365 /*Output */ -
issm/trunk-jpl/src/c/classes/Loads/Numericalflux.h
r17269 r18237 58 58 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 59 59 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 60 void ResetHooks(); 60 61 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); 61 62 void CreatePVector(Vector<IssmDouble>* pf); -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.cpp
r18064 r18237 160 160 } 161 161 /*}}}*/ 162 void Pengrid::ResetHooks(){/*{{{*/ 163 164 this->node=NULL; 165 this->element=NULL; 166 this->matpar=NULL; 167 this->parameters=NULL; 168 169 /*Get Element type*/ 170 this->hnode->reset(); 171 this->helement->reset(); 172 this->hmatpar->reset(); 173 174 } 175 /*}}}*/ 162 176 void Pengrid::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/ 163 177 … … 189 203 } 190 204 /*}}}*/ 191 void Pengrid::GetNodesSidList(int* sidlist){/*{{{*/205 void Pengrid::GetNodesSidList(int* sidlist){/*{{{*/ 192 206 193 207 _assert_(sidlist); … … 197 211 } 198 212 /*}}}*/ 199 void Pengrid::GetNodesLidList(int* lidlist){/*{{{*/213 void Pengrid::GetNodesLidList(int* lidlist){/*{{{*/ 200 214 201 215 _assert_(lidlist); … … 205 219 } 206 220 /*}}}*/ 207 int Pengrid::GetNumberOfNodes(void){/*{{{*/221 int Pengrid::GetNumberOfNodes(void){/*{{{*/ 208 222 209 223 return NUMVERTICES; … … 268 282 } 269 283 /*}}}*/ 270 bool Pengrid::InAnalysis(int in_analysis_type){/*{{{*/284 bool Pengrid::InAnalysis(int in_analysis_type){/*{{{*/ 271 285 if (in_analysis_type==this->analysis_type)return true; 272 286 else return false; 273 287 } 274 288 /*}}}*/ 275 bool Pengrid::IsPenalty(void){/*{{{*/289 bool Pengrid::IsPenalty(void){/*{{{*/ 276 290 return true; 277 291 } 278 292 /*}}}*/ 279 void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/293 void Pengrid::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/ 280 294 281 295 /*Output */ -
issm/trunk-jpl/src/c/classes/Loads/Pengrid.h
r17516 r18237 68 68 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 69 69 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 70 void ResetHooks(); 70 71 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); 71 72 void CreatePVector(Vector<IssmDouble>* pf); -
issm/trunk-jpl/src/c/classes/Loads/Penpair.cpp
r18064 r18237 65 65 } 66 66 /*}}}*/ 67 int 68 /*}}}*/ 69 int Penpair::ObjectEnum(void){/*{{{*/67 int Penpair::Id(void){ return id; }/*{{{*/ 68 /*}}}*/ 69 int Penpair::ObjectEnum(void){/*{{{*/ 70 70 71 71 return PenpairEnum; … … 113 113 } 114 114 /*}}}*/ 115 void Penpair::ResetHooks(){/*{{{*/ 116 117 this->nodes=NULL; 118 this->parameters=NULL; 119 120 /*Get Element type*/ 121 this->hnodes->reset(); 122 123 } 124 /*}}}*/ 115 125 void Penpair::CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs){/*{{{*/ 116 126 /*If you code this piece, don't forget that a penalty will be inactive if it is dealing with clone nodes*/ … … 131 141 } 132 142 /*}}}*/ 133 void Penpair::GetNodesSidList(int* sidlist){/*{{{*/143 void Penpair::GetNodesSidList(int* sidlist){/*{{{*/ 134 144 135 145 _assert_(sidlist); … … 139 149 } 140 150 /*}}}*/ 141 void Penpair::GetNodesLidList(int* lidlist){/*{{{*/151 void Penpair::GetNodesLidList(int* lidlist){/*{{{*/ 142 152 143 153 _assert_(lidlist); … … 147 157 } 148 158 /*}}}*/ 149 int Penpair::GetNumberOfNodes(void){/*{{{*/159 int Penpair::GetNumberOfNodes(void){/*{{{*/ 150 160 151 161 return NUMVERTICES; 152 162 } 153 163 /*}}}*/ 154 bool Penpair::IsPenalty(void){/*{{{*/164 bool Penpair::IsPenalty(void){/*{{{*/ 155 165 return true; 156 166 } … … 190 200 } 191 201 /*}}}*/ 192 bool Penpair::InAnalysis(int in_analysis_type){/*{{{*/202 bool Penpair::InAnalysis(int in_analysis_type){/*{{{*/ 193 203 if (in_analysis_type==this->analysis_type)return true; 194 204 else return false; 195 205 } 196 206 /*}}}*/ 197 void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/207 void Penpair::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/ 198 208 199 209 /*Output */ -
issm/trunk-jpl/src/c/classes/Loads/Penpair.h
r16783 r18237 48 48 /*Load virtual functions definitions: {{{*/ 49 49 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 50 void ResetHooks(); 50 51 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 51 52 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
r18064 r18237 208 208 } 209 209 /*}}}*/ 210 void 210 void Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/ 211 211 212 212 _error_("not implemented yet"); … … 216 216 217 217 /*Load virtual functions definitions:*/ 218 void Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/ 218 void Riftfront::Configure(Elements* elementsin,Loads* loadsin,Nodes* nodesin,Vertices* verticesin,Materials* materialsin,Parameters* parametersin){/*{{{*/ 219 219 220 220 /*Take care of hooking up all objects for this element, ie links the objects in the hooks to their respective … … 234 234 } 235 235 /*}}}*/ 236 bool Riftfront::IsPenalty(void){/*{{{*/ 236 void Riftfront::ResetHooks(){/*{{{*/ 237 238 this->nodes=NULL; 239 this->elements=NULL; 240 this->matpar=NULL; 241 this->parameters=NULL; 242 243 /*Get Element type*/ 244 this->hnodes->reset(); 245 this->helements->reset(); 246 this->hmatpar->reset(); 247 248 } 249 /*}}}*/ 250 bool Riftfront::IsPenalty(void){/*{{{*/ 237 251 return true; 238 252 } … … 302 316 } 303 317 /*}}}*/ 304 void Riftfront::GetNodesSidList(int* sidlist){/*{{{*/318 void Riftfront::GetNodesSidList(int* sidlist){/*{{{*/ 305 319 306 320 _assert_(sidlist); … … 310 324 } 311 325 /*}}}*/ 312 void Riftfront::GetNodesLidList(int* lidlist){/*{{{*/326 void Riftfront::GetNodesLidList(int* lidlist){/*{{{*/ 313 327 314 328 _assert_(lidlist); … … 318 332 } 319 333 /*}}}*/ 320 int Riftfront::GetNumberOfNodes(void){/*{{{*/334 int Riftfront::GetNumberOfNodes(void){/*{{{*/ 321 335 322 336 return NUMVERTICES; 323 337 } 324 338 /*}}}*/ 325 bool Riftfront::InAnalysis(int in_analysis_type){/*{{{*/339 bool Riftfront::InAnalysis(int in_analysis_type){/*{{{*/ 326 340 if (in_analysis_type==this->analysis_type) return true; 327 341 else return false; 328 342 } 329 343 /*}}}*/ 330 void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/344 void Riftfront::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum){/*{{{*/ 331 345 332 346 /*Output */ … … 556 570 /*}}}*/ 557 571 #define _ZIGZAGCOUNTER_ 558 int Riftfront::Constrain(int* punstable){/*{{{*/572 int Riftfront::Constrain(int* punstable){/*{{{*/ 559 573 560 574 IssmDouble penetration; -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.h
r17269 r18237 74 74 /*Load virtual functions definitions: {{{*/ 75 75 void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 76 void ResetHooks(); 76 77 void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters); 77 78 void CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs); -
issm/trunk-jpl/src/c/classes/Materials/Material.h
r18060 r18237 41 41 virtual IssmDouble GetDbar()=0; 42 42 virtual bool IsDamage()=0; 43 virtual void ResetHooks()=0; 43 44 44 45 }; -
issm/trunk-jpl/src/c/classes/Materials/Materials.cpp
r18064 r18237 44 44 } 45 45 /*}}}*/ 46 void Materials::ResetHooks(){/*{{{*/ 47 48 vector<Object*>::iterator object; 49 Material* material=NULL; 50 51 for ( object=objects.begin() ; object < objects.end(); object++ ){ 52 53 material=dynamic_cast<Material*>((*object)); 54 material->ResetHooks(); 55 56 } 57 58 } 59 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Materials.h
r17275 r18237 24 24 /*numerics*/ 25 25 void Configure(Elements* elements,Loads* loads, Nodes* nodes, Vertices* vertices, Materials* materials,Parameters* parameters); 26 void ResetHooks(); 26 27 27 28 }; -
issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
r18064 r18237 567 567 } 568 568 /*}}}*/ 569 void Matice::ResetHooks(){/*{{{*/ 570 571 this->element=NULL; 572 573 /*Get Element type*/ 574 this->helement->reset(); 575 576 } 577 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Matice.h
r18060 r18237 41 41 Object* copy(); 42 42 /*}}}*/ 43 /*Update virtual fun ctions definitions: {{{*/43 /*Update virtual funictions definitions: {{{*/ 44 44 void InputUpdateFromVector(IssmDouble* vector, int name, int type); 45 45 void InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrow, int ncols, int name, int type); … … 70 70 IssmDouble GetN(); 71 71 bool IsDamage(); 72 void ResetHooks(); 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp
r18064 r18237 135 135 /*}}}*/ 136 136 Object* Matpar::copy() {/*{{{*/ 137 return new Matpar(*this); 137 138 /*Output*/ 139 Matpar* matpar; 140 141 /*Initialize output*/ 142 matpar=new Matpar(*this); 143 144 /*copy fields: */ 145 matpar->mid=this->mid; 146 matpar->rho_ice=this->rho_ice; 147 matpar->rho_water=this->rho_water; 148 matpar->rho_freshwater=this->rho_freshwater; 149 matpar->mu_water=this->mu_water; 150 matpar->heatcapacity=this->heatcapacity; 151 matpar->thermalconductivity=this->thermalconductivity; 152 matpar->temperateiceconductivity=this->temperateiceconductivity; 153 matpar->latentheat=this->latentheat; 154 matpar->beta=this->beta; 155 matpar->meltingpoint=this->meltingpoint; 156 matpar->referencetemperature=this->referencetemperature; 157 matpar->mixed_layer_capacity=this->mixed_layer_capacity; 158 matpar->thermal_exchange_velocity=this->thermal_exchange_velocity; 159 matpar->g=this->g; 160 matpar->desfac=this->desfac; 161 matpar->s0p=this->s0p; 162 163 matpar->sediment_compressibility=this->sediment_compressibility; 164 matpar->sediment_porosity=this->sediment_porosity; 165 matpar->sediment_thickness=this->sediment_thickness; 166 matpar->water_compressibility=this->water_compressibility; 167 168 matpar->epl_compressibility=this->epl_compressibility; 169 matpar->epl_porosity=this->epl_porosity; 170 matpar->epl_init_thickness=this->epl_init_thickness; 171 matpar->epl_max_thickness=this->epl_max_thickness; 172 matpar->epl_conductivity=this->epl_conductivity; 173 174 matpar->lithosphere_shear_modulus=this->lithosphere_shear_modulus; 175 matpar->lithosphere_density=this->lithosphere_density; 176 matpar->mantle_shear_modulus=this->mantle_shear_modulus; 177 matpar->mantle_density=this->mantle_density; 178 179 return matpar; 138 180 } 139 181 /*}}}*/ … … 401 443 } 402 444 /*}}}*/ 445 void Matpar::ResetHooks(){/*{{{*/ 446 447 //Nothing to be done 448 return; 449 } 450 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Materials/Matpar.h
r18060 r18237 91 91 IssmDouble GetDbar(){_error_("not supported");}; 92 92 bool IsDamage(){_error_("not supported");}; 93 void ResetHooks(); 93 94 /*}}}*/ 94 95 /*Numerics: {{{*/ -
issm/trunk-jpl/src/c/classes/Misfit.h
r18064 r18237 88 88 /*}}}*/ 89 89 Object* copy() {/*{{{*/ 90 return new Misfit(this->name,this->model_enum,this->observation_enum,this->timeinterpolation,this->weights_enum); 90 Misfit* mf = new Misfit(this->name,this->model_enum,this->observation_enum,this->timeinterpolation,this->weights_enum); 91 mf->misfit=this->misfit; 92 mf->lock=this->lock; 93 return (Object*) mf; 91 94 } 92 95 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Node.cpp
r18064 r18237 125 125 } 126 126 /*}}}*/ 127 Object* Node::copy(void){/*{{{*/ 128 129 int k,l; 130 131 /*output: */ 132 Node* output=NULL; 133 134 /*initalize output: */ 135 output=new Node(); 136 137 /*id: */ 138 output->id = this->id; 139 output->sid = this->sid; 140 output->lid = this->lid; 141 output->analysis_enum = this->analysis_enum; 142 output->approximation = this->approximation; 143 144 /*Initialize coord_system: */ 145 for(k=0;k<3;k++) for(l=0;l<3;l++) output->coord_system[k][l]=this->coord_system[k][l]; 146 147 /*indexing:*/ 148 output->indexingupdate = this->indexingupdate; 149 output->indexing.copy(this->indexing); 150 151 return (Object*)output; 152 } 153 /*}}}*/ 127 154 128 155 /*Object virtual functions definitions:*/ … … 514 541 else if (setenum==SsetEnum){ 515 542 if(this->indexing.doftype){ 516 543 numdofs=0; 517 544 for(i=0;i<this->indexing.gsize;i++){ 518 545 if((this->indexing.doftype[i]==approximation_enum) && (this->indexing.s_set[i])) numdofs++; -
issm/trunk-jpl/src/c/classes/Node.h
r17255 r18237 49 49 int Id(); 50 50 int ObjectEnum(); 51 Object *copy() {_error_("Not implemented yet (similar to Elements)"); };51 Object *copy(); 52 52 53 53 /*Node numerical routines*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleParam.cpp
r18064 r18237 38 38 } 39 39 /*}}}*/ 40 int 40 int DoubleParam::Id(void){ return -1; }/*{{{*/ 41 41 /*}}}*/ 42 int DoubleParam::ObjectEnum(void){/*{{{*/42 int DoubleParam::ObjectEnum(void){/*{{{*/ 43 43 44 44 return DoubleParamEnum; -
issm/trunk-jpl/src/c/classes/Params/Parameters.cpp
r18064 r18237 108 108 } 109 109 } 110 _error_("could not find parameter " << EnumToStringx(enum_type));110 _error_("could not find parameter " << EnumToStringx(enum_type)); 111 111 } 112 112 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Profiler.cpp
r18063 r18237 29 29 } 30 30 /*}}}*/ 31 Object* Profiler::copy(){/*{{{*/ 32 /*First do simple copy: */ 33 Profiler* output=new Profiler(); 34 delete output->time; 35 delete output->flops; 36 delete output->memory; 37 38 /*Now for deep copy: */ 39 output->time=(Parameters*)this->time->Copy(); 40 output->flops=(Parameters*)this->flops->Copy(); 41 output->memory=(Parameters*)this->memory->Copy(); 42 43 return (Object*)output; 44 } 45 /*}}}*/ 31 46 32 47 /*Object virtual functions definitions:*/ … … 47 62 } 48 63 /*}}}*/ 49 int 64 int Profiler::Id(void){ return -1; }/*{{{*/ 50 65 /*}}}*/ 51 int Profiler::ObjectEnum(void){/*{{{*/66 int Profiler::ObjectEnum(void){/*{{{*/ 52 67 53 68 return ProfilerEnum; -
issm/trunk-jpl/src/c/classes/Profiler.h
r15067 r18237 42 42 int Id(); 43 43 int ObjectEnum(); 44 Object *copy() {_error_("Not implemented yet"); };44 Object *copy(); 45 45 /*}}}*/ 46 46 /*Profiler routines {{{*/ -
issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.cpp
r18064 r18237 49 49 } 50 50 /*}}}*/ 51 Object* ExponentialVariogram::copy(void){/*{{{*/ 52 return new ExponentialVariogram(*this); 53 } 54 /*}}}*/ 51 55 52 56 /*Variogram function*/ -
issm/trunk-jpl/src/c/classes/kriging/ExponentialVariogram.h
r13414 r18237 26 26 int Id(){_error_("Not implemented yet");}; 27 27 int ObjectEnum(){_error_("Not implemented yet");}; 28 Object* copy() {_error_("Not implemented yet");};28 Object* copy(); 29 29 30 30 /*Variogram functions*/ -
issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.cpp
r18064 r18237 49 49 } 50 50 /*}}}*/ 51 Object* GaussianVariogram::copy(void){/*{{{*/ 52 return new GaussianVariogram(*this); 53 } 54 /*}}}*/ 51 55 52 56 /*Variogram function*/ -
issm/trunk-jpl/src/c/classes/kriging/GaussianVariogram.h
r13414 r18237 27 27 int Id(){_error_("Not implemented yet");}; 28 28 int ObjectEnum(){_error_("Not implemented yet");}; 29 Object* copy() {_error_("Not implemented yet");};29 Object* copy(); 30 30 31 31 /*Variogram functions*/ -
issm/trunk-jpl/src/c/classes/kriging/Observation.cpp
r18064 r18237 41 41 } 42 42 /*}}}*/ 43 Object* Observation::copy(void){/*{{{*/ 44 45 Observation* observation = new Observation(this->x,this->y,this->xi,this->yi,this->index,this->value); 46 47 observation->weight = this->weight; 48 49 return (Object*) observation; 50 51 } 52 /*}}}*/ 43 53 44 54 /*Observations functions*/ -
issm/trunk-jpl/src/c/classes/kriging/Observation.h
r15067 r18237 27 27 int Id() {_error_("Not implemented yet"); }; 28 28 int ObjectEnum(){_error_("Not implemented yet"); }; 29 Object *copy() {_error_("Not implemented yet"); };29 Object *copy(); 30 30 31 31 /*Management*/ -
issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.cpp
r18064 r18237 50 50 } 51 51 /*}}}*/ 52 Object* PowerVariogram::copy(void){/*{{{*/ 53 return new PowerVariogram(*this); 54 } 55 /*}}}*/ 52 56 53 57 /*Variogram function*/ -
issm/trunk-jpl/src/c/classes/kriging/PowerVariogram.h
r13414 r18237 26 26 int Id(){_error_("Not implemented yet");}; 27 27 int ObjectEnum(){_error_("Not implemented yet");}; 28 Object* copy() {_error_("Not implemented yet");};28 Object* copy(); 29 29 30 30 /*Variogram functions*/ -
issm/trunk-jpl/src/c/classes/kriging/Quadtree.cpp
r18064 r18237 498 498 499 499 }/*}}}*/ 500 Object* Quadtree::QuadtreeBox::copy(void){/*{{{*/ 501 502 QuadtreeBox* qtreebox = new QuadtreeBox(*this); 503 504 if (this->box){ 505 for (int i=0; i<4; ++i){ 506 if(this->box[i]) qtreebox->box[i] = reinterpret_cast<QuadtreeBox*>(this->box[i]->copy()); 507 else qtreebox->box[i] = NULL; 508 } 509 } 510 if (this->obs){ 511 for (int i=0; i<4; ++i){ 512 if(this->obs[i]) qtreebox->obs[i] = reinterpret_cast<Observation*>(this->obs[i]->copy()); 513 else qtreebox->obs[i] = NULL; 514 } 515 } 516 517 return (Object*) qtreebox; 518 } 519 /*}}}*/ 500 520 int Quadtree::QuadtreeBox::IsWithinRange(double x,double y,double range){/*{{{*/ 501 521 -
issm/trunk-jpl/src/c/classes/kriging/Quadtree.h
r13414 r18237 30 30 int Id() {_error_("not implemented yet"); }; 31 31 int ObjectEnum(){_error_("not implemented yet"); }; 32 Object *copy() {_error_("not implemented yet"); };32 Object *copy(); 33 33 34 34 /*Methods*/ -
issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.cpp
r18064 r18237 49 49 } 50 50 /*}}}*/ 51 Object* SphericalVariogram::copy(void){/*{{{*/ 52 return new SphericalVariogram(*this); 53 } 54 /*}}}*/ 51 55 52 56 /*Variogram function*/ -
issm/trunk-jpl/src/c/classes/kriging/SphericalVariogram.h
r13414 r18237 26 26 int Id(){_error_("Not implemented yet");}; 27 27 int ObjectEnum(){_error_("Not implemented yet");}; 28 Object* copy() {_error_("Not implemented yet");};28 Object* copy(); 29 29 30 30 /*Variogram functions*/ -
issm/trunk-jpl/src/c/cores/DakotaSpawnCore.cpp
r16518 r18237 51 51 if(counter==-1)return 0; 52 52 53 /*cast void_femmodel to FemModel: */ 54 femmodel=reinterpret_cast<FemModel*>(void_femmodel); 53 /*cast void_femmodel to FemModel, and at the same time, make a copy, so we start this new core run for this specific sample 54 *with a brand new copy of the model, which has not been tempered with by previous dakota runs: */ 55 femmodel=(reinterpret_cast<FemModel*>(void_femmodel))->copy(); 55 56 56 57 /*retrieve parameters: */ … … 80 81 /*Free ressources:*/ 81 82 DakotaFree(&d_variables,&d_variables_descriptors,&responses_descriptors, d_numvariables, numresponsedescriptors); 83 84 /*Avoid leaks here: */ 85 delete femmodel; 82 86 83 87 return 1; //this is critical! do not return 0, otherwise, dakota_core will stop running! -
issm/trunk-jpl/src/c/cores/damage_core.cpp
r17391 r18237 22 22 //first recover parameters common to all solutions 23 23 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 24 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);25 24 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 26 25 femmodel->parameters->FindParam(&numoutputs,DamageEvolutionNumRequestedOutputsEnum); 27 26 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,DamageEvolutionRequestedOutputsEnum); 28 29 if(dakota_analysis && solution_type!=TransientSolutionEnum){30 femmodel->SetCurrentConfiguration(DamageEvolutionAnalysisEnum);31 ResetConstraintsx(femmodel);32 }33 27 34 28 if(VerboseSolution()) _printf0_(" computing damage\n"); -
issm/trunk-jpl/src/c/cores/masstransport_core.cpp
r17924 r18237 26 26 femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum); 27 27 femmodel->parameters->FindParam(&isfreesurface,MasstransportIsfreesurfaceEnum); 28 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);29 28 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 30 29 femmodel->parameters->FindParam(&domaintype,DomainTypeEnum); 31 30 femmodel->parameters->FindParam(&numoutputs,MasstransportNumRequestedOutputsEnum); 32 31 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,MasstransportRequestedOutputsEnum); 33 34 /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/35 if(dakota_analysis && solution_type==MasstransportSolutionEnum){36 InputDuplicatex(femmodel,QmuSurfaceEnum,SurfaceEnum);37 InputDuplicatex(femmodel,QmuThicknessEnum,ThicknessEnum);38 InputDuplicatex(femmodel,QmuBaseEnum,BaseEnum);39 }40 32 41 33 /*Calculate new Surface Mass Balance (SMB)*/ -
issm/trunk-jpl/src/c/cores/stressbalance_core.cpp
r17700 r18237 30 30 femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum); 31 31 femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum); 32 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);33 32 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 34 33 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 35 34 femmodel->parameters->FindParam(&numoutputs,StressbalanceNumRequestedOutputsEnum); 36 35 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,StressbalanceRequestedOutputsEnum); 37 38 /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/39 if(dakota_analysis && solution_type==StressbalanceSolutionEnum){40 InputDuplicatex(femmodel,QmuVxEnum,VxEnum);41 InputDuplicatex(femmodel,QmuVyEnum,VyEnum);42 if(domaintype==Domain3DEnum) InputDuplicatex(femmodel,QmuVzEnum,VzEnum);43 if(isFS) InputDuplicatex(femmodel,QmuPressureEnum,PressureEnum);44 }45 36 46 37 /*Compute slopes if necessary */ -
issm/trunk-jpl/src/c/cores/thermal_core.cpp
r18068 r18237 22 22 /*first recover parameters common to all solutions*/ 23 23 femmodel->parameters->FindParam(&save_results,SaveResultsEnum); 24 femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);25 24 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 26 25 femmodel->parameters->FindParam(&isenthalpy,ThermalIsenthalpyEnum); 27 26 femmodel->parameters->FindParam(&numoutputs,ThermalNumRequestedOutputsEnum); 28 27 if(numoutputs) femmodel->parameters->FindParam(&requested_outputs,&numoutputs,ThermalRequestedOutputsEnum); 29 30 if(dakota_analysis && solution_type!=TransientSolutionEnum){31 InputDuplicatex(femmodel,QmuVxMeshEnum,VxMeshEnum);32 InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);33 InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);34 InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);35 InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);36 InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);37 femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);38 ResetConstraintsx(femmodel);39 }40 28 41 29 if(isenthalpy){ -
issm/trunk-jpl/src/c/cores/transient_core.cpp
r18094 r18237 60 60 step=0; 61 61 time=starttime; 62 63 /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/64 if(dakota_analysis){65 if(isstressbalance){66 InputDuplicatex(femmodel,QmuVxEnum,VxEnum);67 InputDuplicatex(femmodel,QmuVyEnum,VyEnum);68 if(domaintype==Domain3DEnum){69 InputDuplicatex(femmodel,QmuVzEnum,VzEnum);70 if(isFS)InputDuplicatex(femmodel,QmuPressureEnum,PressureEnum);71 }72 }73 if(ismasstransport || isgroundingline){74 InputDuplicatex(femmodel,QmuThicknessEnum,ThicknessEnum);75 InputDuplicatex(femmodel,QmuSurfaceEnum,SurfaceEnum);76 InputDuplicatex(femmodel,QmuBaseEnum,BaseEnum);77 InputDuplicatex(femmodel,QmuMaskIceLevelsetEnum,MaskIceLevelsetEnum);78 }79 if(isgroundingline) InputDuplicatex(femmodel,QmuMaskGroundediceLevelsetEnum,MaskGroundediceLevelsetEnum);80 if(isthermal && domaintype==Domain3DEnum){81 //Update Vertex Position after updating Thickness and Bed82 femmodel->SetCurrentConfiguration(MasstransportAnalysisEnum);83 femmodel->UpdateVertexPositionsx();84 InputDuplicatex(femmodel,QmuVxMeshEnum,VxMeshEnum);85 InputDuplicatex(femmodel,QmuVyMeshEnum,VyMeshEnum);86 InputDuplicatex(femmodel,QmuVzMeshEnum,VzMeshEnum);87 InputDuplicatex(femmodel,QmuTemperatureEnum,TemperatureEnum);88 InputDuplicatex(femmodel,QmuMeltingEnum,BasalforcingsGroundediceMeltingRateEnum);89 InputDuplicatex(femmodel,QmuMaterialsRheologyBEnum,MaterialsRheologyBEnum);90 //Reset Thermal Constraints91 femmodel->SetCurrentConfiguration(ThermalAnalysisEnum);92 ResetConstraintsx(femmodel);93 }94 }95 62 96 63 while(time < finaltime - (yts*DBL_EPSILON)){ //make sure we run up to finaltime. -
issm/trunk-jpl/src/c/datastructures/DataSet.cpp
r18063 r18237 27 27 28 28 sorted=0; 29 numsorted=0; 29 30 sorted_ids=NULL; 30 31 id_offsets=NULL; … … 41 42 } 42 43 /*}}}*/ 43 DataSet* 44 45 vector<Object*>::iterator obj ect;44 DataSet* DataSet::Copy(void){/*{{{*/ 45 46 vector<Object*>::iterator obj; 46 47 Object* object_copy=NULL; 47 48 48 DataSet* copy=new DataSet(enum_type); 49 50 copy->sorted=sorted; 51 copy->presorted=presorted; 52 if(sorted_ids){ 53 copy->sorted_ids=xNew<int>(objects.size()); 54 xMemCpy<int>(copy->sorted_ids,sorted_ids,objects.size()); 55 } 56 if(id_offsets){ 57 copy->id_offsets=xNew<int>(objects.size()); 58 xMemCpy<int>(copy->id_offsets,id_offsets,objects.size()); 59 } 49 DataSet* copy=new DataSet(this->enum_type); 50 51 copy->sorted=this->sorted; 52 copy->numsorted=this->numsorted; 53 copy->presorted=this->presorted; 60 54 61 55 /*Now we need to deep copy the objects: */ 62 for ( object=objects.begin() ; object < objects.end(); object++ ){ 63 64 /*Call echo on object: */ 65 object_copy = (*object)->copy(); 56 for ( obj=this->objects.begin() ; obj < this->objects.end(); obj++ ){ 57 /*Call copy on object: */ 58 object_copy = (*obj)->copy(); 66 59 copy->AddObject(object_copy); 67 60 } 61 62 /*Build id_offsets and sorted_ids*/ 63 int objsize = this->numsorted; 64 if(this->sorted && objsize>0 && this->id_offsets){ 65 /*Allocate new ids*/ 66 copy->id_offsets=xNew<int>(objsize); 67 xMemCpy<int>(copy->id_offsets,this->id_offsets,objsize); 68 } 69 else copy->id_offsets=NULL; 70 if(this->sorted && objsize>0 && this->sorted_ids){ 71 /*Allocate new ids*/ 72 copy->sorted_ids=xNew<int>(objsize); 73 xMemCpy<int>(copy->sorted_ids,this->sorted_ids,objsize); 74 } 75 else copy->sorted_ids=NULL; 76 68 77 return copy; 69 78 } … … 77 86 78 87 /*Specific methods*/ 79 int DataSet::AddObject(Object* object){/*{{{*/88 int DataSet::AddObject(Object* object){/*{{{*/ 80 89 81 90 _assert_(this); … … 102 111 } 103 112 /*}}}*/ 104 int DataSet::DeleteObject(Object* object){/*{{{*/113 int DataSet::DeleteObject(Object* object){/*{{{*/ 105 114 106 115 vector<Object*>::iterator iterator; … … 116 125 } 117 126 /*}}}*/ 118 void DataSet::DeepEcho(){/*{{{*/127 void DataSet::DeepEcho(){/*{{{*/ 119 128 120 129 vector<Object*>::iterator object; … … 132 141 } 133 142 /*}}}*/ 134 void DataSet::Echo(){/*{{{*/143 void DataSet::Echo(){/*{{{*/ 135 144 136 145 vector<Object*>::iterator object; … … 149 158 } 150 159 /*}}}*/ 151 int DataSet::GetEnum(){/*{{{*/160 int DataSet::GetEnum(){/*{{{*/ 152 161 return enum_type; 153 162 } … … 176 185 177 186 _assert_(this); 178 if(!sorted )_error_("trying to binary search on a non-sorted dataset!");187 if(!sorted || objects.size()>numsorted)_error_("trying to binary search on a non-sorted dataset!"); 179 188 180 189 /*Carry out a binary search on the sorted_ids: */ … … 193 202 } 194 203 /*}}}*/ 195 void DataSet::Presort(){/*{{{*/204 void DataSet::Presort(){/*{{{*/ 196 205 197 206 /*vector of objects is already sorted, just allocate the sorted ids and their … … 200 209 201 210 /*Delete existing ids*/ 202 xDelete<int>(sorted_ids);203 xDelete<int>(id_offsets);211 if(sorted_ids) xDelete<int>(sorted_ids); 212 if(id_offsets) xDelete<int>(id_offsets); 204 213 205 214 /*Allocate new ids*/ … … 215 224 216 225 /*set sorted flag: */ 226 numsorted=objects.size(); 217 227 sorted=1; 218 228 } 219 229 /*}}}*/ 220 int DataSet::Size(void){/*{{{*/230 int DataSet::Size(void){/*{{{*/ 221 231 _assert_(this!=NULL); 222 232 … … 224 234 } 225 235 /*}}}*/ 226 void DataSet::Sort(){/*{{{*/236 void DataSet::Sort(){/*{{{*/ 227 237 228 238 /*Only sort if we are not already sorted: */ -
issm/trunk-jpl/src/c/datastructures/DataSet.h
r15067 r18237 25 25 int sorted; 26 26 int presorted; 27 int numsorted; 27 28 int* sorted_ids; 28 29 int* id_offsets; -
issm/trunk-jpl/src/c/main/issm.cpp
r16591 r18237 23 23 24 24 /*Wrap up: */ 25 femmodel->CleanUp(); 26 27 /*Delete Model: */ 25 28 delete femmodel; 26 29 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
r17757 r18237 56 56 case 2: 57 57 elements->InputDuplicate(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum); 58 if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBbarEnum,QmuMaterialsRheologyBEnum);59 58 break; 60 59 case 3: 61 if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBEnum,QmuMaterialsRheologyBEnum);62 60 break; 63 61 default: … … 74 72 elements->InputDuplicate(MaterialsRheologyBEnum,MaterialsRheologyBbarEnum); 75 73 elements->InputDuplicate(DamageDEnum,DamageDbarEnum); 76 if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBbarEnum,QmuMaterialsRheologyBEnum);77 74 break; 78 75 case 3: 79 if(dakota_analysis) elements->InputDuplicate(MaterialsRheologyBEnum,QmuMaterialsRheologyBEnum);80 76 break; 81 77 default: -
issm/trunk-jpl/src/c/toolkits/issm/Bucket.h
r16158 r18237 125 125 } /*}}}*/ 126 126 Object *copy() {/*{{{*/ 127 _error_("Not implemented yet (similar to Elements)"); }; 127 if (this->type==MATRIX_BUCKET) return new Bucket(this->m,this->idxm,this->n,this->idxn,this->values,this->mode); 128 else if (this->type==VECTOR_BUCKET) return new Bucket(this->m,this->idxm,this->values,this->mode); 129 else _error_("No Copy of Bucket because its type is invalid."); }; 128 130 /*}}}*/ 129 131
Note:
See TracChangeset
for help on using the changeset viewer.