Changeset 3713


Ignore:
Timestamp:
05/11/10 09:41:42 (15 years ago)
Author:
Eric.Larour
Message:

More commits

Location:
issm/trunk/src
Files:
1 deleted
30 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Bamgx/Bamgx.cpp

    r3332 r3713  
    33 */
    44#include "./Bamgx.h"
     5#include "../objects/objects.h"
    56#include "../shared/shared.h"
    67#include "../include/macros.h"
    78#include "../toolkits/toolkits.h"
     9#include "./objects/BamgObjects.h"
    810
    911using namespace bamg;
  • issm/trunk/src/c/EnumDefinitions/EnumAsString.cpp

    r3701 r3713  
    1010#include "../shared/shared.h"
    1111#include "../include/macros.h"
    12 #include "./EnumDefinition.h"
     12#include "./EnumDefinitions.h"
    1313
    1414char* EnumAsString(int en){
     
    370370                case VerboseEnum :
    371371                        return "Verbose";
     372                case EpsResEnum :
     373                        return "EpsRes";
     374                case EpsRelEnum :
     375                        return "EpsRel";
     376                case EpsAbsEnum :
     377                        return "EpsAbs";
    372378                case EpsCmEnum :
    373379                        return "EpsCm";
  • issm/trunk/src/c/EnumDefinitions/StringAsEnum.cpp

    r3701 r3713  
    1010#include "../shared/shared.h"
    1111#include "../include/macros.h"
    12 #include "./EnumDefinition.h"
     12#include "./EnumDefinitions.h"
    1313
    1414int  StringAsEnum(char* name){
     
    191191        else if (strcmp(name,"IsStokes")==0) return IsStokesEnum;
    192192        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;
    193196        else if (strcmp(name,"EpsCm")==0) return EpsCmEnum;
    194197        else if (strcmp(name,"MaxNonlinearIterations")==0) return MaxNonlinearIterationsEnum;
     
    233236        else if (strcmp(name,"ResponseDescriptors")==0) return ResponseDescriptorsEnum;
    234237        else if (strcmp(name,"DakotaParameter")==0) return DakotaParameterEnum;
    235         else ISSMERROR("Enum %i not found",en);
     238        else ISSMERROR("Enum %i not found",name);
    236239
    237240}
  • issm/trunk/src/c/EnumDefinitions/SynchronizeStrings.sh

    r3678 r3713  
    2222#include "../shared/shared.h"
    2323#include "../include/macros.h"
    24 #include "./EnumDefinition.h"
     24#include "./EnumDefinitions.h"
    2525
    2626char* EnumAsString(int en){
     
    4343#include "../shared/shared.h"
    4444#include "../include/macros.h"
    45 #include "./EnumDefinition.h"
     45#include "./EnumDefinitions.h"
    4646
    4747int  StringAsEnum(char* name){
     
    110110#Add footer of of StringAsEnum.cpp{{{1
    111111cat <<END >> StringAsEnum.cpp
    112         else ISSMERROR("Enum %i not found",en);
     112        else ISSMERROR("Enum %i not found",name);
    113113
    114114}
  • issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp

    r3703 r3713  
    3333                 ISSMERROR("control_type %s not supported yet!",iomodel->control_type);
    3434
    35                 parameters->AddObject(new   BoolParam(ControlSteadyEnum,false));
    36                 parameters->AddObject(new    IntParam(NSteps,iomodel->nsteps));
     35                parameters->AddObject(new BoolParam(ControlSteadyEnum,false));
     36                parameters->AddObject(new IntParam(NSteps,iomodel->nsteps));
    3737                parameters->AddObject(new DoubleParam(TolXEnum,iomodel->tolx));
    3838                parameters->AddObject(new DoubleParam(EpsCmEnum,iomodel->eps_cm));
     
    4545                parameters->AddObject(new DoubleParam(CmMinEnum,iomodel->cm_min));
    4646                parameters->AddObject(new DoubleParam(CmMaxEnum,iomodel->cm_max));
    47                 parameters->AddObject(new   BoolParam(CmGradientEnum,iomodel->cm_gradient));
     47                parameters->AddObject(new BoolParam(CmGradientEnum,iomodel->cm_gradient));
    4848
    4949                /*Now, recover fit, optscal and maxiter as vectors: */
  • issm/trunk/src/c/ModelProcessorx/CreateParameters.cpp

    r3708 r3713  
    6767                                iomodel->analysis_type==Balancedthickness2AnalysisEnum
    6868                                )
    69          parameters->AddObject(new    IntParam(NumberOfNodesEnum,3*iomodel->numberofelements));
     69                parameters->AddObject(new    IntParam(NumberOfNodesEnum,3*iomodel->numberofelements));
    7070        else parameters->AddObject(new    IntParam(NumberOfNodesEnum,iomodel->numberofvertices));
    7171
  • issm/trunk/src/c/ModelProcessorx/CreateSingleNodeToElementConnectivity.cpp

    r3679 r3713  
    99#endif
    1010
    11 #include "./IoModel.h"
    1211#include "../shared/shared.h"
     12#include "../io/io.h"
    1313#include "../include/macros.h"
    1414#include "../include/typedefs.h"
    1515#include "./ModelProcessorx.h"
    1616
    17 CreateSingleNodeToElementConnectivity(IoModel* iomodel){
     17void CreateSingleNodeToElementConnectivity(IoModel* iomodel){
    1818
    1919        /*Intermediary*/
     
    3030
    3131        /*Allocate ouput*/
    32         connectivity=(double*)xcalloc(iomodel->numberofvertices*sizeof(double));
     32        connectivity=(double*)xcalloc(iomodel->numberofvertices,sizeof(double));
    3333
    3434        if (strcmp(iomodel->meshtype,"2d")==0){
    3535                for (i=0;i<iomodel->numberofelements;i++){
    3636                        for (j=0;j<3;j++){
    37                                 vertexid=iomodel->elements[3*i+j];
     37                                vertexid=(int)iomodel->elements[3*i+j];
    3838                                ISSMASSERT(vertexid-1<iomodel->numberofvertices);
    3939                                connectivity[vertexid-1]=i;
     
    4444                for (i=0;i<iomodel->numberofelements;i++){
    4545                        for (j=0;j<6;j++){
    46                                 vertexid=iomodel->elements[6*i+j];
     46                                vertexid=(int)iomodel->elements[6*i+j];
    4747                                ISSMASSERT(vertexid-1<iomodel->numberofvertices);
    4848                                connectivity[vertexid-1]=i;
  • issm/trunk/src/c/ModelProcessorx/ModelProcessorx.h

    r3701 r3713  
    77
    88#define RIFTINFOSIZE 11
     9
     10class DataSet;
     11class IoModel;
     12class Parameters;
     13#include "../io/io.h"
     14
    915
    1016/*Creation of fem datasets: general drivers*/
  • issm/trunk/src/c/ProcessParamsx/ProcessParamsx.cpp

    r3703 r3713  
    1818
    1919       
    20         double* partition=NULL;
    21         Param*  param=NULL;
     20        int     i;
     21        double *partition        = NULL;
     22        int     numberofvertices;
     23        Param  *param            = NULL;
    2224
    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: */
    3426        parameters->FindParam(&numberofvertices,NumberOfVerticesEnum);
    3527
     
    3931        for(i=0;i<parameters->Size();i++){
    4032
    41                 param_type=parameters->GetEnum(i);
     33                param=(Param*)parameters->GetObjectByOffset(i);
     34                param->Process(partition,numberofvertices);
    4235
    43                 if(param_type==ParamEnum){
     36        }
    4437
    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(&parameter);
    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**)&parameter);
    73 
    74                                 }
    75                         }
    76                 }
    77         }
     38        /*Free ressources:*/
    7839        xfree((void**)&partition);
    7940
  • issm/trunk/src/c/io/FetchParams.cpp

    r3685 r3713  
    1818#include "../EnumDefinitions/EnumDefinitions.h"
    1919
    20 void FetchParams(DataSet** pparameters, DataHandle dataref){
     20void FetchParams(Parameters** pparameters, DataHandle dataref){
    2121
    2222        int i,j;
  • issm/trunk/src/c/io/io.h

    r3685 r3713  
    5252
    5353void FetchNodeSets(NodeSets** pnodesets,ConstDataHandle dataref);
    54 void FetchParams(DataSet** pparameters, DataHandle dataref);
     54void FetchParams(Parameters** pparameters, DataHandle dataref);
    5555
    5656#endif
  • issm/trunk/src/c/objects/Params/BoolParam.cpp

    r3683 r3713  
    140140}
    141141/*}}}*/
     142/*FUNCTION BoolParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     143void  BoolParam::Process(double* partition,int numberofvertices){
     144}
     145/*}}}*/
  • issm/trunk/src/c/objects/Params/BoolParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/DoubleMatParam.cpp

    r3683 r3713  
    195195}
    196196/*}}}*/
     197/*FUNCTION DoubleMatParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     198void  DoubleMatParam::Process(double* partition,int numberofvertices){
     199}
     200/*}}}*/
  • issm/trunk/src/c/objects/Params/DoubleMatParam.h

    r3703 r3713  
    5858                char* GetParameterName(void);
    5959                void  SetMatlabField(mxArray* dataref);
     60                void  Process(double* partition,int numberofvertices);
    6061                /*}}}*/
    6162};
  • issm/trunk/src/c/objects/Params/DoubleParam.cpp

    r3683 r3713  
    138138}
    139139/*}}}*/
     140/*FUNCTION DoubleParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     141void  DoubleParam::Process(double* partition,int numberofvertices){
     142}
     143/*}}}*/
  • issm/trunk/src/c/objects/Params/DoubleParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/DoubleVecParam.cpp

    r3697 r3713  
    145145void  DoubleVecParam::GetParameterValue(double** pdoublearray,int* pM){
    146146        double* output=NULL;
    147         double M;
     147        int M;
    148148
    149149
     
    185185}
    186186/*}}}*/
     187/*FUNCTION DoubleVecParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     188void  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  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/IntParam.cpp

    r3683 r3713  
    142142}
    143143/*}}}*/
     144/*FUNCTION IntParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     145void  IntParam::Process(double* partition,int numberofvertices){
     146}
     147/*}}}*/
  • issm/trunk/src/c/objects/Params/IntParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/Param.h

    r3703 r3713  
    3232                virtual char* GetParameterName(void)=0;
    3333                virtual void  SetMatlabField(mxArray* dataref)=0;
     34                virtual void  Process(double* partition,int numberofvertices)=0;
    3435
    3536                /*}}}*/
  • issm/trunk/src/c/objects/Params/PetscMatParam.cpp

    r3683 r3713  
    223223}
    224224/*}}}*/
     225/*FUNCTION PetscMatParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     226void  PetscMatParam::Process(double* partition,int numberofvertices){
     227}
     228/*}}}*/
  • issm/trunk/src/c/objects/Params/PetscMatParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/PetscVecParam.cpp

    r3683 r3713  
    217217}
    218218/*}}}*/
     219/*FUNCTION PetscVecParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     220void  PetscVecParam::Process(double* partition,int numberofvertices){
     221}
     222/*}}}*/
  • issm/trunk/src/c/objects/Params/PetscVecParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
  • issm/trunk/src/c/objects/Params/StringArrayParam.cpp

    r3683 r3713  
    249249}
    250250/*}}}*/
     251/*FUNCTION StringArrayParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     252void  StringArrayParam::Process(double* partition,int numberofvertices){
     253}
     254/*}}}*/
  • issm/trunk/src/c/objects/Params/StringArrayParam.h

    r3703 r3713  
    5858                char* GetParameterName(void);
    5959                void  SetMatlabField(mxArray* dataref);
     60                void  Process(double* partition,int numberofvertices);
    6061                /*}}}*/
    6162};
  • issm/trunk/src/c/objects/Params/StringParam.cpp

    r3683 r3713  
    176176}
    177177/*}}}*/
     178/*FUNCTION StringParam::ProcessParams(double* partition,int numberofvertices);{{{1*/
     179void  StringParam::Process(double* partition,int numberofvertices){
     180}
     181/*}}}*/
  • issm/trunk/src/c/objects/Params/StringParam.h

    r3703 r3713  
    5656                char* GetParameterName(void);
    5757                void  SetMatlabField(mxArray* dataref);
     58                void  Process(double* partition,int numberofvertices);
    5859                /*}}}*/
    5960};
Note: See TracChangeset for help on using the changeset viewer.