Changeset 20134


Ignore:
Timestamp:
02/11/16 19:38:56 (9 years ago)
Author:
Eric.Larour
Message:

CHG: fixed issue with mesh3dsurface in the Node.cpp class.
Also simplified FemModel to not include the communicators in the structure, but rather in the parameters dataset.

Location:
issm/trunk-jpl/src/c/classes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r20043 r20134  
    5858
    5959        /*First things first, store the communicator, and set it as a global variable: */
    60         this->comm=incomm;
    61         this->SetStaticComm();
     60        IssmComm::SetComm(incomm);
    6261
    6362        /*Now, initialize PETSC: */
    6463        #ifdef _HAVE_PETSC_
    65         PETSC_COMM_WORLD=this->comm;
     64        PETSC_COMM_WORLD=incomm;
    6665        ierr=PetscInitialize(&argc,&argv,(char*)0,"");  if(ierr) _error_("Could not initialize Petsc");
    6766        #endif
     
    7978        profiler->Tag(FinishInit);
    8079
     80        /*Save communicator in the parameters dataset: */
     81        this->parameters->AddObject(new IntParam(FemModelCommEnum,incomm));
    8182
    8283        /*Free resources */
     
    9798        /*Store the communicator, but do not set it as a global variable, as this has already
    9899         * been done by the FemModel that called this copy constructor: */
    99         this->comm=incomm;
    100         this->SetStaticComm();
     100        IssmComm::SetComm(incomm);
    101101
    102102        /*Create femmodel from input files, with trace activated: */
    103103        this->InitFromFiles(rootpath,inputfilename,outputfilename,toolkitsfilename,lockfilename,restartfilename, solution_type,traceon,X);
     104       
     105        /*Save communicator in the parameters dataset: */
     106        this->parameters->AddObject(new IntParam(FemModelCommEnum,incomm));
    104107
    105108}
     
    266269}
    267270/*}}}*/
    268 void FemModel::SetStaticComm(void){/*{{{*/
    269 
    270         /*This routine sets the global communicator variable hidden inside the IssmComm
    271          *class: */
    272         IssmComm::SetComm(this->comm);
    273 
    274 }
    275 /*}}}*/
    276271void FemModel::SetCurrentConfiguration(int configuration_type,int analysis_type){/*{{{*/
    277272
     
    381376        output=new FemModel(*this); //Use default copy constructor.
    382377
    383         output->comm = this->comm;
    384378        output->nummodels = this->nummodels;
    385379        output->solution_type = this->solution_type;
     
    547541
    548542                case TransientSolutionEnum:{
    549                         bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,islevelset,ishydrology,isdamage,issmb;
     543                        bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,islevelset,ishydrology,isdamage,issmb,isslr;
    550544                        iomodel->Constant(&isSIA,FlowequationIsSIAEnum);
    551545                        iomodel->Constant(&isFS,FlowequationIsFSEnum);
     
    559553                        iomodel->Constant(&ishydrology,TransientIshydrologyEnum);
    560554                        iomodel->Constant(&issmb,TransientIssmbEnum);
     555                        iomodel->Constant(&isslr,TransientIsslrEnum);
    561556                        if(isstressbalance){
    562557                                int  fe_FS;
     
    599594                        if(isdamage){
    600595                                analyses_temp[numanalyses++]=DamageEvolutionAnalysisEnum;
     596                        }
     597                        if(isslr){
     598                                analyses_temp[numanalyses++]=SealevelriseAnalysisEnum;
    601599                        }
    602600
     
    25522550        /*First things first, store the communicator, and set it as a global variable: */
    25532551        this->comm=incomm;
    2554         this->SetStaticComm();
     2552        IssmComm::SetComm(this->comm);
    25552553
    25562554        /*Start profiler: */
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r20016 r20134  
    4343                Parameters  *parameters;           //one set of parameters, independent of the analysis_type
    4444                Results     *results;              //results that cannot be fit into the elements
    45                 ISSM_MPI_Comm        comm;                  //communicator for this particular model
    4645
    4746                /*constructors, destructors: */
     
    5756                void CleanUp(void);
    5857                void Solve(void);
    59                 void SetStaticComm();
    6058                void SetCurrentConfiguration(int configuration_type);
    6159                void SetCurrentConfiguration(int configuration_type,int analysis_type);
  • issm/trunk-jpl/src/c/classes/Node.cpp

    r20117 r20134  
    5959                _assert_(sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]) >1.e-4);
    6060
    61                 if(iomodel->domaintype!=Domain2DhorizontalEnum){
     61                if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){
    6262                        /*We have a  3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
    6363                        _assert_(iomodel->Data(MeshVertexonbaseEnum));
     
    9797                                analysis_enum==LevelsetAnalysisEnum
    9898                                ){
    99                 if(iomodel->domaintype!=Domain2DhorizontalEnum){
     99                if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum & iomodel->domaintype!=Domain3DsurfaceEnum){
    100100                        /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */
    101101                        _assert_(iomodel->Data(MeshVertexonbaseEnum));
Note: See TracChangeset for help on using the changeset viewer.