Ignore:
Timestamp:
08/31/12 17:23:24 (13 years ago)
Author:
Eric.Larour
Message:

NEW: large change to the code, to adapt to ADOLC requirements.

This change relates to the introduction of template classes and functions for the
Option.h abstract class. This is needed, because we want to make the Matlab
API independent from the libCore objects, which are dependent on the IssmDouble*
ADOLC type (adouble), when the Matlab API is dependent on the IssmPDouble* type (double).

To make them independent, we need to be able to specify at run time Options, Matrix and
Vector objects that hold either IssmDouble or IssmPDouble objects. The only way to do
that is through the use of templated classes for Option.h, Matrix and Vector.

The change gets rid of a lot of useless code (especially in the classes/objects/Options
directory), by introducing template versions of the same code.

The bulk of the changes to src/modules and src/mex modules is to adapt to this
new runtime declaration of templated Matrix, Vector and Option objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/objects/Elements/Penta.h

    r13129 r13216  
    7474                /*}}}*/
    7575                /*Element virtual functions definitions: {{{*/
    76                 void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
     76                void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
    7777                void   BasalFrictionCreateInput(void);
    78                 void   ComputeBasalStress(Vector* sigma_b);
    79                 void   ComputeStrainRate(Vector* eps);
     78                void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
     79                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    8080                void   ComputeStressTensor();
    8181                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    8282                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    83                 void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
    84                 void   CreatePVector(Vector* pf);
    85                 void   CreateJacobianMatrix(Matrix* Jff);
     83                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
     84                void   CreatePVector(Vector<IssmDouble>* pf);
     85                void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    8686                void   Delta18oParameterization(void);
    8787                void   DeleteResults(void);
    8888                int    GetNodeIndex(Node* node);
    89                 void   GetSolutionFromInputs(Vector* solution);
     89                void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
    9090                IssmDouble GetZcoord(GaussPenta* gauss);
    91                 void   GetVectorFromInputs(Vector* vector,int name_enum);
    92                 void   GetVectorFromResults(Vector* vector,int offset,int name_enum,int interp);
     91                void   GetVectorFromInputs(Vector<IssmDouble>* vector,int name_enum);
     92                void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int name_enum,int interp);
    9393               
    9494                int    Sid();
     
    103103                void   InputToResult(int enum_type,int step,IssmDouble time);
    104104                void   MigrateGroundingLine(IssmDouble* old_floating_ice,IssmDouble* sheet_ungrounding);
    105                 void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
     105                void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
    106106                void   RequestedOutput(int output_enum,int step,IssmDouble time);
    107107                void   ListResultsInfo(int** results_enums,int** results_size,IssmDouble** results_times,int** results_steps,int* num_results);
     
    114114                IssmDouble SurfaceArea(void);
    115115                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    116                 int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
     116                int    UpdatePotentialSheetUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
    117117                int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
    118118                IssmDouble TimeAdapt();
    119119                int*   GetHorizontalNeighboorSids(void);
    120120                void   ViscousHeatingCreateInput(void);
    121                 void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
     121                void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
    122122
    123123                 #ifdef _HAVE_RESPONSES_
     
    142142                IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
    143143                void   GradientIndexing(int* indexing,int control_index);
    144                 void   Gradj(Vector* gradient,int control_type,int control_index);
    145                 void   GradjDragMacAyeal(Vector* gradient,int control_index);
    146                 void   GradjDragPattyn(Vector* gradient,int control_index);
    147                 void   GradjDragStokes(Vector* gradient,int control_index);
    148                 void   GradjBbarMacAyeal(Vector* gradient,int control_index);
    149                 void   GradjBbarPattyn(Vector* gradient,int control_index);
    150                 void   GradjBbarStokes(Vector* gradient,int control_index);
    151                 void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
     144                void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
     145                void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     146                void   GradjDragPattyn(Vector<IssmDouble>* gradient,int control_index);
     147                void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
     148                void   GradjBbarMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     149                void   GradjBbarPattyn(Vector<IssmDouble>* gradient,int control_index);
     150                void   GradjBbarStokes(Vector<IssmDouble>* gradient,int control_index);
     151                void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
    152152                void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
    153                 void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
     153                void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
    154154                void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
    155155                void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
     
    183183                void    GetInputValue(IssmDouble* pvalue,Node* node,int enumtype);
    184184                void      GetPhi(IssmDouble* phi, IssmDouble*  epsilon, IssmDouble viscosity);
    185                 void      GetSolutionFromInputsEnthalpy(Vector* solutiong);
     185                void      GetSolutionFromInputsEnthalpy(Vector<IssmDouble>* solutiong);
    186186                IssmDouble  GetStabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa);
    187187                void    GetStrainRate3dPattyn(IssmDouble* epsilon,IssmDouble* xyz_list, GaussPenta* gauss, Input* vx_input, Input* vy_input);
     
    254254                void           InputUpdateFromSolutionDiagnosticVert( IssmDouble* solutiong);
    255255                void           InputUpdateFromSolutionDiagnosticStokes( IssmDouble* solutiong);
    256                 void             GetSolutionFromInputsDiagnosticHoriz(Vector* solutiong);
    257                 void             GetSolutionFromInputsDiagnosticHutter(Vector* solutiong);
    258                 void             GetSolutionFromInputsDiagnosticStokes(Vector* solutiong);
    259                 void             GetSolutionFromInputsDiagnosticVert(Vector* solutiong);
     256                void             GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solutiong);
     257                void             GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solutiong);
     258                void             GetSolutionFromInputsDiagnosticStokes(Vector<IssmDouble>* solutiong);
     259                void             GetSolutionFromInputsDiagnosticVert(Vector<IssmDouble>* solutiong);
    260260                ElementVector* CreatePVectorCouplingMacAyealStokes(void);
    261261                ElementVector* CreatePVectorCouplingMacAyealStokesViscous(void);
     
    313313                ElementVector* CreatePVectorThermalShelf(void);
    314314                ElementVector* CreatePVectorThermalSheet(void);
    315                 void           GetSolutionFromInputsThermal(Vector* solutiong);
     315                void           GetSolutionFromInputsThermal(Vector<IssmDouble>* solutiong);
    316316                void           InputUpdateFromSolutionThermal( IssmDouble* solutiong);
    317317                void           InputUpdateFromSolutionEnthalpy( IssmDouble* solutiong);
Note: See TracChangeset for help on using the changeset viewer.