Index: ../trunk-jpl/src/c/classes/Elements/Element.h =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 16913) @@ -50,15 +50,17 @@ ~Element(); /*Functions*/ - void AddInput(Input* input_in); - bool AllActive(void); - bool AnyActive(void); - void DeleteMaterials(void); - void FindParam(bool* pvalue,int paramenum); - void FindParam(int* pvalue,int paramenum); - void FindParam(IssmDouble* pvalue,int paramenum); - void FindParam(int** pvalues,int* psize,int paramenum); - Input* GetInput(int inputenum); + void AddInput(Input* input_in); + bool AllActive(void); + bool AnyActive(void); + void DeleteMaterials(void); + void FindParam(bool* pvalue,int paramenum); + void FindParam(int* pvalue,int paramenum); + void FindParam(IssmDouble* pvalue,int paramenum); + void FindParam(int** pvalues,int* psize,int paramenum); + Input* GetInput(int inputenum); + IssmDouble GetMaterialParameter(int enum_in); + bool IsFloating(); /*Virtual functions*/ virtual void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum)=0; @@ -69,16 +71,14 @@ virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0; virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum)=0; virtual ElementMatrix* CreateKMatrix(void)=0; - virtual void CreateDVector(Vector* df)=0; virtual ElementVector* CreatePVector(void)=0; + virtual void CreateDVector(Vector* df)=0; virtual void CreateJacobianMatrix(Matrix* Jff)=0; virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0; virtual void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure)=0; virtual IssmDouble EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure)=0; virtual IssmDouble EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure)=0; - virtual int FiniteElement(void)=0; - virtual IssmDouble GetMaterialParameter(int enum_in)=0; virtual IssmDouble MinEdgeLength(IssmDouble* xyz_list)=0; virtual void NodalFunctions(IssmDouble* basis,Gauss* gauss)=0; virtual void NodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss)=0; @@ -121,7 +121,6 @@ virtual void GetNodesLidList(int* sidlist)=0; virtual int Sid()=0; - virtual bool IsFloating()=0; virtual bool IsNodeOnShelfFromFlags(IssmDouble* flags)=0; virtual bool IsOnBed()=0; virtual bool IsOnSurface()=0; Index: ../trunk-jpl/src/c/classes/Elements/Tria.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Tria.cpp (revision 16913) @@ -1122,22 +1122,6 @@ return phi; } /*}}}*/ -/*FUNCTION Tria::GetMaterialParameter{{{*/ -IssmDouble Tria::GetMaterialParameter(int enum_in){ - - _assert_(this->matpar); - switch(enum_in){ // FIXME: change this to material - case MaterialsRheologyNEnum: - return this->material->GetN(); - case MaterialsRheologyBEnum: - return this->material->GetB(); - case MaterialsRheologyBbarEnum: - return this->material->GetBbar(); - default: - return this->matpar->GetMaterialParameter(enum_in); - } -} -/*}}}*/ /*FUNCTION Tria::GetVerticesCoordinates(IssmDouble** pxyz_list){{{*/ void Tria::GetVerticesCoordinates(IssmDouble** pxyz_list){ @@ -2210,26 +2194,6 @@ _error_("Could not find 2 vertices on surface"); } /*}}}*/ -/*FUNCTION Tria::IsFloating {{{*/ -bool Tria::IsFloating(){ - - bool shelf; - int migration_style; - parameters->FindParam(&migration_style,GroundinglineMigrationEnum); - - if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){ //Floating if all nodes are floating - if(this->inputs->Max(MaskGroundediceLevelsetEnum) <= 0.) shelf=true; - else shelf=false; - } - else if(migration_style==NoneEnum || migration_style==AgressiveMigrationEnum || migration_style==SoftMigrationEnum){ //Floating if all nodes are floating - if(this->inputs->Min(MaskGroundediceLevelsetEnum) > 0.) shelf=false; - else shelf=true; - } - else _error_("migration_style not implemented yet"); - - return shelf; -} -/*}}}*/ /*FUNCTION Tria::IsNodeOnShelfFromFlags {{{*/ bool Tria::IsNodeOnShelfFromFlags(IssmDouble* flags){ Index: ../trunk-jpl/src/c/classes/Elements/Tria.h =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Tria.h (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Tria.h (revision 16913) @@ -96,7 +96,6 @@ void EdgeOnBedIndices(int* pindex1,int* pindex); int EdgeOnBedIndex(); int EdgeOnSurfaceIndex(); - bool IsFloating(); bool IsNodeOnShelfFromFlags(IssmDouble* flags); int NumberofNodesVelocity(void); int NumberofNodesPressure(void); @@ -255,7 +254,6 @@ void NormalSection(IssmDouble* normal,IssmDouble* xyz_list); void NormalTop(IssmDouble* normal,IssmDouble* xyz_list); void NormalBase(IssmDouble* normal,IssmDouble* xyz_list); - IssmDouble GetMaterialParameter(int enum_in); Input* GetMaterialInput(int inputenum); void GetInputListOnVertices(IssmDouble* pvalue,int enumtype); void GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue); Index: ../trunk-jpl/src/c/classes/Elements/Penta.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Penta.cpp (revision 16913) @@ -989,20 +989,6 @@ *pdoflist=doflist; } /*}}}*/ -/*FUNCTION Penta::GetMaterialParameter{{{*/ -IssmDouble Penta::GetMaterialParameter(int enum_in){ - - _assert_(this->matpar); - switch(enum_in){ // FIXME: change this to material - case MaterialsRheologyNEnum: - return this->material->GetN(); - case MaterialsRheologyBEnum: - return this->material->GetB(); - default: - return this->matpar->GetMaterialParameter(enum_in); - } -} -/*}}}*/ /*FUNCTION Penta::GetGroundedPart{{{*/ void Penta::GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating){ /*Computeportion of the element that is grounded*/ @@ -2343,26 +2329,6 @@ else return false; } /*}}}*/ -/*FUNCTION Penta::IsFloating{{{*/ -bool Penta::IsFloating(){ - - bool shelf; - int migration_style; - parameters->FindParam(&migration_style,GroundinglineMigrationEnum); - - if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){ //Floating if all nodes are floating - if(this->inputs->Max(MaskGroundediceLevelsetEnum) <= 0.) shelf=true; - else shelf=false; - } - else if(migration_style==NoneEnum || migration_style==AgressiveMigrationEnum || migration_style==SoftMigrationEnum){ //Floating if all nodes are floating - if(this->inputs->Min(MaskGroundediceLevelsetEnum) > 0.) shelf=false; - else shelf=true; - } - else _error_("migration_style not implemented yet"); - - return shelf; -} -/*}}}*/ /*FUNCTION Penta::IsNodeOnShelfFromFlags {{{*/ bool Penta::IsNodeOnShelfFromFlags(IssmDouble* flags){ Index: ../trunk-jpl/src/c/classes/Elements/Penta.h =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Penta.h (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Penta.h (revision 16913) @@ -87,7 +87,6 @@ int GetNumberOfNodesPressure(void); int GetNumberOfNodesVelocity(void); int GetNumberOfVertices(void); - IssmDouble GetMaterialParameter(int enum_in); void GetSolutionFromInputsOneDof(Vector* solution,int enum_type); IssmDouble GetZcoord(Gauss* gauss); IssmDouble GetYcoord(Gauss* gauss){_error_("Not implemented");}; @@ -240,7 +239,6 @@ bool IsInput(int name); bool IsOnSurface(void); bool IsOnBed(void); - bool IsFloating(void); bool IsNodeOnShelfFromFlags(IssmDouble* flags); void JacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss); void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss); Index: ../trunk-jpl/src/c/classes/Elements/Seg.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Seg.cpp (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Seg.cpp (revision 16913) @@ -123,13 +123,6 @@ } /*}}}*/ -/*FUNCTION Seg::GetMaterialParameter{{{*/ -IssmDouble Seg::GetMaterialParameter(int enum_in){ - - _assert_(this->matpar); - return this->matpar->GetMaterialParameter(enum_in); -} -/*}}}*/ /*FUNCTION Seg::GetSize{{{*/ IssmDouble Seg::GetSize(void){ Index: ../trunk-jpl/src/c/classes/Elements/Seg.h =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Seg.h (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Seg.h (revision 16913) @@ -85,7 +85,6 @@ void GetDofListPressure(int** pdoflist,int setenum){_error_("not implemented yet");}; void GetInputListOnNodes(IssmDouble* pvalue,int enumtype){_error_("not implemented yet");}; void GetInputListOnNodes(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue){_error_("not implemented yet");}; - IssmDouble GetMaterialParameter(int enum_in); int GetNodeIndex(Node* node){_error_("not implemented yet");}; void GetNodesSidList(int* sidlist){_error_("not implemented yet");}; void GetNodesLidList(int* lidlist){_error_("not implemented yet");}; @@ -100,7 +99,6 @@ void InputChangeName(int input_enum, int enum_type_old){_error_("not implemented yet");}; bool IsOnBed(){_error_("not implemented yet");}; bool IsOnSurface(){_error_("not implemented yet");}; - bool IsFloating(){_error_("not implemented yet");}; bool IsNodeOnShelfFromFlags(IssmDouble* flags){_error_("not implemented yet");}; void JacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss); void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss){_error_("not implemented yet");}; Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp =================================================================== --- ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 16912) +++ ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 16913) @@ -67,6 +67,39 @@ void Element::FindParam(int** pvalues,int* psize,int paramenum){/*{{{*/ this->parameters->FindParam(pvalues,psize,paramenum); }/*}}}*/ +IssmDouble Element::GetMaterialParameter(int enum_in){/*{{{*/ + + _assert_(this->matpar); + switch(enum_in){ // FIXME: change this to material + case MaterialsRheologyNEnum: + return this->material->GetN(); + case MaterialsRheologyBEnum: + return this->material->GetB(); + case MaterialsRheologyBbarEnum: + return this->material->GetBbar(); + default: + return this->matpar->GetMaterialParameter(enum_in); + } +} +/*}}}*/ Input* Element::GetInput(int inputenum){/*{{{*/ return inputs->GetInput(inputenum); }/*}}}*/ +bool Element::IsFloating(){/*{{{*/ + + bool shelf; + int migration_style; + parameters->FindParam(&migration_style,GroundinglineMigrationEnum); + + if(migration_style==SubelementMigrationEnum || migration_style==SubelementMigration2Enum){ //Floating if all nodes are floating + if(this->inputs->Max(MaskGroundediceLevelsetEnum) <= 0.) shelf=true; + else shelf=false; + } + else if(migration_style==NoneEnum || migration_style==AgressiveMigrationEnum || migration_style==SoftMigrationEnum){ //Floating if all nodes are floating + if(this->inputs->Min(MaskGroundediceLevelsetEnum) > 0.) shelf=false; + else shelf=true; + } + else _error_("migration_style not implemented yet"); + + return shelf; +}/*}}}*/