Changeset 3968


Ignore:
Timestamp:
05/27/10 10:43:40 (15 years ago)
Author:
Mathieu Morlighem
Message:

moved some Dataset methods to modules

Location:
issm/trunk/src/c
Files:
3 edited

Legend:

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

    r3967 r3968  
    11971197}
    11981198/*}}}*/
    1199 /*FUNCTION DataSet::SurfaceArea{{{1*/
    1200 void  DataSet::SurfaceArea(double* pS,int analysis_type,int sub_analysis_type){
    1201 
    1202         double S=0;
    1203 
    1204         vector<Object*>::iterator object;
    1205         Element* element=NULL;
    1206 
    1207         for ( object=objects.begin() ; object < objects.end(); object++ ){
    1208 
    1209                 if(EnumIsElement((*object)->Enum())){
    1210 
    1211                         element=(Element*)(*object);
    1212                         S+=element->SurfaceArea(analysis_type,sub_analysis_type);
    1213 
    1214                 }
    1215         }
    1216 
    1217         /*Assign output pointers:*/
    1218         *pS=S;
    1219 
    1220 }
    1221 /*}}}*/
    12221199/*FUNCTION DataSet::UpdateInputsFromSolution{{{1*/
    12231200void  DataSet::UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){
  • issm/trunk/src/c/DataSet/DataSet.h

    r3967 r3968  
    8181                void  MeltingConstraints(int* pconverged, int* pnum_unstable_constraints,int analysis_type,int sub_analysis_type);
    8282                DataSet* Copy(void);
    83                 void  SurfaceArea(double* pS, int analysis_type,int sub_analysis_type);
    8483                void  FieldAverageOntoVertices(Vec fieldsum,Vec connectivity,double* field);
    8584                void  FieldDepthAverageAtBase(Vec field,double* field_serial,char* fieldname);
  • issm/trunk/src/c/modules/SurfaceAreax/SurfaceAreax.cpp

    r3913 r3968  
    1313                        int analysis_type,int sub_analysis_type){
    1414       
     15        /*Intermediary*/
     16        Element* element=NULL;
     17        int i;
     18
    1519        /*output: */
    16         double S;
     20        double S=0;
    1721        double S_sum;
    1822       
     
    2226
    2327        /*Compute gradients: */
    24         elements->SurfaceArea(&S,analysis_type,sub_analysis_type);
     28        for (i=0;i<elements->Size();i++){
     29                element=(Element*)elements->GetObjectByOffset(i);
     30                S+=element->SurfaceArea(analysis_type,sub_analysis_type);
     31        }
    2532
    2633        /*Sum all J from all cpus of the cluster:*/
Note: See TracChangeset for help on using the changeset viewer.