Changeset 3713
- Timestamp:
- 05/11/10 09:41:42 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/Bamgx/Bamgx.cpp
r3332 r3713 3 3 */ 4 4 #include "./Bamgx.h" 5 #include "../objects/objects.h" 5 6 #include "../shared/shared.h" 6 7 #include "../include/macros.h" 7 8 #include "../toolkits/toolkits.h" 9 #include "./objects/BamgObjects.h" 8 10 9 11 using namespace bamg; -
issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp
r3701 r3713 10 10 #include "../shared/shared.h" 11 11 #include "../include/macros.h" 12 #include "./EnumDefinition .h"12 #include "./EnumDefinitions.h" 13 13 14 14 char* EnumAsString(int en){ … … 370 370 case VerboseEnum : 371 371 return "Verbose"; 372 case EpsResEnum : 373 return "EpsRes"; 374 case EpsRelEnum : 375 return "EpsRel"; 376 case EpsAbsEnum : 377 return "EpsAbs"; 372 378 case EpsCmEnum : 373 379 return "EpsCm"; -
issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp
r3701 r3713 10 10 #include "../shared/shared.h" 11 11 #include "../include/macros.h" 12 #include "./EnumDefinition .h"12 #include "./EnumDefinitions.h" 13 13 14 14 int StringAsEnum(char* name){ … … 191 191 else if (strcmp(name,"IsStokes")==0) return IsStokesEnum; 192 192 else if (strcmp(name,"Verbose")==0) return VerboseEnum; 193 else if (strcmp(name,"EpsRes")==0) return EpsResEnum; 194 else if (strcmp(name,"EpsRel")==0) return EpsRelEnum; 195 else if (strcmp(name,"EpsAbs")==0) return EpsAbsEnum; 193 196 else if (strcmp(name,"EpsCm")==0) return EpsCmEnum; 194 197 else if (strcmp(name,"MaxNonlinearIterations")==0) return MaxNonlinearIterationsEnum; … … 233 236 else if (strcmp(name,"ResponseDescriptors")==0) return ResponseDescriptorsEnum; 234 237 else if (strcmp(name,"DakotaParameter")==0) return DakotaParameterEnum; 235 else ISSMERROR("Enum %i not found", en);238 else ISSMERROR("Enum %i not found",name); 236 239 237 240 } -
issm/trunk/src/c/EnumDefinitions/SynchronizeStrings.sh
r3678 r3713 22 22 #include "../shared/shared.h" 23 23 #include "../include/macros.h" 24 #include "./EnumDefinition .h"24 #include "./EnumDefinitions.h" 25 25 26 26 char* EnumAsString(int en){ … … 43 43 #include "../shared/shared.h" 44 44 #include "../include/macros.h" 45 #include "./EnumDefinition .h"45 #include "./EnumDefinitions.h" 46 46 47 47 int StringAsEnum(char* name){ … … 110 110 #Add footer of of StringAsEnum.cpp{{{1 111 111 cat <<END >> StringAsEnum.cpp 112 else ISSMERROR("Enum %i not found", en);112 else ISSMERROR("Enum %i not found",name); 113 113 114 114 } -
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r3703 r3713 33 33 ISSMERROR("control_type %s not supported yet!",iomodel->control_type); 34 34 35 parameters->AddObject(new 36 parameters->AddObject(new 35 parameters->AddObject(new BoolParam(ControlSteadyEnum,false)); 36 parameters->AddObject(new IntParam(NSteps,iomodel->nsteps)); 37 37 parameters->AddObject(new DoubleParam(TolXEnum,iomodel->tolx)); 38 38 parameters->AddObject(new DoubleParam(EpsCmEnum,iomodel->eps_cm)); … … 45 45 parameters->AddObject(new DoubleParam(CmMinEnum,iomodel->cm_min)); 46 46 parameters->AddObject(new DoubleParam(CmMaxEnum,iomodel->cm_max)); 47 parameters->AddObject(new 47 parameters->AddObject(new BoolParam(CmGradientEnum,iomodel->cm_gradient)); 48 48 49 49 /*Now, recover fit, optscal and maxiter as vectors: */ -
issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp
r3708 r3713 67 67 iomodel->analysis_type==Balancedthickness2AnalysisEnum 68 68 ) 69 69 parameters->AddObject(new IntParam(NumberOfNodesEnum,3*iomodel->numberofelements)); 70 70 else parameters->AddObject(new IntParam(NumberOfNodesEnum,iomodel->numberofvertices)); 71 71 -
issm/trunk/src/c/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp
r3679 r3713 9 9 #endif 10 10 11 #include "./IoModel.h"12 11 #include "../shared/shared.h" 12 #include "../io/io.h" 13 13 #include "../include/macros.h" 14 14 #include "../include/typedefs.h" 15 15 #include "./ModelProcessorx.h" 16 16 17 CreateSingleNodeToElementConnectivity(IoModel* iomodel){17 void CreateSingleNodeToElementConnectivity(IoModel* iomodel){ 18 18 19 19 /*Intermediary*/ … … 30 30 31 31 /*Allocate ouput*/ 32 connectivity=(double*)xcalloc(iomodel->numberofvertices *sizeof(double));32 connectivity=(double*)xcalloc(iomodel->numberofvertices,sizeof(double)); 33 33 34 34 if (strcmp(iomodel->meshtype,"2d")==0){ 35 35 for (i=0;i<iomodel->numberofelements;i++){ 36 36 for (j=0;j<3;j++){ 37 vertexid= iomodel->elements[3*i+j];37 vertexid=(int)iomodel->elements[3*i+j]; 38 38 ISSMASSERT(vertexid-1<iomodel->numberofvertices); 39 39 connectivity[vertexid-1]=i; … … 44 44 for (i=0;i<iomodel->numberofelements;i++){ 45 45 for (j=0;j<6;j++){ 46 vertexid= iomodel->elements[6*i+j];46 vertexid=(int)iomodel->elements[6*i+j]; 47 47 ISSMASSERT(vertexid-1<iomodel->numberofvertices); 48 48 connectivity[vertexid-1]=i; -
issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h
r3701 r3713 7 7 8 8 #define RIFTINFOSIZE 11 9 10 class DataSet; 11 class IoModel; 12 class Parameters; 13 #include "../io/io.h" 14 9 15 10 16 /*Creation of fem datasets: general drivers*/ -
issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp
r3703 r3713 18 18 19 19 20 double* partition=NULL; 21 Param* param=NULL; 20 int i; 21 double *partition = NULL; 22 int numberofvertices; 23 Param *param = NULL; 22 24 23 /*diverse: */ 24 int numberofvertices; 25 int i,j,k; 26 int ndof; 27 int param_type; 28 29 /*processing of parameters: */ 30 double* parameter=NULL; 31 double* new_parameter=NULL; 32 33 /*Some parameters needed: */ 25 /*Need number of vertices to repartition DoubleVecParam objects: */ 34 26 parameters->FindParam(&numberofvertices,NumberOfVerticesEnum); 35 27 … … 39 31 for(i=0;i<parameters->Size();i++){ 40 32 41 param_type=parameters->GetEnum(i); 33 param=(Param*)parameters->GetObjectByOffset(i); 34 param->Process(partition,numberofvertices); 42 35 43 if(param_type==ParamEnum){36 } 44 37 45 Param* param=(Param*)parameters->GetObjectByOffset(i); 46 47 if (param->GetType()==DOUBLEVEC){ 48 49 ndof=param->GetNdof(); 50 51 if (ndof!=0){ /*ok, we are dealing with a parameter that needs to be repartitioned, for ndof degrees of freedom: */ 52 53 new_parameter=(double*)xcalloc(numberofvertices*ndof,sizeof(double)); 54 param->GetParameterValue(¶meter); 55 56 for(j=0;j<ndof;j++){ 57 58 for(k=0;k<numberofvertices;k++){ 59 60 new_parameter[(int)(ndof*partition[k]+j)]=parameter[ndof*k+j]; 61 62 } 63 64 } 65 66 67 /*Now, replace old parameter with new parameter: */ 68 param->SetDoubleVec(new_parameter,ndof*numberofvertices,ndof); 69 70 /*Free ressources: */ 71 xfree((void**)&new_parameter); 72 xfree((void**)¶meter); 73 74 } 75 } 76 } 77 } 38 /*Free ressources:*/ 78 39 xfree((void**)&partition); 79 40 -
issm/trunk/src/c/io/FetchParams.cpp
r3685 r3713 18 18 #include "../EnumDefinitions/EnumDefinitions.h" 19 19 20 void FetchParams( DataSet** pparameters, DataHandle dataref){20 void FetchParams(Parameters** pparameters, DataHandle dataref){ 21 21 22 22 int i,j; -
issm/trunk/src/c/io/io.h
r3685 r3713 52 52 53 53 void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref); 54 void FetchParams( DataSet** pparameters, DataHandle dataref);54 void FetchParams(Parameters** pparameters, DataHandle dataref); 55 55 56 56 #endif -
issm/trunk/src/c/objects/Params/BoolParam.cpp
r3683 r3713 140 140 } 141 141 /*}}}*/ 142 /*FUNCTION BoolParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 143 void BoolParam::Process(double* partition,int numberofvertices){ 144 } 145 /*}}}*/ -
issm/trunk/src/c/objects/Params/BoolParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/DoubleMatParam.cpp
r3683 r3713 195 195 } 196 196 /*}}}*/ 197 /*FUNCTION DoubleMatParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 198 void DoubleMatParam::Process(double* partition,int numberofvertices){ 199 } 200 /*}}}*/ -
issm/trunk/src/c/objects/Params/DoubleMatParam.h
r3703 r3713 58 58 char* GetParameterName(void); 59 59 void SetMatlabField(mxArray* dataref); 60 void Process(double* partition,int numberofvertices); 60 61 /*}}}*/ 61 62 }; -
issm/trunk/src/c/objects/Params/DoubleParam.cpp
r3683 r3713 138 138 } 139 139 /*}}}*/ 140 /*FUNCTION DoubleParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 141 void DoubleParam::Process(double* partition,int numberofvertices){ 142 } 143 /*}}}*/ -
issm/trunk/src/c/objects/Params/DoubleParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/DoubleVecParam.cpp
r3697 r3713 145 145 void DoubleVecParam::GetParameterValue(double** pdoublearray,int* pM){ 146 146 double* output=NULL; 147 doubleM;147 int M; 148 148 149 149 … … 185 185 } 186 186 /*}}}*/ 187 /*FUNCTION DoubleVecParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 188 void DoubleVecParam::Process(double* partition,int numberofvertices) { 189 190 int i; 191 double* newvalue=NULL; 192 193 /*This param holds a vector of size numberofvertices, which means we are being asked to 194 * repartition it: */ 195 196 if(this->M==numberofvertices){ 197 198 newvalue=(double*)xmalloc(this->M*sizeof(double)); 199 200 for(i=0;i<this->M;i++){ 201 newvalue[(int)(partition[i])]=this->value[i]; 202 } 203 204 /*Reassign value to new value: */ 205 xfree((void**)&this->value); 206 this->value=newvalue; 207 } 208 209 } 210 /*}}}*/ -
issm/trunk/src/c/objects/Params/DoubleVecParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/IntParam.cpp
r3683 r3713 142 142 } 143 143 /*}}}*/ 144 /*FUNCTION IntParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 145 void IntParam::Process(double* partition,int numberofvertices){ 146 } 147 /*}}}*/ -
issm/trunk/src/c/objects/Params/IntParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/Param.h
r3703 r3713 32 32 virtual char* GetParameterName(void)=0; 33 33 virtual void SetMatlabField(mxArray* dataref)=0; 34 virtual void Process(double* partition,int numberofvertices)=0; 34 35 35 36 /*}}}*/ -
issm/trunk/src/c/objects/Params/PetscMatParam.cpp
r3683 r3713 223 223 } 224 224 /*}}}*/ 225 /*FUNCTION PetscMatParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 226 void PetscMatParam::Process(double* partition,int numberofvertices){ 227 } 228 /*}}}*/ -
issm/trunk/src/c/objects/Params/PetscMatParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/PetscVecParam.cpp
r3683 r3713 217 217 } 218 218 /*}}}*/ 219 /*FUNCTION PetscVecParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 220 void PetscVecParam::Process(double* partition,int numberofvertices){ 221 } 222 /*}}}*/ -
issm/trunk/src/c/objects/Params/PetscVecParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 }; -
issm/trunk/src/c/objects/Params/StringArrayParam.cpp
r3683 r3713 249 249 } 250 250 /*}}}*/ 251 /*FUNCTION StringArrayParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 252 void StringArrayParam::Process(double* partition,int numberofvertices){ 253 } 254 /*}}}*/ -
issm/trunk/src/c/objects/Params/StringArrayParam.h
r3703 r3713 58 58 char* GetParameterName(void); 59 59 void SetMatlabField(mxArray* dataref); 60 void Process(double* partition,int numberofvertices); 60 61 /*}}}*/ 61 62 }; -
issm/trunk/src/c/objects/Params/StringParam.cpp
r3683 r3713 176 176 } 177 177 /*}}}*/ 178 /*FUNCTION StringParam::ProcessParams(double* partition,int numberofvertices);{{{1*/ 179 void StringParam::Process(double* partition,int numberofvertices){ 180 } 181 /*}}}*/ -
issm/trunk/src/c/objects/Params/StringParam.h
r3703 r3713 56 56 char* GetParameterName(void); 57 57 void SetMatlabField(mxArray* dataref); 58 void Process(double* partition,int numberofvertices); 58 59 /*}}}*/ 59 60 };
Note:
See TracChangeset
for help on using the changeset viewer.