Changeset 17009


Ignore:
Timestamp:
12/05/13 08:05:35 (11 years ago)
Author:
Mathieu Morlighem
Message:

NEW: moving some cores to analyses

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/analyses/Analysis.h

    r17000 r17009  
    3333
    3434                /*Finite element Analysis*/
     35                virtual void           Core(FemModel* femmodel)=0;
    3536                virtual ElementVector* CreateDVector(Element* element)=0;
    3637                virtual ElementMatrix* CreateJacobianMatrix(Element* element)=0;
  • issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

    r17005 r17009  
    44#include "../shared/shared.h"
    55#include "../modules/modules.h"
     6#include "../solutionsequences/solutionsequences.h"
    67
    78/*Model processing*/
     
    813814/*Finite Element Analysis*/
    814815void           StressbalanceAnalysis::Core(FemModel* femmodel){/*{{{*/
    815         _error_("not implemented");
     816
     817        /*Intermediaries*/
     818        bool isSIA,isSSA,isL1L2,isHO,isFS;
     819        bool conserve_loads = true;
     820        int  meshtype,newton;
     821
     822        /* recover parameters:*/
     823        femmodel->parameters->FindParam(&isSIA,FlowequationIsSIAEnum);
     824        femmodel->parameters->FindParam(&isSSA,FlowequationIsSSAEnum);
     825        femmodel->parameters->FindParam(&isL1L2,FlowequationIsL1L2Enum);
     826        femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum);
     827        femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
     828        femmodel->parameters->FindParam(&newton,StressbalanceIsnewtonEnum);
     829        femmodel->parameters->FindParam(&meshtype,MeshTypeEnum);
     830
     831        if((isSSA || isHO || isL1L2) ^ isFS){ // ^ = xor
     832                if(VerboseSolution()) _printf0_("   computing velocities\n");
     833
     834                femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
     835                if(newton>0)
     836                 solutionsequence_newton(femmodel);
     837                else
     838                 solutionsequence_nonlinear(femmodel,conserve_loads);
     839        }
     840
     841        if ((isSSA || isL1L2 || isHO) && isFS){
     842                if(VerboseSolution()) _printf0_("   computing coupling between lower order models and FS\n");
     843                solutionsequence_FScoupling_nonlinear(femmodel,conserve_loads);
     844        }
     845
     846        if (meshtype==Mesh3DEnum && (isSIA || isSSA || isL1L2 || isHO)){
     847                if(VerboseSolution()) _printf0_("   computing vertical velocities\n");
     848                femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
     849                solutionsequence_linear(femmodel);
     850        }
     851
    816852}/*}}}*/
    817853ElementVector* StressbalanceAnalysis::CreateDVector(Element* element){/*{{{*/
  • issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp

    r17005 r17009  
    44#include "../shared/shared.h"
    55#include "../modules/modules.h"
     6#include "../solutionsequences/solutionsequences.h"
    67
    78/*Model processing*/
     
    136137/*Finite Element Analysis*/
    137138void           StressbalanceSIAAnalysis::Core(FemModel* femmodel){/*{{{*/
    138         _error_("not implemented");
     139
     140                if(VerboseSolution()) _printf0_("   computing SIA velocities\n");
     141                femmodel->SetCurrentConfiguration(StressbalanceSIAAnalysisEnum);
     142                solutionsequence_linear(femmodel);
    139143}/*}}}*/
    140144ElementVector* StressbalanceSIAAnalysis::CreateDVector(Element* element){/*{{{*/
  • issm/trunk-jpl/src/c/cores/stressbalance_core.cpp

    r16742 r17009  
    66#include "../toolkits/toolkits.h"
    77#include "../classes/classes.h"
     8#include "../analyses/analyses.h"
    89#include "../shared/shared.h"
    910#include "../modules/modules.h"
     
    1314
    1415        /*parameters: */
    15         bool  dakota_analysis;
    16         int   meshtype;
    17         bool  isSIA,isSSA,isL1L2,isHO,isFS;
    18         bool  conserve_loads    = true;
    19         bool  save_results;
    20         int   newton;
    21         int   solution_type;
    22         int   numoutputs        = 0;
    23         char** requested_outputs = NULL;
    24         int    i;
    25 
     16        bool       dakota_analysis;
     17        int        meshtype;
     18        bool       isSIA,isSSA,isL1L2,isHO,isFS;
     19        bool       save_results;
     20        int        solution_type;
     21        int        numoutputs        = 0;
     22        char     **requested_outputs = NULL;
     23        Analysis  *analysis          = NULL;
    2624
    2725        /* recover parameters:*/
     
    3230        femmodel->parameters->FindParam(&isHO,FlowequationIsHOEnum);
    3331        femmodel->parameters->FindParam(&isFS,FlowequationIsFSEnum);
    34         femmodel->parameters->FindParam(&newton,StressbalanceIsnewtonEnum);
    3532        femmodel->parameters->FindParam(&dakota_analysis,QmuIsdakotaEnum);
    3633        femmodel->parameters->FindParam(&save_results,SaveResultsEnum);
     
    4744        }
    4845
    49         /*Compute slopes: */
     46        /*Compute slopes if necessary */
    5047        if(isSIA || (isFS && meshtype==Mesh2DverticalEnum)) surfaceslope_core(femmodel);
    5148        if(isFS){
     
    5552        }
    5653
     54        /*Compute SIA velocities*/
    5755        if(isSIA){
    58                 if(VerboseSolution()) _printf0_("   computing SIA velocities\n");
    5956
    6057                /*Take the last velocity into account so that the velocity on the SSA domain is not zero*/
    6158                if(isSSA || isL1L2 || isHO ) ResetBoundaryConditions(femmodel,StressbalanceSIAAnalysisEnum);
    62                 femmodel->SetCurrentConfiguration(StressbalanceSIAAnalysisEnum);
    63                 solutionsequence_linear(femmodel);
     59
     60                analysis = new StressbalanceSIAAnalysis();
     61                analysis->Core(femmodel);
     62                delete analysis;
     63
     64                /*Reset velocities for other ice flow models*/
    6465                if(isSSA || isL1L2 || isHO) ResetBoundaryConditions(femmodel,StressbalanceAnalysisEnum);
    6566        }
    6667
    67         if ((isSSA || isHO || isL1L2) ^ isFS){ // ^ = xor
    68                 if(VerboseSolution()) _printf0_("   computing velocities\n");
    69 
    70                 femmodel->SetCurrentConfiguration(StressbalanceAnalysisEnum);
    71                 if(newton>0)
    72                  solutionsequence_newton(femmodel);
    73                 else
    74                  solutionsequence_nonlinear(femmodel,conserve_loads);
    75         }
    76 
    77         if ((isSSA || isL1L2 || isHO) && isFS){
    78                 if(VerboseSolution()) _printf0_("   computing coupling betweem lower order models and full-FS\n");
    79                 solutionsequence_FScoupling_nonlinear(femmodel,conserve_loads);
    80         }
    81 
    82         if (meshtype==Mesh3DEnum && (isSIA || isSSA || isL1L2 || isHO)){
    83                 if(VerboseSolution()) _printf0_("   computing vertical velocities\n");
    84                 femmodel->SetCurrentConfiguration(StressbalanceVerticalAnalysisEnum);
    85                 solutionsequence_linear(femmodel);
     68        /*Compute stressbalance for SSA L1L2 HO and FS*/
     69        if(isSSA || isL1L2 || isHO || isFS){
     70                analysis = new StressbalanceAnalysis();
     71                analysis->Core(femmodel);
     72                delete analysis;
    8673        }
    8774
Note: See TracChangeset for help on using the changeset viewer.