Changeset 19062


Ignore:
Timestamp:
02/02/15 14:46:12 (10 years ago)
Author:
Eric.Larour
Message:

CHG: added IceMass computation.

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

Legend:

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

    r19033 r19062  
    694694                case DivergenceEnum:               this->Divergencex(responses); break;
    695695                case MaxDivergenceEnum:            this->MaxDivergencex(responses); break;
     696                case IceMassEnum:                  this->IceMassx(responses); break;
    696697                case IceVolumeEnum:                this->IceVolumex(responses); break;
    697698                case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(responses); break;
     
    777778                                        case DivergenceEnum:               this->Divergencex(&double_result);               break;
    778779                                        case MaxDivergenceEnum:            this->MaxDivergencex(&double_result);            break;
     780                                        case IceMassEnum:                this->IceMassx(&double_result);                break;
    779781                                        case IceVolumeEnum:                this->IceVolumex(&double_result);                break;
    780782                                        case IceVolumeAboveFloatationEnum: this->IceVolumeAboveFloatationx(&double_result); break;
     
    13941396
    13951397}/*}}}*/
     1398void FemModel::IceMassx(IssmDouble* pM){/*{{{*/
     1399
     1400        IssmDouble local_ice_mass = 0;
     1401        IssmDouble total_ice_mass;
     1402
     1403        for(int i=0;i<this->elements->Size();i++){
     1404                Element* element=xDynamicCast<Element*>(this->elements->GetObjectByOffset(i));
     1405                local_ice_mass+=element->IceMass();
     1406        }
     1407        ISSM_MPI_Reduce(&local_ice_mass,&total_ice_mass,1,ISSM_MPI_DOUBLE,ISSM_MPI_SUM,0,IssmComm::GetComm() );
     1408        ISSM_MPI_Bcast(&total_ice_mass,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm());
     1409
     1410        /*Assign output pointers: */
     1411        *pM=total_ice_mass;
     1412
     1413}/*}}}*/
    13961414void FemModel::IceVolumex(IssmDouble* pV){/*{{{*/
    13971415
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r19033 r19062  
    7979                void Divergencex(IssmDouble* pdiv);
    8080                void MaxDivergencex(IssmDouble* pdiv);
     81                void IceMassx(IssmDouble* pV);
    8182                void IceVolumex(IssmDouble* pV);
    8283                void IceVolumeAboveFloatationx(IssmDouble* pV);
Note: See TracChangeset for help on using the changeset viewer.