Changeset 13700


Ignore:
Timestamp:
10/16/12 13:40:42 (12 years ago)
Author:
Eric.Larour
Message:

CHG: moving RequestedDepentsx to FemModel + fixing issues on ADOLC compile

Location:
issm/trunk-jpl/src/c
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Makefile.am

    r13699 r13700  
    318318                                        ./modules/ConstraintsStatex/ConstraintsStatex.h\
    319319                                        ./modules/ConstraintsStatex/ConstraintsStateLocal.h\
    320                                         ./modules/RequestedDependentsx/RequestedDependentsx.h\
    321                                         ./modules/RequestedDependentsx/RequestedDependentsx.cpp\
    322320                                        ./modules/ResetConstraintsx/ResetConstraintsx.h\
    323321                                        ./modules/ResetConstraintsx/ResetConstraintsx.cpp\
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r13699 r13700  
    508508}
    509509/*}}}*/
     510void FemModel::RequestedDependentsx(void){/*{{{*/
     511
     512
     513        int         i;
     514        bool        isautodiff      = false;
     515        IssmDouble  output_value;
     516
     517        int         num_dependents;
     518        IssmPDouble *dependents;
     519        DataSet*    dependent_objects=NULL;
     520
     521        /*AD mode on?: */
     522        parameters->FindParam(&isautodiff,AutodiffIsautodiffEnum);
     523
     524        if(isautodiff){
     525                #ifdef _HAVE_ADOLC_
     526                parameters->FindParam(&num_dependents,AutodiffNumDependentsEnum);
     527                parameters->FindParam(&dependent_objects,AutodiffDependentObjectsEnum);
     528                if(num_dependents){
     529                        dependents=xNew<IssmPDouble>(num_dependents);
     530
     531                        /*Go through our dependent variables, and compute the response:*/
     532                        for(i=0;i<dependent_objects->Size();i++){
     533                                DependentObject* dep=(DependentObject*)dependent_objects->GetObjectByOffset(i);
     534                                dep->Responsex(&output_value,this);
     535                                output_value>>=dependents[i];
     536                        }
     537                }
     538                delete dependent_objects;
     539                #else
     540                _error_("Should not be requesting dependents when an AD library is not available!");
     541                #endif
     542        }
     543}
     544/*}}}*/
    510545#ifdef _HAVE_CONTROL_
    511546void FemModel::ThicknessAbsGradientx( IssmDouble* pJ, bool process_units, int weight_index){/*{{{*/
     
    537572}
    538573/*}}}*/
    539 #endif
    540 
    541 #ifdef  _HAVE_DAKOTA_
    542574void FemModel::CostFunctionx(IssmDouble* pJ){/*{{{*/
    543575
     
    568600}
    569601/*}}}*/
     602#endif
     603
     604#ifdef  _HAVE_DAKOTA_
    570605void FemModel::DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses){/*{{{*/
    571606
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r13699 r13700  
    6464                /*Modules: {{{*/
    6565                 #ifdef  _HAVE_DAKOTA_
    66                 void CostFunctionx( IssmDouble* pJ);
    6766                void DakotaResponsesx(double* d_responses,char** responses_descriptors,int numresponsedescriptors,int d_numresponses);
    6867                #endif
    6968
    7069                void RequestedOutputsx(int* requested_outputs, int numoutputs);
     70                void RequestedDependentsx(void);
    7171                void Responsex(IssmDouble* presponse,int response_descriptor_enum,bool process_units,int weight_index);
    7272                void Responsex(IssmDouble* presponse,const char* response_descriptor,bool process_units,int weight_index);
    7373                #ifdef _HAVE_CONTROL_
     74                void CostFunctionx( IssmDouble* pJ);
    7475                void ThicknessAbsGradientx( IssmDouble* pJ, bool process_units,int weight_index);
    7576                #endif
  • issm/trunk-jpl/src/c/modules/modules.h

    r13699 r13700  
    9898#include "./Reducevectorgtosx/Reducevectorgtosx.h"
    9999#include "./Reducevectorgtofx/Reducevectorgtofx.h"
    100 #include "./RequestedDependentsx/RequestedDependentsx.h"
    101100#include "./ResetConstraintsx/ResetConstraintsx.h"
    102101#include "./ResetCoordinateSystemx/ResetCoordinateSystemx.h"
  • issm/trunk-jpl/src/c/solutions/diagnostic_core.cpp

    r13699 r13700  
    105105        }
    106106
    107         if(solution_type==DiagnosticSolutionEnum)RequestedDependentsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
     107        if(solution_type==DiagnosticSolutionEnum)femmodel->RequestedDependentsx();
    108108
    109109        /*Free ressources:*/
  • issm/trunk-jpl/src/c/solutions/prognostic_core.cpp

    r13699 r13700  
    5454        }
    5555
    56         if(solution_type==PrognosticSolutionEnum)RequestedDependentsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
     56        if(solution_type==PrognosticSolutionEnum)femmodel->RequestedDependentsx();
    5757
    5858        /*Free ressources:*/
  • issm/trunk-jpl/src/c/solutions/transient_core.cpp

    r13699 r13700  
    152152        }
    153153
    154         RequestedDependentsx(femmodel->results,femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters);
     154        femmodel->RequestedDependentsx();
    155155
    156156        /*Free ressources:*/
Note: See TracChangeset for help on using the changeset viewer.