Changeset 14734


Ignore:
Timestamp:
04/24/13 09:22:21 (12 years ago)
Author:
Eric.Larour
Message:

CHG: finished implementation of the GiaDeflectionCoreArgs, which
go into GiaDeflectionCorex. Updated Matpar to hold most of the material
parameters of the mantle and lithosphere.

Location:
issm/trunk-jpl
Files:
1 added
10 edited

Legend:

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

    r14727 r14734  
    509509                           ./modules/ModelProcessorx/Gia/CreateLoadsGia.cpp\
    510510                           ./modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp\
    511                            ./modules/GiaDeflectionCorex/GiaDeflectionCorex.h
     511                           ./modules/GiaDeflectionCorex/GiaDeflectionCorex.h\
     512                           ./classes/GiaDeflectionCoreArgs.h
    512513
    513514#}}}
  • issm/trunk-jpl/src/c/classes/classes.h

    r14633 r14734  
    2828#include "./Update.h"
    2929#include "./FemModel.h"
     30#include "./GiaDeflectionCoreArgs.h"
    3031#include "./OptArgs.h"
    3132#include "./OptPars.h"
  • issm/trunk-jpl/src/c/classes/objects/Elements/Tria.cpp

    r14704 r14734  
    30573057        IssmDouble  currenttime;
    30583058        int         numtimes;
     3059        Input* thickness_input=NULL;
     3060
     3061        /*gia material parameters: */
     3062        IssmDouble lithosphere_shear_modulus;
     3063        IssmDouble lithosphere_density;
     3064        IssmDouble mantle_shear_modulus;
     3065        IssmDouble mantle_viscosity;
     3066        IssmDouble mantle_density;
     3067        Input* lithosphere_thickness_input=NULL;
     3068        IssmDouble lithosphere_thickness;
     3069
     3070        /*ice properties: */
     3071        IssmDouble rho_ice;
    30593072
    30603073        /*output: */
    30613074        IssmDouble  wi;
    30623075
     3076        /*arguments to GiaDeflectionCorex: */
     3077        GiaDeflectionCoreArgs arguments;
     3078
    30633079        /*how many dofs are we working with here? */
    30643080        this->parameters->FindParam(&gsize,MeshNumberofverticesEnum);
    3065        
     3081
    30663082        /*what time is it? :*/
    30673083        this->parameters->FindParam(&currenttime,TimeEnum);
    30683084
     3085        /*recover material parameters: */
     3086        lithosphere_shear_modulus=matpar->GetLithosphereShearModulus();
     3087        lithosphere_density=matpar->GetLithosphereDensity();
     3088        mantle_shear_modulus=matpar->GetMantleShearModulus();
     3089        mantle_viscosity=matpar->GetMantleViscosity();
     3090        mantle_density=matpar->GetMantleDensity();
     3091        rho_ice=matpar->GetRhoIce();
     3092
    30693093        /*pull thickness averages: */
    3070         Input* thickness_input=inputs->GetInput(ThicknessEnum);
     3094        thickness_input=inputs->GetInput(ThicknessEnum);
    30713095        if (!thickness_input)_error_("thickness input needed to compute gia deflection!");
    30723096        thickness_input->GetInputAllTimeAverages(&hes,&times,&numtimes);
    3073        
     3097
     3098        /*recover lithosphere thickness: */
     3099        lithosphere_thickness_input=inputs->GetInput(GiaLithosphereThicknessEnum);
     3100        if (!lithosphere_thickness_input)_error_("lithosphere thickness input needed to compute gia deflection!");
     3101        lithosphere_thickness_input->GetInputAverage(&lithosphere_thickness);
     3102
    30743103        /*pull area of this Tria: */
    30753104        area=this->GetArea();
     
    30833112        y0=(xyz_list[0][1]+xyz_list[1][1]+xyz_list[2][1])/3.0;
    30843113
     3114        /*start loading GiaDeflectionCore arguments: */
     3115        arguments.re=re;
     3116        arguments.hes=hes;
     3117        arguments.times=times;
     3118        arguments.numtimes=numtimes;
     3119        arguments.currenttime=currenttime;
     3120        arguments.lithosphere_shear_modulus=lithosphere_shear_modulus;
     3121        arguments.lithosphere_density=lithosphere_density;
     3122        arguments.mantle_shear_modulus=mantle_shear_modulus;
     3123        arguments.mantle_viscosity=mantle_viscosity;
     3124        arguments.mantle_density=mantle_density;
     3125        arguments.lithosphere_thickness=lithosphere_thickness;
     3126        arguments.rho_ice=rho_ice;
     3127
    30853128        for(i=0;i<gsize;i++){
    30863129                /*compute distance from the center of the tria to the vertex i: */
    30873130                xi=x[i]; yi=y[i];
    30883131                ri=sqrt(pow(xi-x0,2)+pow(yi-y0,2));
     3132       
     3133                /*load ri onto arguments for this vertex i: */
     3134                arguments.ri=ri;
    30893135
    30903136                /*for this Tria, compute contribution to rebound at vertex i: */
    3091                 GiaDeflectionCorex(&wi,ri,re,hes,times,currenttime,numtimes);
     3137                GiaDeflectionCorex(&wi,&arguments);
    30923138
    30933139                /*plug value into solution vector: */
    30943140                wg->SetValue(i,wi,ADD_VAL);
     3141
    30953142        }
    30963143
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.cpp

    r14695 r14734  
    6060                _error_("Hydrology model "<<EnumToStringx(hydrology_model)<<" not supported yet");
    6161        }
    62 
     62       
     63        /*gia: */
     64        iomodel->Constant(&this->lithosphere_shear_modulus,MaterialsLithosphereShearModulusEnum);
     65        iomodel->Constant(&this->lithosphere_density,MaterialsLithosphereDensityEnum);
     66        iomodel->Constant(&this->mantle_shear_modulus,MaterialsMantleShearModulusEnum);
     67        iomodel->Constant(&this->mantle_viscosity,MaterialsMantleViscosityEnum);
     68        iomodel->Constant(&this->mantle_density,MaterialsMantleDensityEnum);
     69
     70        /*Unit conversion: */
     71        this->UnitConversion();
    6372
    6473        this->inputs=NULL; /*not used here*/
     
    383392}
    384393/*}}}*/
     394
     395/*FUNCTION Matpar::GetLithosphereShearModulus {{{*/                     
     396IssmDouble Matpar::GetLithosphereShearModulus(){                 
     397        return lithosphere_shear_modulus;                       
     398}               
     399/*}}}*/
     400/*FUNCTION Matpar::GetLithosphereDensity {{{*/                   
     401IssmDouble Matpar::GetLithosphereDensity(){             
     402        return lithosphere_density;                     
     403}               
     404/*}}}*/
     405/*FUNCTION Matpar::GetMantleDensity {{{*/                       
     406IssmDouble Matpar::GetMantleDensity(){           
     407        return mantle_density;                   
     408}               
     409/*}}}*/
     410/*FUNCTION Matpar::GetMantleShearModulus {{{*/                   
     411IssmDouble Matpar::GetMantleShearModulus(){             
     412        return mantle_shear_modulus;                     
     413}               
     414/*}}}*/
     415/*FUNCTION Matpar::GetMantleViscosity {{{*/                     
     416IssmDouble Matpar::GetMantleViscosity(){                 
     417        return mantle_viscosity;                         
     418}               
     419/*}}}*/
     420/*FUNCTION Matpar::UnitConversion {{{*/                 
     421void Matpar::UnitConversion(void){               
     422       
     423        /*convert units of fields that were allocated using the Ext unit system, into the Iu unit system: */
     424        ::UnitConversion(&this->lithosphere_density,1,ExtToIuEnum,MaterialsLithosphereDensityEnum);
     425        ::UnitConversion(&this->mantle_density,1,ExtToIuEnum,MaterialsMantleDensityEnum);
     426
     427}               
     428/*}}}*/
     429
  • issm/trunk-jpl/src/c/classes/objects/Materials/Matpar.h

    r14695 r14734  
    4343                IssmDouble  sediment_transmitivity;     
    4444                IssmDouble  water_compressibility;
     45
     46                /*gia: */
     47                IssmDouble lithosphere_shear_modulus;
     48                IssmDouble lithosphere_density;
     49                IssmDouble mantle_shear_modulus;
     50                IssmDouble mantle_viscosity;
     51                IssmDouble mantle_density;
     52
     53
    4554        public:
    4655                Matpar();
     
    111120                IssmDouble PureIceEnthalpy(IssmDouble pressure);
    112121                IssmDouble GetEnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure);
     122                IssmDouble GetLithosphereShearModulus();
     123                IssmDouble GetLithosphereDensity();
     124                IssmDouble GetMantleShearModulus();
     125                IssmDouble GetMantleViscosity();
     126                IssmDouble GetMantleDensity();
    113127                void   EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure);
    114128                void   ThermalToEnthalpy(IssmDouble* penthalpy,IssmDouble temperature,IssmDouble waterfraction,IssmDouble pressure);
     129                void   UnitConversion(void);
    115130                /*}}}*/
    116131
  • issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.cpp

    r14650 r14734  
    77#include "./GiaDeflectionCorex.h"
    88
     9#include "../../classes/classes.h"
    910#include "../../shared/shared.h"
    1011#include "../../include/include.h"
     
    1314#include "../InputUpdateFromConstantx/InputUpdateFromConstantx.h"
    1415
    15 void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble ri, IssmDouble re, IssmDouble* hes, IssmDouble* times, IssmDouble currentime,int numtimes){
     16void GiaDeflectionCorex( IssmDouble* pwi, GiaDeflectionCoreArgs* arguments){
    1617
    1718        /*output: */
    1819        IssmDouble wi=1;
    1920
     21        /*inputs: {{{*/
     22        IssmDouble ri; //radial distance from center of disk to vertex  i
     23        IssmDouble re; //radius of disk
     24        IssmDouble* hes; //loading history (in ice thickness)
     25        IssmDouble* times; //loading history times
     26        int numtimes; //loading history length
     27        IssmDouble currenttime;
     28
     29        /*gia material parameters: */
     30        IssmDouble lithosphere_shear_modulus;
     31        IssmDouble lithosphere_density;
     32        IssmDouble mantle_shear_modulus;
     33        IssmDouble mantle_viscosity;
     34        IssmDouble mantle_density;
     35        IssmDouble lithosphere_thickness;
     36
     37        /*ice properties: */
     38        IssmDouble rho_ice;
     39        /*}}}*/
     40        /*Recover material parameters and loading history: see GiaDeflectionCoreArgs for more details {{{*/
     41        ri=arguments->ri;
     42        re=arguments->re;
     43        hes=arguments->hes;
     44        times=arguments->times;
     45        numtimes=arguments->numtimes;
     46        currenttime=arguments->currenttime;
     47        lithosphere_shear_modulus=arguments->lithosphere_shear_modulus;
     48        lithosphere_density=arguments->lithosphere_density;
     49        mantle_shear_modulus=arguments->mantle_shear_modulus;
     50        mantle_viscosity=arguments->mantle_viscosity;
     51        mantle_density=arguments->mantle_density;
     52        lithosphere_thickness=arguments->lithosphere_thickness;
     53        rho_ice=arguments->rho_ice;
     54        /*}}}*/
     55
     56
     57
    2058        /*allocate output pointer: */
    2159        *pwi=wi;
  • issm/trunk-jpl/src/c/modules/GiaDeflectionCorex/GiaDeflectionCorex.h

    r14650 r14734  
    66#define _GIADEFLECTIONCOREX_H
    77
    8 #include "../../classes/objects/objects.h"
     8#include "../../classes/classes.h"
    99#include "../../Container/Container.h"
    1010
    1111/* local prototypes: */
    12 void GiaDeflectionCorex( IssmDouble* pwi, IssmDouble ri, IssmDouble re, IssmDouble* hes, IssmDouble* times, IssmDouble currentime,int numtimes);
     12void GiaDeflectionCorex( IssmDouble* pwi, GiaDeflectionCoreArgs* arguments);
    1313
    1414#endif  /* _GIADEFLECTIONCOREX_H */
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Gia/UpdateElementsGia.cpp

    r14650 r14734  
    2222        iomodel->Constant(&dim,MeshDimensionEnum);
    2323        iomodel->Constant(&numberofelements,MeshNumberofelementsEnum);
    24         iomodel->FetchData(1,MeshElementsEnum);
     24        iomodel->FetchData(2,MeshElementsEnum,GiaLithosphereThicknessEnum);
    2525
    2626        /*Update elements: */
     
    3535
    3636        iomodel->FetchDataToInput(elements,ThicknessEnum);
     37        iomodel->FetchDataToInput(elements,GiaLithosphereThicknessEnum);
    3738
    3839        /*Free data: */
    39         iomodel->DeleteData(1,MeshElementsEnum);
     40        iomodel->DeleteData(2,MeshElementsEnum,GiaLithosphereThicknessEnum);
    4041}
  • issm/trunk-jpl/src/m/classes/matdamageice.m

    r13347 r14734  
    2121                rheology_Z   = NaN;
    2222                rheology_law = '';
     23       
     24                %gia:
     25                lithosphere_shear_modulus  = 0.;
     26                lithosphere_density        = 0.;
     27                mantle_shear_modulus       = 0.;
     28                mantle_viscosity           = 0.;
     29                mantle_density             = 0.;
     30
     31
    2332        end
    2433        methods
     
    7988                        %available: none, paterson and arrhenius
    8089                        obj.rheology_law='Paterson';
     90                       
     91                        %GIA:
     92                        obj.lithosphere_shear_modulus  = 6.7*10^10; %(Pa)
     93                        obj.lithosphere_density        = 3.32; %(g/cm^-3)
     94                        obj.mantle_shear_modulus       = 1.45*10^11; %(Pa)
     95                        obj.mantle_viscosity           = 10^21; %(Pa.s)
     96                        obj.mantle_density             = 3.34; %(g/cm^-3)
     97
    8198                end % }}}
    8299                function md = checkconsistency(obj,md,solution,analyses) % {{{
     
    89106                        md = checkfield(md,'materials.rheology_Z','>',0,'size',[md.mesh.numberofvertices 1]);
    90107                        md = checkfield(md,'materials.rheology_law','values',{'None' 'Paterson' 'Arrhenius'});
     108                        md = checkfield(md,'materials.lithosphere_shear_modulus','>',0);
     109                        md = checkfield(md,'materials.lithosphere_density','>',0);
     110                        md = checkfield(md,'materials.mantle_shear_modulus','>',0);
     111                        md = checkfield(md,'materials.mantle_viscosity','>',0);
     112                        md = checkfield(md,'materials.mantle_density','>',0);
     113
    91114                end % }}}
    92115                function disp(obj) % {{{
     
    108131                        fielddisplay(obj,'rheology_Z','rheology multiplier');
    109132                        fielddisplay(obj,'rheology_law','law for the temperature dependance of the rheology: ''None'', ''Paterson'' or ''Arrhenius''');
     133                        fielddisplay(obj,'lithosphere_shear_modulus','Lithosphere shear modulus [Pa]');
     134                        fielddisplay(obj,'lithosphere_density','Lithosphere density [g/cm^-3]');
     135                        fielddisplay(obj,'mantle_shear_modulus','Mantle shear modulus [Pa]');
     136                        fielddisplay(obj,'mantle_viscosity','Mantle viscosity [Pa.s]');
     137                        fielddisplay(obj,'mantle_density','Mantle density [g/cm^-3]');
     138
    110139                end % }}}
    111140                function marshall(obj,fid) % {{{
     
    126155                        WriteData(fid,'object',obj,'class','materials','fieldname','rheology_Z','format','DoubleMat','mattype',1);
    127156                        WriteData(fid,'data',StringToEnum(obj.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');
     157                       
     158                        WriteData(fid,'object',obj,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');
     159                        WriteData(fid,'object',obj,'class','materials','fieldname','lithosphere_density','format','Double');
     160                        WriteData(fid,'object',obj,'class','materials','fieldname','mantle_shear_modulus','format','Double');
     161                        WriteData(fid,'object',obj,'class','materials','fieldname','mantle_viscosity','format','Double');
     162                        WriteData(fid,'object',obj,'class','materials','fieldname','mantle_density','format','Double');
     163
    128164                end % }}}
    129165        end
  • issm/trunk-jpl/test/NightlyRun/test330.m

    r14650 r14734  
    44md=parameterize(md,'../Par/SquareSheetConstrained.par');
    55md=setflowequation(md,'macayeal','all');
    6 md.cluster=generic('name',oshostname(),'np',3);
    7 %md.verbose=verbose('convergence',true,'solution',true,'module',true,'solver',true,'mprocessor',true);
     6md.cluster=generic('name',oshostname(),'np',8);
     7md.verbose=verbose('1111111');
    88md=solve(md,GiaSolutionEnum());
    99
Note: See TracChangeset for help on using the changeset viewer.