Changeset 3732
- Timestamp:
- 05/12/10 08:19:37 (15 years ago)
- Location:
- issm/trunk/src/c
- Files:
-
- 75 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/DataSet/DataSet.cpp
r3717 r3732 1365 1365 } 1366 1366 /*}}}*/ 1367 /*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/ 1368 void DataSet::UpdateInputsFromConstant(double constant, int name){ 1369 1370 vector<Object*>::iterator object; 1371 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1372 (*object)->UpdateInputsFromConstant(constant,name); 1373 } 1374 } 1375 /*}}}*/ 1376 /*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/ 1377 void DataSet::UpdateInputsFromConstant(int constant, int name){ 1378 1379 vector<Object*>::iterator object; 1380 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1381 (*object)->UpdateInputsFromConstant(constant,name); 1382 } 1383 } 1384 /*}}}*/ 1385 /*FUNCTION DataSet::UpdateInputsFromConstant{{{1*/ 1386 void DataSet::UpdateInputsFromConstant(bool constant, int name){ 1387 1388 vector<Object*>::iterator object; 1389 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1390 (*object)->UpdateInputsFromConstant(constant,name); 1391 } 1392 } 1393 /*}}}*/ 1367 1394 /*FUNCTION DataSet::UpdateInputsFromVector{{{1*/ 1368 1395 void DataSet::UpdateInputsFromVector(double* vec, int name, int type){ 1369 1396 1370 1397 vector<Object*>::iterator object; 1371 1372 Element* element=NULL; 1373 Node* node=NULL; 1374 Vertex* vertex=NULL; 1375 Load* load=NULL; 1376 Material* material=NULL; 1377 Param* param=NULL; 1378 1379 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1380 1381 if(EnumIsElement((*object)->Enum())){ 1382 1383 element=(Element*)(*object); 1384 element->UpdateInputsFromVector(vec,name,type); 1385 } 1386 else if(((*object)->Enum()==NodeEnum)){ 1387 1388 node=(Node*)(*object); 1389 node->UpdateInputsFromVector(vec,name,type); 1390 } 1391 else if(((*object)->Enum()==VertexEnum)){ 1392 1393 vertex=(Vertex*)(*object); 1394 vertex->UpdateInputsFromVector(vec,name,type); 1395 } 1396 else if(EnumIsLoad((*object)->Enum())){ 1397 1398 load=(Load*)(*object); 1399 load->UpdateInputsFromVector(vec,name,type); 1400 } 1401 else if(EnumIsMaterial((*object)->Enum())){ 1402 1403 material=(Material*)(*object); 1404 material->UpdateInputsFromVector(vec,name,type); 1405 } 1406 else if(((*object)->Enum()==ParamEnum)){ 1407 1408 param=(Param*)(*object); 1409 param->UpdateInputsFromVector(vec,name,type); 1410 } 1411 else ISSMERROR("%s%i%s"," object with id: ",(*object)->Id()," is not an element, in a function that deals only with elements!"); 1398 for ( object=objects.begin() ; object < objects.end(); object++ ){ 1399 1400 (*object)->UpdateInputsFromVector(vec,name,type); 1412 1401 } 1413 1402 } -
issm/trunk/src/c/DataSet/DataSet.h
r3717 r3732 71 71 void CreateKMatrix(Mat Kgg, int analysis_type,int sub_analysis_type); 72 72 void CreatePVector(Vec pg, int analysis_type,int sub_analysis_type); 73 void UpdateInputsFromConstant(double constant, int name); 74 void UpdateInputsFromConstant(int constant, int name); 75 void UpdateInputsFromConstant(bool constant, int name); 73 76 void UpdateInputsFromVector(double* vector,int name, int type); 74 77 void UpdateInputsFromSolution(double* solution,int analysis_type,int sub_analysis_type); … … 137 140 void GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum); 138 141 void GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int yenum); 142 143 void ChangeEnum(int enumtype,int new_enumtype); 139 144 /*}}}*/ 140 145 … … 154 159 /*}}}*/ 155 160 /*numerics: {{{1*/ 161 int FindParam(bool* pinteger,int enum_type); 162 int FindParam(int* pinteger,int enum_type); 156 163 int FindParam(double* pscalar, int enum_type); 157 int FindParam(int* pinteger,int enum_type);158 164 int FindParam(char** pstring,int enum_type); 159 165 int FindParam(char*** pstringarray,int* pM,int enum_type); -
issm/trunk/src/c/DataSet/Inputs.cpp
r3702 r3732 23 23 using namespace std; 24 24 /*}}}*/ 25 /*Inputs: {{{1*/26 25 27 26 /*Object constructors and destructor*/ 28 /*FUNCTION Inputs::Inputs(){{{ 2*/27 /*FUNCTION Inputs::Inputs(){{{1*/ 29 28 Inputs::Inputs(){ 30 29 return; 31 30 } 32 31 /*}}}*/ 33 /*FUNCTION Inputs::Inputs(int in_enum){{{ 2*/32 /*FUNCTION Inputs::Inputs(int in_enum){{{1*/ 34 33 Inputs::Inputs(int in_enum): DataSet(in_enum) { 35 34 //do nothing; … … 37 36 } 38 37 /*}}}*/ 39 /*FUNCTION Inputs::~Inputs(){{{ 2*/38 /*FUNCTION Inputs::~Inputs(){{{1*/ 40 39 Inputs::~Inputs(){ 41 40 return; … … 44 43 45 44 /*Object management*/ 46 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{ 2*/45 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type){{{1*/ 47 46 void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type){ 48 47 … … 68 67 } 69 68 /*}}}*/ 70 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{ 2*/69 /*FUNCTION Inputs::GetParameterValue(double* pvalue,double* gauss,int enum_type,double defaultvalue){{{1*/ 71 70 void Inputs::GetParameterValue(double* pvalue,double* gauss, int enum_type,double defaultvalue){ 72 71 … … 90 89 } 91 90 /*}}}*/ 92 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{ 2*/91 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){{{1*/ 93 92 void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type){ 94 93 … … 114 113 } 115 114 /*}}}*/ 116 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{ 2*/115 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node, int enum_type){{{1*/ 117 116 void Inputs::GetParameterValue(double* pvalue,Node* node,int enum_type){ 118 117 … … 139 138 } 140 139 /*}}}*/ 141 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{ 2*/140 /*FUNCTION Inputs::GetParameterValue(double* pvalue, Node* node1, Node* node2,int enum_type){{{1*/ 142 141 void Inputs::GetParameterValue(double* pvalue,Node* node1, Node* node2,double gauss_coord,int enum_type){ 143 142 … … 164 163 } 165 164 /*}}}*/ 166 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{ 2*/165 /*FUNCTION Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){{{1*/ 167 166 void Inputs::GetParameterValues(double* values,double* gauss_pointers, int numgauss,int enum_type,double* defaultvalues){ 168 167 … … 188 187 } 189 188 /*}}}*/ 190 /*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{ 2*/189 /*FUNCTION Inputs::GetParameterValue(bool* pvalue,int enum-type){{{1*/ 191 190 void Inputs::GetParameterValue(bool* pvalue,int enum_type){ 192 191 … … 212 211 } 213 212 /*}}}*/ 214 /*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{ 2*/213 /*FUNCTION Inputs::GetParameterValue(int* pvalue,int enum-type){{{1*/ 215 214 void Inputs::GetParameterValue(int* pvalue,int enum_type){ 216 215 … … 236 235 } 237 236 /*}}}*/ 238 /*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{ 2*/237 /*FUNCTION Inputs::GetParameterValue(double* pvalue,int enum-type){{{1*/ 239 238 void Inputs::GetParameterValue(double* pvalue,int enum_type){ 240 239 … … 260 259 } 261 260 /*}}}*/ 262 /*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{ 2*/261 /*FUNCTION Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){{{1*/ 263 262 void Inputs::GetParameterDerivativeValue(double* derivativevalues, double* xyz_list, double* gauss,int enum_type){ 264 263 … … 283 282 } 284 283 /*}}}*/ 285 /*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{ 2*/284 /*FUNCTION Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){{{1*/ 286 285 void Inputs::GetStrainRate(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum){ 287 286 … … 312 311 } 313 312 /*}}}*/ 314 /*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{ 2*/313 /*FUNCTION Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){{{1*/ 315 314 void Inputs::GetStrainRateStokes(double* epsilon,double* xyz_list, double* gauss, int xenum, int yenum,int zenum){ 316 315 … … 347 346 } 348 347 /*}}}*/ 349 /*FUNCTION Inputs::AddInput{{{ 2*/348 /*FUNCTION Inputs::AddInput{{{1*/ 350 349 int Inputs::AddInput(Input* in_input){ 351 350 … … 368 367 } 369 368 /*}}}*/ 370 371 /*Object functions*/ 372 373 374 /*}}}*/ 369 /*FUNCTION Inputs::ChangeEnum{{{1*/ 370 void Inputs::ChangeEnum(int enumtype,int newenumtype){ 371 372 /*Go through dataset of inputs and look for input with 373 * same enum as input enum, once found, just change its name */ 374 vector<Object*>::iterator object; 375 Input* input=NULL; 376 377 for ( object=objects.begin() ; object < objects.end(); object++ ){ 378 379 input=(Input*)(*object); 380 381 if (input->EnumType()==enumtype){ 382 input->ChangeEnum(newenumtype); 383 break; 384 } 385 } 386 } 387 /*}}}*/ -
issm/trunk/src/c/DataSet/Parameters.cpp
r3702 r3732 45 45 46 46 /*Object management*/ 47 /*FUNCTION Parameters::FindParam(bool* pbool,int enum_type){{{2*/ 48 int Parameters::FindParam(bool* pbool,int enum_type){ 49 50 51 /*Go through a dataset, and find a Param* object 52 *which parameter name is "name" : */ 53 54 vector<Object*>::iterator object; 55 Param* param=NULL; 56 57 int found=0; 58 59 for ( object=objects.begin() ; object < objects.end(); object++ ){ 60 61 /*Find param type objects: */ 62 if((*object)->Enum()==ParamEnum){ 63 64 /*Ok, this object is a parameter, recover it and ask which name it has: */ 65 param=(Param*)(*object); 66 67 if(param->EnumType()==enum_type){ 68 /*Ok, this is the one! Recover the value of this parameter: */ 69 param->GetParameterValue(pbool); 70 found=1; 71 break; 72 } 73 } 74 } 75 return found; 76 } 77 /*}}}*/ 78 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/ 79 int Parameters::FindParam(int* pinteger,int enum_type){ 80 81 82 /*Go through a dataset, and find a Param* object 83 *which parameter name is "name" : */ 84 85 vector<Object*>::iterator object; 86 Param* param=NULL; 87 88 int found=0; 89 90 for ( object=objects.begin() ; object < objects.end(); object++ ){ 91 92 /*Find param type objects: */ 93 if((*object)->Enum()==ParamEnum){ 94 95 /*Ok, this object is a parameter, recover it and ask which name it has: */ 96 param=(Param*)(*object); 97 98 if(param->EnumType()==enum_type){ 99 /*Ok, this is the one! Recover the value of this parameter: */ 100 param->GetParameterValue(pinteger); 101 found=1; 102 break; 103 } 104 } 105 } 106 return found; 107 } 108 /*}}}*/ 47 109 /*FUNCTION Parameters::FindParam(double* pscalar, int enum_type){{{2*/ 48 110 int Parameters::FindParam(double* pscalar, int enum_type){ … … 75 137 } 76 138 /*}}}*/ 77 /*FUNCTION Parameters::FindParam(int* pinteger,int enum_type){{{2*/78 int Parameters::FindParam(int* pinteger,int enum_type){79 80 81 /*Go through a dataset, and find a Param* object82 *which parameter name is "name" : */83 84 vector<Object*>::iterator object;85 Param* param=NULL;86 87 int found=0;88 89 for ( object=objects.begin() ; object < objects.end(); object++ ){90 91 /*Find param type objects: */92 if((*object)->Enum()==ParamEnum){93 94 /*Ok, this object is a parameter, recover it and ask which name it has: */95 param=(Param*)(*object);96 97 if(param->EnumType()==enum_type){98 /*Ok, this is the one! Recover the value of this parameter: */99 param->GetParameterValue(pinteger);100 found=1;101 break;102 }103 }104 }105 return found;106 }107 /*}}}*/108 139 /*FUNCTION Parameters::FindParam(char** pstring,int enum_type){{{2*/ 109 140 int Parameters::FindParam(char** pstring,int enum_type){ -
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r3725 r3732 24 24 parameters->AddObject(new BoolParam(ControlAnalysisEnum,iomodel->control_analysis)); 25 25 if(iomodel->control_analysis){ 26 parameters->AddObject(new StringParam(ControlTypeEnum,iomodel->control_type));27 26 28 if (strcmp(iomodel->control_type,"drag")==0) 29 parameters->AddObject(new BoolParam(ExtrudeParamEnum,false)); 30 else if (strcmp(iomodel->control_type,"B")==0) 31 parameters->AddObject(new BoolParam(ExtrudeParamEnum,true)); 27 if (strcmp(iomodel->control_type,"drag")==0){ 28 parameters->AddObject(new BoolParam(ExtrudeParamEnum,false)); 29 parameters->AddObject(new IntParam(ControlTypeEnum,DragCoefficientEnum)); 30 } 31 else if (strcmp(iomodel->control_type,"B")==0){ 32 parameters->AddObject(new BoolParam(ExtrudeParamEnum,true)); 33 parameters->AddObject(new IntParam(ControlTypeEnum,RheologyBEnum)); 34 } 32 35 else 33 36 ISSMERROR("control_type %s not supported yet!",iomodel->control_type); -
issm/trunk/src/c/Qmux/DakotaResponses.cpp
r3722 r3732 252 252 253 253 /*Recover some parameters: */ 254 femmodel->parameters->FindParam(&numberofdofspernode,NumberOfDofsPer nodeEnum);254 femmodel->parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum); 255 255 femmodel->parameters->FindParam(&numberofnodes,NumberOfNodesEnum); 256 256 femmodel->parameters->FindParam(&fit,NULL,NULL,FitEnum); … … 267 267 femmodel->elements->UpdateInputsFromVector(vy,VyEnum,VertexEnum); 268 268 femmodel->elements->UpdateInputsFromVector(vz,VzEnum,VertexEnum); 269 femmodel->elements->UpdateInputsFromVector( fit[0],FitEnum,ConstantEnum);269 femmodel->elements->UpdateInputsFromVector(&fit[0],FitEnum,ConstantEnum); 270 270 271 271 /*Compute misfit: */ … … 317 317 318 318 /*retrieve qmu_mass_flux_segments: */ 319 param=(Param*)femmodel->parameters->FindParamObject(QmuMassFluxSegmentsEnum); 320 if(!param)ISSMERROR(" could not find qmu_mass_flux_segments to compute mass_flux"); 321 322 param->GetParameterValue(&segments); 323 num_segments=param->GetM(); 319 femmodel->parameters->FindParam(&segments,&num_segments,QmuMassFluxSegmentsEnum); 324 320 325 321 /*call mass flux module: */ -
issm/trunk/src/c/Qmux/SpawnCoreParallel.cpp
r3703 r3732 43 43 44 44 char** responses_descriptors=NULL; 45 Param* param=NULL;45 int num_responses_descriptors; 46 46 char* string=NULL; 47 47 int string_length; … … 49 49 int qmu_npart; 50 50 int verbose=0; 51 int dummy; 51 52 52 53 extern int my_rank; … … 60 61 61 62 /*First off, recover the response descriptors for the response functions: */ 62 param=(Param*)model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters->FindParamObject(ResponseDescriptorsEnum); 63 if(!param)ISSMERROR(" could not find response descriptors!"); 64 65 param->GetParameterValue(&responses_descriptors); 63 model->GetFormulation(DiagnosticAnalysisEnum,HorizAnalysisEnum)->parameters->FindParam(&responses_descriptors,&num_responses_descriptors,ResponseDescriptorsEnum); 66 64 67 65 /*Recover partitioning for dakota: */ 68 model->FindParam(&qmu_npart,QmuN partEnum);69 model->FindParam(&qmu_part, NULL,NULL,QmuPartEnum);66 model->FindParam(&qmu_npart,QmuNPartEnum); 67 model->FindParam(&qmu_part,&dummy,QmuPartEnum); 70 68 71 69 /*broadcast variables: only cpu 0 has correct values*/ -
issm/trunk/src/c/objects/Constraints/Rgb.h
r3703 r3732 35 35 int MyRank(); 36 36 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 37 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 38 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 39 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 40 37 41 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 38 42 -
issm/trunk/src/c/objects/Constraints/Spc.h
r3703 r3732 40 40 Object* copy(); 41 41 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 44 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 45 42 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 43 47 -
issm/trunk/src/c/objects/DofVec.h
r3703 r3732 48 48 int Size(); 49 49 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 50 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 51 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 52 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 50 53 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 51 54 Object* copy(); -
issm/trunk/src/c/objects/Elements/Beam.cpp
r3717 r3732 124 124 nodeinputs[0]=iomodel->vx_obs[index]; 125 125 nodeinputs[1]=iomodel->vx_obs[(int)(iomodel->uppernodes[index]-1)]; 126 this->inputs->AddInput(new BeamVertexInput(Vx Enum,nodeinputs));126 this->inputs->AddInput(new BeamVertexInput(VxObsEnum,nodeinputs)); 127 127 } 128 128 if (iomodel->vy_obs) { 129 129 nodeinputs[0]=iomodel->vy_obs[index]; 130 130 nodeinputs[1]=iomodel->vy_obs[(int)(iomodel->uppernodes[index]-1)]; 131 this->inputs->AddInput(new BeamVertexInput(Vy Enum,nodeinputs));131 this->inputs->AddInput(new BeamVertexInput(VyObsEnum,nodeinputs)); 132 132 } 133 133 if (iomodel->vz_obs) { 134 134 nodeinputs[0]=iomodel->vz_obs[index]; 135 135 nodeinputs[1]=iomodel->vz_obs[(int)(iomodel->uppernodes[index]-1)]; 136 this->inputs->AddInput(new BeamVertexInput(Vz Enum,nodeinputs));136 this->inputs->AddInput(new BeamVertexInput(VzObsEnum,nodeinputs)); 137 137 } 138 138 if (iomodel->weights) { … … 142 142 } 143 143 if (iomodel->gridonbed) this->inputs->AddInput(new BoolInput(ElementOnBedEnum,(IssmBool)iomodel->gridonbed[index])); 144 145 /*default vx,vy and vz: */ 146 if (!iomodel->vx && iomodel->vx_obs) { 147 nodeinputs[0]=iomodel->vx_obs[index]; 148 nodeinputs[1]=iomodel->vx_obs[(int)(iomodel->uppernodes[index]-1)]; 149 this->inputs->AddInput(new BeamVertexInput(VxEnum,nodeinputs)); 150 this->inputs->AddInput(new BeamVertexInput(VxOldEnum,nodeinputs)); 151 } 152 if (!iomodel->vy && iomodel->vy_obs) { 153 nodeinputs[0]=iomodel->vy_obs[index]; 154 nodeinputs[1]=iomodel->vy_obs[(int)(iomodel->uppernodes[index]-1)]; 155 this->inputs->AddInput(new BeamVertexInput(VyEnum,nodeinputs)); 156 this->inputs->AddInput(new BeamVertexInput(VyOldEnum,nodeinputs)); 157 } 158 if (!iomodel->vz && iomodel->vz_obs) { 159 nodeinputs[0]=iomodel->vz_obs[index]; 160 nodeinputs[1]=iomodel->vz_obs[(int)(iomodel->uppernodes[index]-1)]; 161 this->inputs->AddInput(new BeamVertexInput(VzEnum,nodeinputs)); 162 this->inputs->AddInput(new BeamVertexInput(VzOldEnum,nodeinputs)); 163 } 144 164 145 165 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. -
issm/trunk/src/c/objects/Elements/Beam.h
r3717 r3732 54 54 void SetClone(int* minranks); 55 55 void UpdateInputsFromVector(double* vector, int name, int type); 56 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 57 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 58 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 59 56 60 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 57 61 -
issm/trunk/src/c/objects/Elements/Penta.cpp
r3717 r3732 159 159 for(i=0;i<6;i++)nodeinputs[i]=iomodel->weights[penta_node_ids[i]-1]; 160 160 this->inputs->AddInput(new PentaVertexInput(WeightsEnum,nodeinputs)); 161 } 162 163 /*default vx,vy and vz: */ 164 if (!iomodel->vx && iomodel->vx_obs) { 165 for(i=0;i<6;i++)nodeinputs[i]=iomodel->vx_obs[penta_node_ids[i]-1]; 166 this->inputs->AddInput(new PentaVertexInput(VxEnum,nodeinputs)); 167 this->inputs->AddInput(new PentaVertexInput(VxOldEnum,nodeinputs)); 168 } 169 if (!iomodel->vy && iomodel->vy_obs) { 170 for(i=0;i<6;i++)nodeinputs[i]=iomodel->vy_obs[penta_node_ids[i]-1]; 171 this->inputs->AddInput(new PentaVertexInput(VyEnum,nodeinputs)); 172 this->inputs->AddInput(new PentaVertexInput(VyOldEnum,nodeinputs)); 173 } 174 if (!iomodel->vz && iomodel->vz_obs) { 175 for(i=0;i<6;i++)nodeinputs[i]=iomodel->vz_obs[penta_node_ids[i]-1]; 176 this->inputs->AddInput(new PentaVertexInput(VzEnum,nodeinputs)); 177 this->inputs->AddInput(new PentaVertexInput(VzOldEnum,nodeinputs)); 161 178 } 162 179 … … 447 464 vy[i]=values[i*numdofpervertex+1]; 448 465 } 466 467 /*Now, we have to move the previous Vx and Vy inputs to old 468 * status, otherwise, we'll wipe them off: */ 469 this->inputs->ChangeEnum(VxEnum,VxOldEnum); 470 this->inputs->ChangeEnum(VyEnum,VyOldEnum); 449 471 450 472 /*Add vx and vy as inputs to the tria element: */ -
issm/trunk/src/c/objects/Elements/Penta.h
r3717 r3732 141 141 void UpdateInputsFromSolutionBalancedvelocities( double* solution,int analysis_type,int sub_analysis_type); 142 142 void UpdateInputsFromVector(double* vector, int name, int type); 143 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 144 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 145 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 146 143 147 144 148 /*}}}*/ -
issm/trunk/src/c/objects/Elements/Sing.cpp
r3717 r3732 90 90 if (iomodel->vy) this->inputs->AddInput(new SingVertexInput(VyEnum,iomodel->vy[i])); 91 91 if (iomodel->vz) this->inputs->AddInput(new SingVertexInput(VzEnum,iomodel->vz[i])); 92 if (iomodel->vx_obs) this->inputs->AddInput(new SingVertexInput(Vx Enum,iomodel->vx_obs[i]));93 if (iomodel->vy_obs) this->inputs->AddInput(new SingVertexInput(Vy Enum,iomodel->vy_obs[i]));94 if (iomodel->vz_obs) this->inputs->AddInput(new SingVertexInput(Vz Enum,iomodel->vz_obs[i]));92 if (iomodel->vx_obs) this->inputs->AddInput(new SingVertexInput(VxObsEnum,iomodel->vx_obs[i])); 93 if (iomodel->vy_obs) this->inputs->AddInput(new SingVertexInput(VyObsEnum,iomodel->vy_obs[i])); 94 if (iomodel->vz_obs) this->inputs->AddInput(new SingVertexInput(VzObsEnum,iomodel->vz_obs[i])); 95 95 if (iomodel->weights) this->inputs->AddInput(new SingVertexInput(WeightsEnum,iomodel->weights[i])); 96 if (!iomodel->vx && iomodel->vx_obs){ 97 this->inputs->AddInput(new SingVertexInput(VxEnum,iomodel->vx_obs[i])); 98 this->inputs->AddInput(new SingVertexInput(VxOldEnum,iomodel->vx_obs[i])); 99 } 100 if (!iomodel->vy && iomodel->vy_obs){ 101 this->inputs->AddInput(new SingVertexInput(VyEnum,iomodel->vy_obs[i])); 102 this->inputs->AddInput(new SingVertexInput(VyOldEnum,iomodel->vy_obs[i])); 103 } 104 if (!iomodel->vz && iomodel->vz_obs){ 105 this->inputs->AddInput(new SingVertexInput(VzEnum,iomodel->vz_obs[i])); 106 this->inputs->AddInput(new SingVertexInput(VzOldEnum,iomodel->vz_obs[i])); 107 } 108 96 109 97 110 //this->parameters: we still can't point to it, it may not even exist. Configure will handle this. -
issm/trunk/src/c/objects/Elements/Sing.h
r3717 r3732 54 54 int MyRank(); 55 55 void UpdateInputsFromVector(double* vector, int name, int type); 56 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 57 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 58 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 59 56 60 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 57 61 -
issm/trunk/src/c/objects/Elements/Tria.cpp
r3717 r3732 146 146 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx[tria_node_ids[i]-1]; 147 147 this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs)); 148 this->inputs->AddInput(new TriaVertexInput(VxOldEnum,nodeinputs)); 148 149 } 149 150 if (iomodel->vy) { 150 151 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy[tria_node_ids[i]-1]; 151 152 this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs)); 153 this->inputs->AddInput(new TriaVertexInput(VyOldEnum,nodeinputs)); 152 154 } 153 155 if (iomodel->vz) { 154 156 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz[tria_node_ids[i]-1]; 155 157 this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs)); 158 this->inputs->AddInput(new TriaVertexInput(VzOldEnum,nodeinputs)); 156 159 } 157 160 if (iomodel->vx_obs) { … … 171 174 this->inputs->AddInput(new TriaVertexInput(WeightsEnum,nodeinputs)); 172 175 } 173 176 /*Default vx,vy and vz?:*/ 177 if(!iomodel->vx && iomodel->vx_obs){ 178 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vx_obs[tria_node_ids[i]-1]; 179 this->inputs->AddInput(new TriaVertexInput(VxEnum,nodeinputs)); 180 this->inputs->AddInput(new TriaVertexInput(VxOldEnum,nodeinputs)); 181 } 182 if(!iomodel->vy && iomodel->vy_obs){ 183 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vy_obs[tria_node_ids[i]-1]; 184 this->inputs->AddInput(new TriaVertexInput(VyEnum,nodeinputs)); 185 this->inputs->AddInput(new TriaVertexInput(VyOldEnum,nodeinputs)); 186 } 187 if(!iomodel->vz && iomodel->vz_obs){ 188 for(i=0;i<3;i++)nodeinputs[i]=iomodel->vz_obs[tria_node_ids[i]-1]; 189 this->inputs->AddInput(new TriaVertexInput(VzEnum,nodeinputs)); 190 this->inputs->AddInput(new TriaVertexInput(VzOldEnum,nodeinputs)); 191 } 174 192 175 193 if (iomodel->elementoniceshelf) this->inputs->AddInput(new BoolInput(ElementOnIceShelfEnum,(IssmBool)iomodel->elementoniceshelf[index])); … … 445 463 vy[i]=values[i*numdofpervertex+1]; 446 464 } 465 466 /*Now, we have to move the previous Vx and Vy inputs to old 467 * status, otherwise, we'll wipe them off: */ 468 this->inputs->ChangeEnum(VxEnum,VxOldEnum); 469 this->inputs->ChangeEnum(VyEnum,VyOldEnum); 447 470 448 471 /*Add vx and vy as inputs to the tria element: */ -
issm/trunk/src/c/objects/Elements/Tria.h
r3717 r3732 51 51 void SetClone(int* minranks); 52 52 void UpdateInputsFromVector(double* vector, int name, int type); 53 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 56 53 57 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 54 58 -
issm/trunk/src/c/objects/FemModel.cpp
r3703 r3732 179 179 } 180 180 /*}}}*/ 181 /*FUNCTION FemModel::FindParam(bool* pinteger,int enum_type) {{{1*/ 182 int FemModel::FindParam(bool* pinteger,int enum_type){ 183 184 return parameters->FindParam(pinteger,enum_type); 185 186 } 187 /*}}}*/ 188 /*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/ 189 int FemModel::FindParam(int* pinteger,int enum_type){ 190 191 return parameters->FindParam(pinteger,enum_type); 192 193 } 194 /*}}}*/ 181 195 /*FUNCTION FemModel::FindParam(double* pscalar,int enum_type) {{{1*/ 182 196 int FemModel::FindParam(double* pscalar,int enum_type){ … … 186 200 } 187 201 /*}}}*/ 188 /*FUNCTION FemModel::FindParam(int* pinteger,int enum_type) {{{1*/189 int FemModel::FindParam(int* pinteger,int enum_type){190 191 return parameters->FindParam(pinteger,enum_type);192 193 }194 /*}}}*/195 202 /*FUNCTION FemModel::FindParam(char** pstring,int enum_type) {{{1*/ 196 203 int FemModel::FindParam(char** pstring,int enum_type){ … … 211 218 212 219 return parameters->FindParam(pdoublearray,pM,pN,enum_type); 220 221 } 222 /*}}}*/ 223 /*FUNCTION FemModel::FindParam(double** pdoublearray,int* pM,int enum_type) {{{1*/ 224 int FemModel::FindParam(double** pdoublearray,int* pM,int enum_type){ 225 226 return parameters->FindParam(pdoublearray,pM,enum_type); 213 227 214 228 } … … 307 321 /*FUNCTION FemModel::UpdateInputsFromVector(double* vector, int name, int type){{{1*/ 308 322 void FemModel::UpdateInputsFromVector(double* vector, int name, int type){ 323 324 if(vector==NULL)return; //don't bother 309 325 310 326 elements->UpdateInputsFromVector(vector,name,type); … … 317 333 } 318 334 /*}}}*/ 335 /*FUNCTION FemModel::UpdateInputsFromConstant(double constant, int name){{{1*/ 336 void FemModel::UpdateInputsFromConstant(double constant, int name){ 337 338 elements->UpdateInputsFromConstant(constant,name); 339 nodes->UpdateInputsFromConstant(constant,name); 340 vertices->UpdateInputsFromConstant(constant,name); 341 loads->UpdateInputsFromConstant(constant,name); 342 materials->UpdateInputsFromConstant(constant,name); 343 parameters->UpdateInputsFromConstant(constant,name); 344 345 } 346 /*}}}*/ 347 /*FUNCTION FemModel::UpdateInputsFromConstant(int constant, int name){{{1*/ 348 void FemModel::UpdateInputsFromConstant(int constant, int name){ 349 350 elements->UpdateInputsFromConstant(constant,name); 351 nodes->UpdateInputsFromConstant(constant,name); 352 vertices->UpdateInputsFromConstant(constant,name); 353 loads->UpdateInputsFromConstant(constant,name); 354 materials->UpdateInputsFromConstant(constant,name); 355 parameters->UpdateInputsFromConstant(constant,name); 356 357 } 358 /*}}}*/ 359 /*FUNCTION FemModel::UpdateInputsFromConstant(bool constant, int name){{{1*/ 360 void FemModel::UpdateInputsFromConstant(bool constant, int name){ 361 362 elements->UpdateInputsFromConstant(constant,name); 363 nodes->UpdateInputsFromConstant(constant,name); 364 vertices->UpdateInputsFromConstant(constant,name); 365 loads->UpdateInputsFromConstant(constant,name); 366 materials->UpdateInputsFromConstant(constant,name); 367 parameters->UpdateInputsFromConstant(constant,name); 368 369 } 370 /*}}}*/ 371 /*FUNCTION FemModel::UpdateInputsFromSolution(Vec vector, int name, int type){{{1*/ 372 void FemModel::UpdateInputsFromSolution(Vec vector,int name, int type){ 373 374 double* serial_vector=NULL; 375 376 VecToMPISerial(&serial_vector,vector); 377 378 elements->UpdateInputsFromSolution(serial_vector,name,type); 379 nodes->UpdateInputsFromSolution(serial_vector,name,type); 380 vertices->UpdateInputsFromSolution(serial_vector,name,type); 381 loads->UpdateInputsFromSolution(serial_vector,name,type); 382 materials->UpdateInputsFromSolution(serial_vector,name,type); 383 parameters->UpdateInputsFromSolution(serial_vector,name,type); 384 385 /*Free ressources:*/ 386 xfree((void**)&serial_vector); 387 388 } 389 /*}}}*/ 319 390 /*FUNCTION FemModel::UpdateInputsFromSolution(double* vector, int name, int type){{{1*/ 320 void FemModel::UpdateInputsFromSolution(double* vector, int name, int type){ 321 322 elements->UpdateInputsFromSolution(vector,name,type); 323 nodes->UpdateInputsFromSolution(vector,name,type); 324 vertices->UpdateInputsFromSolution(vector,name,type); 325 loads->UpdateInputsFromSolution(vector,name,type); 326 materials->UpdateInputsFromSolution(vector,name,type); 327 parameters->UpdateInputsFromSolution(vector,name,type); 328 329 } 330 /*}}}*/ 391 void FemModel::UpdateInputsFromSolution(double* vector,int name, int type){ 392 ISSMERROR(" not supported yet!"); 393 } 394 /*}}}*/ -
issm/trunk/src/c/objects/FemModel.h
r3703 r3732 57 57 58 58 int FindParam(double* pscalar,int enum_type); 59 int FindParam(bool* pinteger,int enum_type); 59 60 int FindParam(int* pinteger,int enum_type); 60 61 int FindParam(char** pstring,int enum_type); 61 62 int FindParam(char*** pstringarray,int* pM,int enum_type); 63 int FindParam(double** pdoublearray,int* pM, int enum_type); 62 64 int FindParam(double** pdoublearray,int* pM, int* pN,int enum_type); 63 65 int FindParam(Vec* pvec,int enum_type); … … 80 82 81 83 void UpdateInputsFromVector(double* vector, int name, int type); 84 void UpdateInputsFromConstant(double constant, int name); 85 void UpdateInputsFromConstant(int constant, int name); 86 void UpdateInputsFromConstant(bool constant, int name); 87 void UpdateInputsFromSolution(Vec solution, int analysis_type, int sub_analysis_type); 82 88 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 83 89 -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.cpp
r3683 r3732 166 166 void BeamVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 167 167 /*}}}*/ 168 /*FUNCTION BeamVertexInput::ChangeEnum(int newenumtype){{{1*/ 169 void BeamVertexInput::ChangeEnum(int newenumtype){ 170 this->enum_type=newenumtype; 171 } 172 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BeamVertexInput.h
r3703 r3732 39 39 int EnumType(); 40 40 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 44 41 45 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 42 46 … … 57 61 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 58 62 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 63 void ChangeEnum(int newenumtype); 59 64 /*}}}*/ 60 65 -
issm/trunk/src/c/objects/Inputs/BoolInput.cpp
r3683 r3732 166 166 void BoolInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 167 167 /*}}}*/ 168 /*FUNCTION BoolInput::ChangeEnum(int newenumtype){{{1*/ 169 void BoolInput::ChangeEnum(int newenumtype){ 170 this->enum_type=newenumtype; 171 } 172 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/BoolInput.h
r3703 r3732 39 39 int EnumType(); 40 40 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 44 41 45 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 42 46 … … 57 61 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 58 62 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 63 void ChangeEnum(int newenumtype); 59 64 /*}}}*/ 60 65 -
issm/trunk/src/c/objects/Inputs/DoubleInput.cpp
r3683 r3732 166 166 void DoubleInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 167 167 /*}}}*/ 168 /*FUNCTION DoubleInput::ChangeEnum(int newenumtype){{{1*/ 169 void DoubleInput::ChangeEnum(int newenumtype){ 170 this->enum_type=newenumtype; 171 } 172 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/DoubleInput.h
r3703 r3732 39 39 int EnumType(); 40 40 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 44 41 45 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 42 46 … … 57 61 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 58 62 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 63 void ChangeEnum(int newenumtype); 59 64 /*}}}*/ 60 65 -
issm/trunk/src/c/objects/Inputs/Input.h
r3683 r3732 36 36 virtual void GetStrainRate(double* epsilon, Input* yinput, double* xyz_list, double* gauss)=0; 37 37 virtual void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss)=0; 38 virtual void ChangeEnum(int newenumtype)=0; 38 39 39 40 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/IntInput.cpp
r3683 r3732 166 166 void IntInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 167 167 /*}}}*/ 168 /*FUNCTION IntInput::ChangeEnum(int newenumtype){{{1*/ 169 void IntInput::ChangeEnum(int newenumtype){ 170 this->enum_type=newenumtype; 171 } 172 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/IntInput.h
r3703 r3732 39 39 int EnumType(); 40 40 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 44 41 45 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 42 46 … … 57 61 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 58 62 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 59 63 void ChangeEnum(int newenumtype); 60 64 /*}}}*/ 61 65 -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.cpp
r3683 r3732 170 170 void PentaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 171 171 /*}}}*/ 172 /*FUNCTION PentaVertexInput::ChangeEnum(int newenumtype){{{1*/ 173 void PentaVertexInput::ChangeEnum(int newenumtype){ 174 this->enum_type=newenumtype; 175 } 176 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/PentaVertexInput.h
r3703 r3732 38 38 int EnumType(); 39 39 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 40 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 43 40 44 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 41 45 … … 56 60 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 57 61 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 62 void ChangeEnum(int newenumtype); 58 63 /*}}}*/ 59 64 -
issm/trunk/src/c/objects/Inputs/SingVertexInput.cpp
r3683 r3732 165 165 void SingVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 166 166 /*}}}*/ 167 /*FUNCTION SingVertexInput::ChangeEnum(int newenumtype){{{1*/ 168 void SingVertexInput::ChangeEnum(int newenumtype){ 169 this->enum_type=newenumtype; 170 } 171 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/SingVertexInput.h
r3703 r3732 38 38 int EnumType(); 39 39 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 40 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 43 40 44 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 41 45 … … 56 60 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 57 61 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 62 void ChangeEnum(int newenumtype); 58 63 /*}}}*/ 59 64 -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.cpp
r3683 r3732 167 167 void TriaVertexInput::GetStrainRateStokes(double* epsilon,Input* yinput,Input* zinput, double* xyz_list, double* gauss){ISSMERROR(" not supported yet!");} 168 168 /*}}}*/ 169 /*FUNCTION TriaVertexInput::ChangeEnum(int newenumtype){{{1*/ 170 void TriaVertexInput::ChangeEnum(int newenumtype){ 171 this->enum_type=newenumtype; 172 } 173 /*}}}*/ -
issm/trunk/src/c/objects/Inputs/TriaVertexInput.h
r3703 r3732 38 38 int EnumType(); 39 39 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 40 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 41 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 43 40 44 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 41 45 … … 56 60 void GetStrainRate(double* epsilon,Input* yinput, double* xyz_list, double* gauss); 57 61 void GetStrainRateStokes(double* epsilon,Input* yinput, Input* zinput, double* xyz_list, double* gauss); 62 void ChangeEnum(int newenumtype); 58 63 /*}}}*/ 59 64 -
issm/trunk/src/c/objects/Loads/Icefront.h
r3703 r3732 51 51 int MyRank(); 52 52 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 53 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 56 53 57 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 54 58 -
issm/trunk/src/c/objects/Loads/Numericalflux.h
r3703 r3732 46 46 int MyRank(); 47 47 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 48 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 49 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 50 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 51 48 52 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 49 53 -
issm/trunk/src/c/objects/Loads/Pengrid.h
r3703 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Loads/Penpair.h
r3703 r3732 44 44 Object* copy(); 45 45 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 46 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 47 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 48 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 49 46 50 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 51 -
issm/trunk/src/c/objects/Loads/Riftfront.h
r3703 r3732 61 61 int MyRank(); 62 62 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 63 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 64 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 65 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 66 63 67 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 64 68 -
issm/trunk/src/c/objects/Materials/Material.h
r3703 r3732 27 27 virtual void UpdateFromInputs(void* inputs)=0; 28 28 virtual void UpdateInputsFromVector(double* vector, int name, int type)=0; 29 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 30 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 31 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 32 29 33 virtual void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type)=0; 30 34 -
issm/trunk/src/c/objects/Materials/Matice.h
r3703 r3732 46 46 double GetN(); 47 47 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 48 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 49 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 50 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 51 48 52 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 49 53 -
issm/trunk/src/c/objects/Materials/Matpar.h
r3703 r3732 58 58 Object* copy(); 59 59 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 60 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 61 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 62 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 63 60 64 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 61 65 -
issm/trunk/src/c/objects/Model.cpp
r3703 r3732 206 206 } 207 207 /*}}}1*/ 208 /*FUNCTION Model::FindParam( int* pparameter,int enum_type {{{1*/209 210 int Model::FindParam( int* pparameter,int enum_type){208 /*FUNCTION Model::FindParam(bool* pparameter,int enum_type {{{1*/ 209 210 int Model::FindParam(bool* pparameter,int enum_type){ 211 211 212 212 FemModel* femmodel=NULL; … … 224 224 } 225 225 /*}}}1*/ 226 /*FUNCTION Model::FindParam(int* pparameter,int enum_type {{{1*/ 227 228 int Model::FindParam(int* pparameter,int enum_type){ 229 230 FemModel* femmodel=NULL; 231 232 /*no analysis_type or sub_analysis_type, find the parameter in the first dataset we find: */ 233 if (!femmodels->Size())ISSMERROR(" no fem models were found!"); 234 235 /*recover first femmodel: */ 236 femmodel=(FemModel*)femmodels->GetObjectByOffset(0); 237 238 if(!femmodel)return 0; 239 240 femmodel->FindParam(pparameter,enum_type); 241 242 } 243 /*}}}1*/ 226 244 /*FUNCTION Model::FindParam(double* pparameter,int enum_type ){{{1*/ 227 245 int Model::FindParam(double* pparameter,int enum_type){ … … 260 278 } 261 279 /*}}}1*/ 280 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type) {{{1*/ 281 int Model::FindParam(double** pparameter,int* pM, int enum_type){ 282 283 FemModel* femmodel=NULL; 284 285 /*no analysis_type or sub_analysis_type, find the parameter in the first dataset we find: */ 286 if (!femmodels->Size())ISSMERROR(" no fem models were found!"); 287 288 /*recover first femmodel: */ 289 femmodel=(FemModel*)femmodels->GetObjectByOffset(0); 290 291 if(!femmodel)return 0; 292 293 femmodel->FindParam(pparameter,pM, enum_type); 294 295 296 } 297 /*}}}1*/ 262 298 /*FUNCTION Model::FindParam(char** pparameter,int enum_type) {{{1*/ 263 299 int Model::FindParam(char** pparameter,int enum_type){ … … 277 313 } 278 314 /*}}}1*/ 315 /*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 316 int Model::FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type){ 317 318 FemModel* femmodel=NULL; 319 320 /*find the correct formulation: */ 321 femmodel=this->GetFormulation(analysis_type,sub_analysis_type); 322 323 if(!femmodel)return 0; 324 325 /*extract our parameter from the found formulation: */ 326 femmodel->FindParam(pparameter,enum_type); 327 } 328 /*}}}1*/ 279 329 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 280 330 int Model::FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type){ … … 319 369 } 320 370 /*}}}1*/ 371 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 372 int Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type){ 373 374 FemModel* femmodel=NULL; 375 376 /*find the correct formulation: */ 377 femmodel=this->GetFormulation(analysis_type,sub_analysis_type); 378 379 if(!femmodel)return 0; 380 381 /*extract our parameter from the found formulation: */ 382 femmodel->FindParam(pparameter,pM, enum_type); 383 } 384 /*}}}1*/ 321 385 /*FUNCTION Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type) {{{1*/ 322 386 int Model::FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type){ … … 333 397 } 334 398 /*}}}1*/ 399 /*FUNCTION Model::FindParam(bool* pparameter,int enum_type,int analysis_type) {{{1*/ 400 int Model::FindParam(bool* pparameter,int enum_type,int analysis_type){ 401 402 FemModel* femmodel=NULL; 403 404 /*find the correct formulation: */ 405 femmodel=this->GetFormulation(analysis_type); 406 407 if(!femmodel)return 0; 408 409 /*extract our parameter from the found formulation: */ 410 femmodel->FindParam(pparameter,enum_type); 411 } 412 /*}}}1*/ 335 413 /*FUNCTION Model::FindParam(int* pparameter,int enum_type,int analysis_type) {{{1*/ 336 414 int Model::FindParam(int* pparameter,int enum_type,int analysis_type){ … … 373 451 /*extract our parameter from the found formulation: */ 374 452 femmodel->FindParam(pparameter,pM,pN,enum_type); 453 } 454 /*}}}1*/ 455 /*FUNCTION Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type) {{{1*/ 456 int Model::FindParam(double** pparameter,int* pM, int enum_type,int analysis_type){ 457 458 FemModel* femmodel=NULL; 459 460 /*find the correct formulation: */ 461 femmodel=this->GetFormulation(analysis_type); 462 463 if(!femmodel)return 0; 464 465 /*extract our parameter from the found formulation: */ 466 femmodel->FindParam(pparameter,pM,enum_type); 375 467 } 376 468 /*}}}1*/ … … 454 546 } 455 547 /*}}}1*/ 548 /*FUNCTION Model::UpdateInputsFromConstant(double constant, int name);{{{1*/ 549 void Model::UpdateInputsFromConstant(double constant, int name){ 550 551 int i; 552 FemModel* femmodel=NULL; 553 554 for(i=0;i<this->femmodels->Size();i++){ 555 femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i); 556 femmodel->UpdateInputsFromConstant(constant,name); 557 } 558 559 } 560 /*}}}1*/ 561 /*FUNCTION Model::UpdateInputsFromConstant(int constant, int name);{{{1*/ 562 void Model::UpdateInputsFromConstant(int constant, int name){ 563 564 int i; 565 FemModel* femmodel=NULL; 566 567 for(i=0;i<this->femmodels->Size();i++){ 568 femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i); 569 femmodel->UpdateInputsFromConstant(constant,name); 570 } 571 572 } 573 /*}}}1*/ 574 /*FUNCTION Model::UpdateInputsFromConstant(bool constant, int name);{{{1*/ 575 void Model::UpdateInputsFromConstant(bool constant, int name){ 576 577 int i; 578 FemModel* femmodel=NULL; 579 580 for(i=0;i<this->femmodels->Size();i++){ 581 femmodel=(FemModel*)this->femmodels->GetObjectByOffset(i); 582 femmodel->UpdateInputsFromConstant(constant,name); 583 } 584 585 } 586 /*}}}1*/ 456 587 /*FUNCTION Model::UpdateInputsFromVector(double* vector,int name, int type);{{{1*/ 457 588 void Model::UpdateInputsFromVector(double* vector,int name, int type){ … … 459 590 int i; 460 591 FemModel* femmodel=NULL; 592 593 if(vector==NULL)return; //don't bother 461 594 462 595 for(i=0;i<this->femmodels->Size();i++){ … … 480 613 } 481 614 /*}}}1*/ 615 /*FUNCTION Model::UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart);{{{1:*/ 616 void UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart){ 617 ISSMERROR("not supported yet!"); 618 } 619 /*}}}*/ -
issm/trunk/src/c/objects/Model.h
r3703 r3732 35 35 36 36 /*all overloaded forms of the FindParam routine: */ 37 int FindParam(bool* pparameter,int enum_type); 37 38 int FindParam(int* pparameter,int enum_type); 38 39 int FindParam(double* pparameter,int enum_type); 39 40 int FindParam(double** pparameter,int* pM,int* pN,int enum_type); 41 int FindParam(double** pparameter,int* pM,int enum_type); 40 42 int FindParam(char** pparameter,int enum_type); 41 43 44 int FindParam(bool* pparameter,int enum_type,int analysis_type,int sub_analysis_type); 42 45 int FindParam(int* pparameter,int enum_type,int analysis_type,int sub_analysis_type); 43 46 int FindParam(double* pparameter,int enum_type,int analysis_type,int sub_analysis_type); 47 int FindParam(double** pparameter,int* pM, int enum_type,int analysis_type,int sub_analysis_type); 44 48 int FindParam(double** pparameter,int* pM, int* pN,int enum_type,int analysis_type,int sub_analysis_type); 45 49 int FindParam(char** pparameter,int enum_type,int analysis_type,int sub_analysis_type); 46 50 51 int FindParam(bool* pparameter,int enum_type,int analysis_type); 47 52 int FindParam(int* pparameter,int enum_type,int analysis_type); 48 53 int FindParam(double* pparameter,int enum_type,int analysis_type); 54 int FindParam(double** pparameter,int* pM,int enum_type,int analysis_type); 49 55 int FindParam(double** pparameter,int* pM,int* pN,int enum_type,int analysis_type); 50 56 int FindParam(char** pparameter,int enum_type,int analysis_type); … … 54 60 55 61 void UpdateInputsFromVector(double* vector, int name, int type); 62 void UpdateInputsFromConstant(double constant, int name); 63 void UpdateInputsFromConstant(int constant, int name); 64 void UpdateInputsFromConstant(bool constant, int name); 56 65 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type); 66 void UpdateFromDakota(double* variables,char** variables_descriptors,int numvariables,DataSet* parameters, double* qmu_part,int qmu_npart); 67 57 68 58 69 FemModel* GetActiveFormulation(); -
issm/trunk/src/c/objects/Node.h
r3703 r3732 52 52 void SetVertexDof(int in_dof); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Object.h
r3703 r3732 26 26 virtual Object* copy()=0; 27 27 virtual void UpdateInputsFromVector(double* vector, int name, int type)=0; 28 virtual void UpdateInputsFromConstant(double constant, int name)=0; 29 virtual void UpdateInputsFromConstant(int constant, int name)=0; 30 virtual void UpdateInputsFromConstant(bool constant, int name)=0; 28 31 virtual void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type)=0; 29 32 -
issm/trunk/src/c/objects/Params/BoolParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Params/DoubleMatParam.h
r3715 r3732 54 54 int MyRank(); 55 55 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 57 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 58 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 59 56 60 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 57 61 -
issm/trunk/src/c/objects/Params/DoubleParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Params/DoubleVecParam.h
r3715 r3732 53 53 int MyRank(); 54 54 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 57 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 58 55 59 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 56 60 /*}}}*/ -
issm/trunk/src/c/objects/Params/IntParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Params/PetscMatParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Params/PetscVecParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Params/StringArrayParam.h
r3715 r3732 54 54 int MyRank(); 55 55 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 57 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 58 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 59 56 60 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 57 61 -
issm/trunk/src/c/objects/Params/StringParam.h
r3715 r3732 52 52 int MyRank(); 53 53 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 56 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 57 54 58 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 55 59 -
issm/trunk/src/c/objects/Result.h
r3703 r3732 44 44 Object* copy(); 45 45 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 46 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 47 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 48 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 49 46 50 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 47 51 -
issm/trunk/src/c/objects/SolPar.h
r3703 r3732 40 40 Object* copy(); 41 41 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 42 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 43 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 44 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 45 42 46 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 43 47 -
issm/trunk/src/c/objects/Vertex.h
r3703 r3732 51 51 void UpdatePosition(double* thickness,double* bed); 52 52 void UpdateInputsFromVector(double* vector, int name, int type){ISSMERROR("Not implemented yet!");} 53 void UpdateInputsFromConstant(double constant, int name){ISSMERROR("Not implemented yet!");} 54 void UpdateInputsFromConstant(int constant, int name){ISSMERROR("Not implemented yet!");} 55 void UpdateInputsFromConstant(bool constant, int name){ISSMERROR("Not implemented yet!");} 56 53 57 void UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");} 54 58 -
issm/trunk/src/c/parallel/ControlInitialization.cpp
r3717 r3732 10 10 #include "../modules.h" 11 11 12 void ControlInitialization(Model* model , ParameterInputs* inputs){12 void ControlInitialization(Model* model){ 13 13 14 14 extern int my_rank; … … 81 81 //compute slopes 82 82 if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)..."); 83 diagnostic_core_linear(&slopex,fem_sl, inputs,SlopecomputeAnalysisEnum,BedXAnalysisEnum);84 diagnostic_core_linear(&slopey,fem_sl, inputs,SlopecomputeAnalysisEnum,BedYAnalysisEnum);83 diagnostic_core_linear(&slopex,fem_sl,SlopecomputeAnalysisEnum,BedXAnalysisEnum); 84 diagnostic_core_linear(&slopey,fem_sl,SlopecomputeAnalysisEnum,BedYAnalysisEnum); 85 85 FieldExtrudex( slopex, fem_sl->elements,fem_sl->nodes,fem_sl->vertices,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopex",0); 86 86 FieldExtrudex( slopey, fem_sl->elements,fem_sl->nodes,fem_sl->vertices,fem_sl->loads,fem_sl->materials,fem_sl->parameters,"slopey",0); … … 95 95 //horizontal velocity 96 96 if(verbose)_printf_("%s\n"," computing horizontal velocities..."); 97 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh, inputs,DiagnosticAnalysisEnum,HorizAnalysisEnum);97 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_dh,DiagnosticAnalysisEnum,HorizAnalysisEnum); 98 98 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 99 99 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh-> materials,fem_dh->parameters,"velocity",1); … … 102 102 if(verbose)_printf_("%s\n"," computing vertical velocities..."); 103 103 inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes); 104 diagnostic_core_linear(&ug_vert,fem_dv, inputs,DiagnosticAnalysisEnum,VertAnalysisEnum);104 diagnostic_core_linear(&ug_vert,fem_dv,DiagnosticAnalysisEnum,VertAnalysisEnum); 105 105 106 106 //Create 3d u_g … … 113 113 //Create 4d u_g 114 114 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 115 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads, fem_dh->materials, fem_dh->parameters, inputs,DiagnosticAnalysisEnum,HorizAnalysisEnum);115 ComputePressurex( &pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads, fem_dh->materials, fem_dh->parameters,DiagnosticAnalysisEnum,HorizAnalysisEnum); 116 116 VecScale(pg,1.0/stokesreconditioning); 117 117 ug_stokes=NewVec(fem_ds->nodesets->GetGSize()); … … 133 133 if(verbose)_printf_("%s\n"," computing stokes velocities and pressure ..."); 134 134 VecFree(&ug); 135 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds, inputs,DiagnosticAnalysisEnum,StokesAnalysisEnum);135 diagnostic_core_nonlinear(&ug,NULL,NULL,NULL,fem_ds,DiagnosticAnalysisEnum,StokesAnalysisEnum); 136 136 137 137 //Add in inputs -
issm/trunk/src/c/parallel/balancedthickness.cpp
r3709 r3732 3 3 */ 4 4 5 #include "../ issm.h"5 #include "../modules.h" 6 6 #include "./parallel.h" 7 7 … … 34 34 Result* result=NULL; 35 35 36 ParameterInputs* inputs=NULL;37 36 Param* param=NULL; 38 37 … … 87 86 _printf_("call computational core:\n"); 88 87 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 89 balancedthickness_core(results,model ,inputs);88 balancedthickness_core(results,model); 90 89 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 91 90 … … 98 97 #ifdef _HAVE_DAKOTA_ 99 98 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 100 Qmux(model, inputs,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);99 Qmux(model,BalancedthicknessAnalysisEnum,NoneAnalysisEnum); 101 100 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 102 101 #else … … 124 123 delete results; 125 124 delete model; 126 delete inputs;127 125 128 126 /*Get finish time and close*/ -
issm/trunk/src/c/parallel/balancedthickness2.cpp
r3709 r3732 3 3 */ 4 4 5 #include "../ issm.h"5 #include "../modules.h" 6 6 #include "./parallel.h" 7 7 … … 33 33 Result* result=NULL; 34 34 35 ParameterInputs* inputs=NULL;36 35 Param* param=NULL; 37 36 … … 86 85 _printf_("call computational core:\n"); 87 86 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 88 balancedthickness2_core(results,model ,inputs);87 balancedthickness2_core(results,model); 89 88 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 90 89 … … 97 96 #ifdef _HAVE_DAKOTA_ 98 97 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 99 Qmux(model, inputs,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);98 Qmux(model,Balancedthickness2AnalysisEnum,NoneAnalysisEnum); 100 99 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 101 100 #else … … 123 122 delete results; 124 123 delete model; 125 delete inputs;126 124 127 125 /*Get finish time and close*/ -
issm/trunk/src/c/parallel/balancedthickness2_core.cpp
r3709 r3732 9 9 #include "../EnumDefinitions/EnumDefinitions.h" 10 10 #include "./parallel.h" 11 #include "../ issm.h"11 #include "../modules.h" 12 12 13 void balancedthickness2_core(DataSet* results,Model* model ,ParameterInputs* inputs){13 void balancedthickness2_core(DataSet* results,Model* model){ 14 14 15 15 extern int my_rank; … … 55 55 56 56 _printf_("call computational core:\n"); 57 diagnostic_core_linear(&h_g,fem_p, inputs,Balancedthickness2AnalysisEnum,NoneAnalysisEnum);57 diagnostic_core_linear(&h_g,fem_p,Balancedthickness2AnalysisEnum,NoneAnalysisEnum); 58 58 59 59 _printf_("Averaging over vertices:\n"); -
issm/trunk/src/c/parallel/balancedthickness_core.cpp
r3709 r3732 9 9 #include "../EnumDefinitions/EnumDefinitions.h" 10 10 #include "./parallel.h" 11 #include "../ issm.h"11 #include "../modules.h" 12 12 13 void balancedthickness_core(DataSet* results,Model* model ,ParameterInputs* inputs){13 void balancedthickness_core(DataSet* results,Model* model){ 14 14 15 15 extern int my_rank; … … 48 48 49 49 _printf_("call computational core:\n"); 50 diagnostic_core_linear(&h_g,fem_p, inputs,BalancedthicknessAnalysisEnum,NoneAnalysisEnum);50 diagnostic_core_linear(&h_g,fem_p,BalancedthicknessAnalysisEnum,NoneAnalysisEnum); 51 51 52 52 _printf_("extrude computed thickness on all layers:\n"); -
issm/trunk/src/c/parallel/balancedvelocities.cpp
r3709 r3732 3 3 */ 4 4 5 #include "../ issm.h"5 #include "../modules.h" 6 6 #include "./parallel.h" 7 7 … … 32 32 Result* result=NULL; 33 33 34 ParameterInputs* inputs=NULL;35 34 Param* param=NULL; 36 35 … … 85 84 _printf_("call computational core:\n"); 86 85 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 87 balancedvelocities_core(results,model ,inputs);86 balancedvelocities_core(results,model); 88 87 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 89 88 … … 96 95 #ifdef _HAVE_DAKOTA_ 97 96 MPI_Barrier(MPI_COMM_WORLD); start_core=MPI_Wtime( ); 98 Qmux(model, inputs,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);97 Qmux(model,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum); 99 98 MPI_Barrier(MPI_COMM_WORLD); finish_core=MPI_Wtime( ); 100 99 #else … … 122 121 delete results; 123 122 delete model; 124 delete inputs;125 123 126 124 /*Get finish time and close*/ -
issm/trunk/src/c/parallel/balancedvelocities_core.cpp
r3709 r3732 8 8 #include "../EnumDefinitions/EnumDefinitions.h" 9 9 #include "./parallel.h" 10 #include "../ issm.h"10 #include "../modules.h" 11 11 12 void balancedvelocities_core(DataSet* results,Model* model ,ParameterInputs* inputs){12 void balancedvelocities_core(DataSet* results,Model* model){ 13 13 14 14 extern int my_rank; … … 47 47 48 48 _printf_("call computational core:\n"); 49 diagnostic_core_linear(&v_g,fem_p, inputs,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum);49 diagnostic_core_linear(&v_g,fem_p,BalancedvelocitiesAnalysisEnum,NoneAnalysisEnum); 50 50 51 51 _printf_("extrude computed thickness on all layers:\n"); -
issm/trunk/src/c/parallel/control_core.cpp
r3717 r3732 5 5 #include "./parallel.h" 6 6 #include "../modules.h" 7 8 void control_core(DataSet* results,Model* model, ParameterInputs* inputs){ 7 #include "../EnumDefinitions/EnumDefinitions.h" 8 9 void control_core(DataSet* results,Model* model){ 9 10 10 11 extern int my_rank; … … 24 25 Vec m_g=NULL; 25 26 double search_scalar; 26 char*control_type=NULL;27 int control_type=NULL; 27 28 double* fit=NULL; 28 29 double* optscal=NULL; … … 55 56 56 57 /*Process models*/ 57 ControlInitialization(model ,inputs);58 ControlInitialization(model); 58 59 fem_model=model->GetActiveFormulation(); 59 60 … … 84 85 85 86 _printf_("\n%s%i%s%i\n"," control method step ",n+1,"/",nsteps); 86 inputs->Add(control_type,param_g,1,numberofnodes);87 inputs->Add("fit",fit[n]);88 87 model->UpdateInputsFromVector(param_g,control_type,VertexEnum); 88 model->UpdateInputsFromVector(&fit[n],FitEnum,ConstantEnum); 89 89 90 /*In case we are running a steady state control method, compute new temperature field using new parameter 90 91 * distribution: */ 91 92 if (control_steady){ 92 93 steadystate_results=new DataSet(ResultsEnum); 93 steadystate_core(steadystate_results,model ,inputs);94 steadystate_core(steadystate_results,model); 94 95 VecFree(&t_g); steadystate_results->FindResult(&t_g,"t_g"); 95 96 delete steadystate_results; 96 inputs->Add("temperature",t_g,1,numberofnodes);97 model->UpdateInputsFromVector(t_g,TemperatureEnum,VertexEnum); 97 98 } 98 99 99 /*Update parameters: */100 UpdateFromInputsx(fem_model->elements,fem_model->nodes,fem_model->vertices,fem_model->loads, fem_model->materials,fem_model->parameters,inputs);101 102 100 _printf_("%s\n"," computing gradJ..."); 103 101 gradjcompute_results=new DataSet(ResultsEnum); 104 gradjcompute_core(gradjcompute_results,model , inputs);102 gradjcompute_core(gradjcompute_results,model); 105 103 gradjcompute_results->FindResult(&grad_g,"grad_g"); 106 104 delete gradjcompute_results; … … 145 143 _printf_("%s\n"," optimizing along gradient direction"); 146 144 optargs.model=model; 147 optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs. inputs=inputs;optargs.n=n;145 optargs.param_g=param_g; optargs.grad_g=grad_g_double; optargs.n=n; 148 146 optpars.xmin=0; optpars.xmax=1; optpars.tolerance=tolx; optpars.maxiter=(int)maxiter[n];optpars.cm_jump=cm_jump[n]; 149 147 BrentSearch(&search_scalar,J+n,&optpars,&objectivefunctionC,&optargs); … … 197 195 /*Launch diagnostic with the last parameter distribution*/ 198 196 if (control_steady){ 199 inputs->Add(control_type,param_g,1,numberofnodes);197 model->UpdateInputsFromVector(param_g,control_type,VertexEnum); 200 198 steadystate_results=new DataSet(ResultsEnum); 201 steadystate_core(steadystate_results,model ,inputs);199 steadystate_core(steadystate_results,model); 202 200 203 201 //extract u_g ,t_g and m_g from steadystate results, and erase diagnostic_results; … … 210 208 inputs->Add(control_type,param_g,1,numberofnodes); 211 209 diagnostic_results=new DataSet(ResultsEnum); 212 diagnostic_core(diagnostic_results,model , inputs);210 diagnostic_core(diagnostic_results,model); 213 211 214 212 //extract u_g from diagnostic_results, and erase diagnostic_results; -
issm/trunk/src/c/parallel/convergence.cpp
r3717 r3732 5 5 #include "../objects/objects.h" 6 6 #include "../modules.h" 7 #include "../EnumDefinitions/EnumDefinitions.h" 7 8 8 void convergence( int* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){9 void convergence(double* pconverged, Mat Kff,Vec pf,Vec uf,Vec old_uf,Parameters* parameters){ 9 10 10 11 /*output*/ -
issm/trunk/src/c/parallel/diagnostic_core.cpp
r3722 r3732 13 13 14 14 extern int my_rank; 15 int dummy; 15 16 16 17 /*fem models: */ … … 34 35 Vec riftproperties=NULL; 35 36 double* u_g_initial=NULL; 37 double* vx=NULL; 38 double* vy=NULL; 39 double* vz=NULL; 36 40 37 41 /*flags: */ … … 66 70 model->FindParam(&isstokes,IsStokesEnum); 67 71 model->FindParam(&stokesreconditioning,StokesReconditioningEnum); 68 model->FindParam(&numrifts,Num riftsEnum);72 model->FindParam(&numrifts,NumRiftsEnum); 69 73 model->FindParam(&qmu_analysis,QmuAnalysisEnum); 70 74 … … 83 87 //for qmu analysis, be sure the velocity input we are starting from is the one in the parameters: */ 84 88 if(qmu_analysis){ 85 model->FindParam(&vx, VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum);86 model->FindParam(&vy, VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum);87 model->FindParam(&vz, VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum);89 model->FindParam(&vx,&dummy,VxEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vx,VxEnum,VertexEnum); 90 model->FindParam(&vy,&dummy,VyEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vy,VyEnum,VertexEnum); 91 model->FindParam(&vz,&dummy,VzEnum,DiagnosticAnalysisEnum,HorizAnalysisEnum); model->UpdateInputsFromVector(vz,VzEnum,VertexEnum); 88 92 } 93 94 /*Compute slopes: */ 95 slope_core(&surfaceslopex,&surfaceslopey,model,SurfaceAnalysisEnum); 96 slope_core(&bedslopex,&bedslopey,model,BedAnalysisEnum); 97 98 /*Update: */ 99 model->UpdateInputsFromVector(surfaceslopex,SurfaceSlopexEnum,VertexEnum); 100 model->UpdateInputsFromVector(surfaceslopey,SurfaceSlopeyEnum,VertexEnum); 101 model->UpdateInputsFromVector(bedslopex,BedSlopexEnum,VertexEnum); 102 model->UpdateInputsFromVector(bedslopey,BedSlopeyEnum,VertexEnum); 89 103 90 104 if(ishutter){ 91 105 92 slope_core(&slopex,&slopey,fem_sl,SurfaceAnalysisEnum);93 94 if(verbose)_printf_("%s\n"," adding slopes in inputs...");95 inputs->Add("surfaceslopex",slopex,numberofdofspernode_sl,numberofnodes);96 inputs->Add("surfaceslopey",slopey,numberofdofspernode_sl,numberofnodes);97 VecFree(&slopex); VecFree(&slopey);98 99 106 if(verbose)_printf_("%s\n"," computing hutter velocities..."); 100 107 diagnostic_core_linear(&ug,fem_dhu,DiagnosticAnalysisEnum,HutterAnalysisEnum); … … 128 135 129 136 if(verbose)_printf_("%s\n"," extruding horizontal velocities..."); 130 VecDuplicatePatch(&ug_horiz,ug); FieldExtrudex( ug_horiz,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1); 137 138 FieldExtrudex( ug,fem_dh->elements,fem_dh->nodes, fem_dh->vertices,fem_dh->loads,fem_dh->materials,fem_dh->parameters,"velocity",1); 131 139 140 SplitSolutionVector(ug,numberofnodes,numberofdofspernode_dh,&vx,&vy); 141 model->UpdateInputsFromVector(vx,VxEnum,VertexEnum); 142 model->UpdateInputsFromVector(vy,VyEnum,VertexEnum); 143 132 144 if(verbose)_printf_("%s\n"," computing vertical velocities..."); 133 inputs->Add("velocity",ug_horiz,numberofdofspernode_dh,numberofnodes);134 145 diagnostic_core_linear(&ug_vert,fem_dv,DiagnosticAnalysisEnum,VertAnalysisEnum); 135 136 if(verbose)_printf_("%s\n"," combining horizontal and vertical velocities..."); 137 VecFree(&ug); ug=NewVec(numberofnodes*3); 138 139 xfree((void**)&dofset); dofset=dofsetgen(2,&dof01[0],3,numberofnodes*3); VecMerge(ug,ug_horiz,dofset,numberofnodes*2); 140 xfree((void**)&dofset); dofset=dofsetgen(1,&dof2[0],3,numberofnodes*3); VecMerge(ug,ug_vert,dofset,numberofnodes*1); 141 VecFree(&ug_horiz); VecFree(&ug_vert); 146 model->UpdateInputsFromVector(ug_vert,VzEnum,VertexEnum); 142 147 143 148 if(verbose)_printf_("%s\n"," computing pressure according to Pattyn..."); 144 149 ComputePressurex(&pg,fem_dh->elements, fem_dh->nodes, fem_dh->vertices,fem_dh->loads, fem_dh->materials,fem_dh->parameters,DiagnosticAnalysisEnum,HorizAnalysisEnum); 150 model->UpdateInputsFromVector(pg,PressureEnum,VertexEnum); 145 151 146 152 if (isstokes){ … … 148 154 //"recondition" pressure 149 155 VecScale(pg,1.0/stokesreconditioning); 150 151 if(verbose)_printf_("%s\n","computing bed slope (x and y derivatives)...");152 slope_core(&slopex,&slopey,fem_sl,BedAnalysisEnum);153 154 inputs->Add("bedslopex",slopex,numberofdofspernode_sl,numberofnodes);155 inputs->Add("bedslopey",slopey,numberofdofspernode_sl,numberofnodes);156 VecFree(&slopex); VecFree(&slopey);157 158 //recombine ug and pg:159 ug_stokes=NewVec(fem_ds->nodesets->GetGSize());160 xfree((void**)&dofset);dofset=dofsetgen(3,dof012,4,numberofnodes*4); VecMerge(ug_stokes,ug,dofset,numberofnodes*3);161 xfree((void**)&dofset); dofset=dofsetgen(1,dof3,4,numberofnodes*4); VecMerge(ug_stokes,pg,dofset,numberofnodes);162 163 inputs->Add("velocity",ug_stokes,numberofdofspernode_ds,numberofnodes);164 VecFree(&ug_stokes);165 156 166 157 if(verbose)_printf_("%s\n"," update boundary conditions for stokes using velocities previously computed..."); -
issm/trunk/src/c/parallel/diagnostic_core_linear.cpp
r3717 r3732 8 8 #include "../modules.h" 9 9 10 void diagnostic_core_linear(Vec* pug,FemModel* fem, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){10 void diagnostic_core_linear(Vec* pug,FemModel* fem,int analysis_type,int sub_analysis_type){ 11 11 12 12 /*parameters:*/ … … 33 33 fem->parameters->FindParam(&solver_string,SolverStringEnum); 34 34 35 /*Update parameters: */36 UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,fem->loads, fem->materials,fem->parameters,inputs);37 38 35 //*Generate system matrices 39 36 if (verbose) _printf_(" Generating matrices\n"); 40 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode, inputs,analysis_type,sub_analysis_type);37 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type); 41 38 42 39 if (verbose) _printf_(" Generating penalty matrices\n"); 43 40 //*Generate penalty system matrices 44 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag, inputs,analysis_type,sub_analysis_type);41 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type); 45 42 46 43 /*!Reduce matrix from g to f size:*/ -
issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp
r3717 r3732 9 9 #include "./parallel.h" 10 10 11 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, DataSet* input_loads,FemModel* fem, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){11 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, DataSet* input_loads,FemModel* fem,int analysis_type,int sub_analysis_type){ 12 12 13 13 … … 37 37 char* solver_string=NULL; 38 38 int verbose=0; 39 int dofs[4]={1,1,0,0}; //recover vx,vy by default. vz and pressure may be.40 39 41 40 /*Recover parameters: */ … … 57 56 } 58 57 59 /*Initialize ug, uf, ug_old and uf_old */60 if (numberofdofspernode>=3)dofs[2]=1;//only keep vz if running with more than 3 dofs per node61 if (numberofdofspernode==4)dofs[3]=1;//only keep vz and presure if running with more than 3 dofs per node62 ug=inputs->Get("velocity",&dofs[0],4);63 VecDuplicate(ug,&old_ug); VecCopy(ug,old_ug);64 Reducevectorgtofx(&uf,ug,fem->nodesets);65 VecDuplicate(uf,&old_uf); VecCopy(uf,old_uf);66 67 58 count=1; 68 59 converged=0; 69 60 for(;;){ 70 71 if (verbose) _printf_(" Updating inputs\n");72 73 /*Set input parameters: */74 if(old_ug)inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);75 if(ug)inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);76 61 77 62 //save pointer to old velocity … … 79 64 VecFree(&old_uf);old_uf=uf; 80 65 81 /*Update parameters: */82 UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,loads, fem->materials,fem->parameters,inputs);83 84 66 if (verbose) _printf_(" Generating matrices\n"); 85 67 //*Generate system matrices 86 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode, inputs,analysis_type,sub_analysis_type);68 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type); 87 69 88 70 if (verbose) _printf_(" Generating penalty matrices\n"); 89 71 //*Generate penalty system matrices 90 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag, inputs,analysis_type,sub_analysis_type);72 PenaltySystemMatricesx(Kgg, pg,NULL,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type); 91 73 92 74 if (verbose) _printf_(" reducing matrix from g to f set\n"); … … 113 95 Mergesolutionfromftogx(&ug, uf,fem->Gmn,fem->ys,fem->nodesets); 114 96 97 //Update inputs using new solution: 98 fem->UpdateInputsFromSolution(ug,analysis_type,sub_analysis_type); 99 115 100 //Deal with penalty loads 116 101 if (verbose) _printf_(" penalty constraints\n"); 117 if (old_ug) inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes); 118 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes); 119 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 102 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,analysis_type,sub_analysis_type); 120 103 121 104 //if(verbose)_printf_(" number of unstable constraints: %i\n",num_unstable_constraints); … … 127 110 128 111 /*add converged to inputs: */ 129 inputs->Add("converged",converged);112 fem->UpdateInputsFromVector(&converged,ConvergedEnum,ConstantEnum); 130 113 131 114 //rift convergence … … 150 133 if(pKff0){ 151 134 152 /*Set input parameters: */153 inputs->Add("old_velocity",old_ug,numberofdofspernode,numberofnodes);154 inputs->Add("velocity",ug,numberofdofspernode,numberofnodes);155 156 135 kflag=1; pflag=0; //stiffness generation only 157 136 158 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode, inputs,analysis_type,sub_analysis_type);137 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type); 159 138 Reducematrixfromgtofx(&Kff,&Kfs,Kgg,fem->Gmn,fem->nodesets); 160 139 MatFree(&Kgg);VecFree(&pg); -
issm/trunk/src/c/parallel/gradjcompute_core.cpp
r3717 r3732 5 5 #include "../modules.h" 6 6 #include "./parallel.h" 7 #include "../EnumDefinitions/EnumDefinitions.h" 7 8 8 9 #ifdef HAVE_CONFIG_H -
issm/trunk/src/c/parallel/slope_core.cpp
r3721 r3732 8 8 #include "../modules.h" 9 9 10 void slope_core(Vec* pslopex,Vec* pslopey, FemModel* fem,int AnalysisEnum){10 void slope_core(Vec* pslopex,Vec* pslopey,Model* model,int AnalysisEnum){ 11 11 12 12 /*parameters: */ … … 20 20 Vec slopey=NULL; 21 21 22 fem->parameters->FindParam(&verbose,VerboseEnum); 23 fem->parameters->FindParam(&dim,DimEnum); 22 /*femmodel used to compute slopes: */ 23 FemModel* fem=NULL; 24 25 /*Recover fem model: */ 26 fem=model->fem_sl; 27 28 29 /*Recover some parameters: */ 30 model->parameters->FindParam(&verbose,VerboseEnum); 31 model->parameters->FindParam(&dim,DimEnum); 32 model->parameters->FindParam(&isstokes,DimEnum); 33 model->parameters->FindParam(&ishutter,DimEnum); 24 34 25 35 if(verbose)_printf_("%s\n","computing surface slope (x and y derivatives)..."); 26 36 37 /*Specify type of computations: */ 27 38 if(AnalysisEnum==SurfaceAnalysisEnum){ 28 39 xanalysis=SurfaceXAnalysisEnum; … … 35 46 else ISSMERROR("%s%s%s"," analysis ",EnumAsString(AnalysisEnum)," not supported yet!"); 36 47 48 49 /*Early return possible? */ 50 if(!ishutter && AnalysisEnum==SurfaceAnalysisEnum){ 51 /*no need to compute Surface Slope except for Hutter: */ 52 *pslopex=NULL; 53 *pslopey=NULL; 54 return; 55 } 56 if(!isstokes && AnalysisEnum==BedAnalysisEnum){ 57 /*no need to compute Bed Slope except for full Stokes: */ 58 *pslopex=NULL; 59 *pslopey=NULL; 60 } 61 62 63 /*Call on core computations: */ 37 64 diagnostic_core_linear(&slopex,fem,SlopecomputeAnalysisEnum,xanalysis); 38 65 diagnostic_core_linear(&slopey,fem,SlopecomputeAnalysisEnum,yanalysis); 39 66 40 67 /*extrude if we are in 3D: */ 41 68 if (dim==3){ 42 43 69 if(verbose)_printf_("%s\n","extruding slopes in 3d..."); 44 70 FieldExtrudex( slopex, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,"slopex",0); -
issm/trunk/src/c/parallel/thermal_core_nonlinear.cpp
r3717 r3732 8 8 #include "../modules.h" 9 9 10 void thermal_core_nonlinear(Vec* ptg,double* pmelting_offset,FemModel* fem, ParameterInputs* inputs,int analysis_type,int sub_analysis_type){10 void thermal_core_nonlinear(Vec* ptg,double* pmelting_offset,FemModel* fem,int analysis_type,int sub_analysis_type){ 11 11 12 12 /*solution : */ … … 56 56 if(verbose)_printf_("%s\n","starting direct shooting method"); 57 57 58 if(count==1) inputs->Add("reset_penalties",1); 59 else inputs->Add("reset_penalties",0); 60 61 /*Update parameters: */ 62 UpdateFromInputsx(fem->elements,fem->nodes,fem->vertices,fem->loads, fem->materials,fem->parameters,inputs); 58 if(count==1) reset_penalties=1; else reset_penalties=0; 59 fem->UpdateInputsFromVector(&reset_penalties,ResetPenaltiesEnum,ConstantEnum); 63 60 64 61 //*Generate system matrices … … 67 64 /*Compute Kgg_nopenalty and pg_nopenalty once for all: */ 68 65 if (count==1){ 69 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode, inputs,analysis_type,sub_analysis_type);66 SystemMatricesx(&Kgg_nopenalty, &pg_nopenalty,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type); 70 67 } 71 68 … … 75 72 76 73 //apply penalties each time 77 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag, inputs,analysis_type,sub_analysis_type);74 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type); 78 75 } 79 76 else{ 80 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode, inputs,analysis_type,sub_analysis_type);77 SystemMatricesx(&Kgg, &pg,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,connectivity,numberofdofspernode,analysis_type,sub_analysis_type); 81 78 //apply penalties 82 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag, inputs,analysis_type,sub_analysis_type);79 PenaltySystemMatricesx(Kgg, pg,&melting_offset,fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,kflag,pflag,analysis_type,sub_analysis_type); 83 80 } 84 81 … … 112 109 //Deal with penalty loads 113 110 if (verbose) _printf_(" penalty constraints\n"); 111 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type); 112 114 113 inputs->Add("temperature",tg,numberofdofspernode,numberofnodes); 115 116 PenaltyConstraintsx(&constraints_converged, &num_unstable_constraints, fem->elements,fem->nodes,fem->vertices,fem->loads,fem->materials,fem->parameters,inputs,analysis_type,sub_analysis_type);117 114 118 115 if (!converged){ -
issm/trunk/src/c/shared/Numerics/numerics.h
r3727 r3732 9 9 #include "./SplitSolutionVector.h" 10 10 #include "./isnan.h" 11 #include "./SplitSolutionVector.h" 11 12 12 13 struct OptArgs;
Note:
See TracChangeset
for help on using the changeset viewer.