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/Tria.h

    r13129 r13216  
    7171                /*}}}*/
    7272                /*Element virtual functions definitions: {{{*/
    73                 void   AverageOntoPartition(Vector* partition_contributions,Vector* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
    74                 void   ComputeBasalStress(Vector* sigma_b);
    75                 void   ComputeStrainRate(Vector* eps);
     73                void   AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part);
     74                void   ComputeBasalStress(Vector<IssmDouble>* sigma_b);
     75                void   ComputeStrainRate(Vector<IssmDouble>* eps);
    7676                void   ComputeStressTensor();
    7777                void   Configure(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    7878                void   SetCurrentConfiguration(Elements* elements,Loads* loads,DataSet* nodes,Materials* materials,Parameters* parameters);
    79                 void   CreateKMatrix(Matrix* Kff, Matrix* Kfs,Vector* df);
    80                 void   CreatePVector(Vector* pf);
    81                 void   CreateJacobianMatrix(Matrix* Jff);
     79                void   CreateKMatrix(Matrix<IssmDouble>* Kff, Matrix<IssmDouble>* Kfs,Vector<IssmDouble>* df);
     80                void   CreatePVector(Vector<IssmDouble>* pf);
     81                void   CreateJacobianMatrix(Matrix<IssmDouble>* Jff);
    8282                void   Delta18oParameterization(void);
    8383                int    GetNodeIndex(Node* node);
     
    8888                bool   IsNodeOnShelfFromFlags(IssmDouble* flags);
    8989                bool   IsOnWater();
    90                 void   GetSolutionFromInputs(Vector* solution);
    91                 void   GetVectorFromInputs(Vector* vector, int name_enum);
    92                 void   GetVectorFromResults(Vector* vector,int offset,int enum_in,int interp);
     90                void   GetSolutionFromInputs(Vector<IssmDouble>* solution);
     91                void   GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum);
     92                void   GetVectorFromResults(Vector<IssmDouble>* vector,int offset,int enum_in,int interp);
    9393                void   InputArtificialNoise(int enum_type,IssmDouble min, IssmDouble max);
    9494                bool   InputConvergence(IssmDouble* eps, int* enums,int num_enums,int* criterionenums,IssmDouble* criterionvalues,int num_criterionenums);
     
    103103                void   MigrateGroundingLine(IssmDouble* oldfloating,IssmDouble* sheet_ungrounding);
    104104                int    NodalValue(IssmDouble* pvalue, int index, int natureofdataenum,bool process_units);
    105                 void   PotentialSheetUngrounding(Vector* potential_sheet_ungrounding);
     105                void   PotentialSheetUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding);
    106106                void   PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm);
    107107                void   RequestedOutput(int output_enum,int step,IssmDouble time);
     
    114114                IssmDouble SurfaceArea(void);
    115115                void   Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type);
    116                 int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
     116                int    UpdatePotentialSheetUngrounding(IssmDouble* vertices_potentially_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf);
    117117                IssmDouble TimeAdapt();
    118118                int*   GetHorizontalNeighboorSids(void);
    119                 void   SmearFunction(Vector* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
     119                void   SmearFunction(Vector<IssmDouble>* smearedvector,IssmDouble (*WeightFunction)(IssmDouble distance,IssmDouble radius),IssmDouble radius);
    120120
    121121                #ifdef _HAVE_RESPONSES_
     
    141141                IssmDouble DragCoefficientAbsGradient(bool process_units,int weight_index);
    142142                void   GradientIndexing(int* indexing,int control_index);
    143                 void   Gradj(Vector* gradient,int control_type,int control_index);
    144                 void   GradjBGradient(Vector* gradient,int weight_index,int control_index);
    145                 void   GradjZGradient(Vector* gradient,int weight_index,int control_index);
    146                 void   GradjBMacAyeal(Vector* gradient,int control_index);
    147                 void   GradjZMacAyeal(Vector* gradient,int control_index);
    148                 void   GradjDragMacAyeal(Vector* gradient,int control_index);
    149                 void   GradjDragStokes(Vector* gradient,int control_index);
    150                 void   GradjDragGradient(Vector* gradient,int weight_index,int control_index);
    151                 void   GradjDhDtBalancedthickness(Vector* gradient,int control_index);
    152                 void   GradjVxBalancedthickness(Vector* gradient,int control_index);
    153                 void   GradjVyBalancedthickness(Vector* gradient,int control_index);
    154                 void   GetVectorFromControlInputs(Vector* gradient,int control_enum,int control_index,const char* data);
     143                void   Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index);
     144                void   GradjBGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     145                void   GradjZGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     146                void   GradjBMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     147                void   GradjZMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     148                void   GradjDragMacAyeal(Vector<IssmDouble>* gradient,int control_index);
     149                void   GradjDragStokes(Vector<IssmDouble>* gradient,int control_index);
     150                void   GradjDragGradient(Vector<IssmDouble>* gradient,int weight_index,int control_index);
     151                void   GradjDhDtBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     152                void   GradjVxBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     153                void   GradjVyBalancedthickness(Vector<IssmDouble>* gradient,int control_index);
     154                void   GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data);
    155155                void   SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index);
    156                 void   ControlInputGetGradient(Vector* gradient,int enum_type,int control_index);
     156                void   ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index);
    157157                void   ControlInputScaleGradient(int enum_type,IssmDouble scale);
    158158                void   ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index);
     
    212212                ElementVector* CreatePVectorDiagnosticHutter(void);
    213213                ElementMatrix* CreateJacobianDiagnosticMacayeal(void);
    214                 void      GetSolutionFromInputsDiagnosticHoriz(Vector* solution);
    215                 void      GetSolutionFromInputsDiagnosticHutter(Vector* solution);
     214                void      GetSolutionFromInputsDiagnosticHoriz(Vector<IssmDouble>* solution);
     215                void      GetSolutionFromInputsDiagnosticHutter(Vector<IssmDouble>* solution);
    216216                void      InputUpdateFromSolutionDiagnosticHoriz( IssmDouble* solution);
    217217                void      InputUpdateFromSolutionDiagnosticHutter( IssmDouble* solution);
     
    232232                ElementVector* CreatePVectorHydrology(void);
    233233                void      CreateHydrologyWaterVelocityInput(void);
    234                 void      GetSolutionFromInputsHydrology(Vector* solution);
     234                void      GetSolutionFromInputsHydrology(Vector<IssmDouble>* solution);
    235235                void      InputUpdateFromSolutionHydrology(IssmDouble* solution);
    236236                #endif
Note: See TracChangeset for help on using the changeset viewer.