source: issm/trunk-jpl/src/c/classes/Elements/Element.h@ 16872

Last change on this file since 16872 was 16872, checked in by seroussi, 11 years ago

CHG: added SSA friction KMatrix in analysis

File size: 14.5 KB
RevLine 
[3683]1/*!\file: Element.h
2 * \brief abstract class for Element object
3 * This class is a place holder for the Tria and the Penta elements.
4 * It is derived from Element, so DataSets can contain them.
5 */
6
7#ifndef _ELEMENT_H_
8#define _ELEMENT_H_
9
10/*Headers:*/
[12365]11/*{{{*/
[15067]12#include "../../datastructures/datastructures.h"
[16789]13#include "../../toolkits/toolkits.h"
[15012]14#include "../Update.h"
[3683]15class DataSet;
16class Parameters;
[14996]17class Elements;
18class Loads;
19class Node;
20class Nodes;
21class Vertices;
22class Materials;
[16693]23class Matpar;
[16675]24class Input;
25class Gauss;
[16799]26class ElementVector;
[13216]27template <class doublematrix> class Matrix;
28template <class doubletype> class Vector;
[16789]29class ElementMatrix;
30class ElementVector;
[3683]31/*}}}*/
32
[4244]33class Element: public Object,public Update{
[3683]34
35 public:
[13623]36
[3683]37 virtual ~Element(){};
[13623]38
[16853]39 virtual bool AllActive(void)=0;
40 virtual bool AnyActive(void)=0;
[16832]41 virtual IssmDouble CharacteristicLength(void)=0;
[14761]42 virtual void Configure(Elements* elements,Loads* loads,Nodes* nodes,Vertices* vertices,Materials* materials,Parameters* parameters)=0;
[14953]43 virtual void SetCurrentConfiguration(Elements* elements,Loads* loads,Nodes* nodes,Materials* materials,Parameters* parameters)=0;
[16042]44 virtual void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int set1_enum,int set2_enum)=0;
[16720]45 virtual void AddBasalInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
[16693]46 virtual void AddInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
[16864]47 virtual void AddInput(Input* input_in)=0;
[16699]48 virtual void AddMaterialInput(int input_enum, IssmDouble* values, int interpolation_enum)=0;
[16789]49 virtual ElementMatrix* CreateKMatrix(void)=0;
[14435]50 virtual void CreateDVector(Vector<IssmDouble>* df)=0;
[16789]51 virtual ElementVector* CreatePVector(void)=0;
[13216]52 virtual void CreateJacobianMatrix(Matrix<IssmDouble>* Jff)=0;
[16778]53 virtual void DeleteMaterials(void)=0;
[16840]54 virtual void ElementSizes(IssmDouble* phx,IssmDouble* phy,IssmDouble* phz)=0;
[16734]55 virtual void EnthalpyToThermal(IssmDouble* ptemperature,IssmDouble* pwaterfraction,IssmDouble enthalpy,IssmDouble pressure)=0;
[16812]56 virtual IssmDouble EnthalpyDiffusionParameter(IssmDouble enthalpy,IssmDouble pressure)=0;
57 virtual IssmDouble EnthalpyDiffusionParameterVolume(int numvertices,IssmDouble* enthalpy,IssmDouble* pressure)=0;
[16675]58 virtual void FindParam(int* pvalue,int paramenum)=0;
59 virtual void FindParam(IssmDouble* pvalue,int paramenum)=0;
[16847]60 virtual void FindParam(int** pvalues,int* psize,int paramenum)=0;
[16675]61 virtual int FiniteElement(void)=0;
[16697]62 virtual IssmDouble GetMaterialParameter(int enum_in)=0;
[16810]63 virtual IssmDouble MinEdgeLength(IssmDouble* xyz_list)=0;
[16799]64 virtual void NodalFunctions(IssmDouble* basis,Gauss* gauss)=0;
[16831]65 virtual void NodalFunctionsVelocity(IssmDouble* basis, Gauss* gauss)=0;
66 virtual void NodalFunctionsPressure(IssmDouble* basis, Gauss* gauss)=0;
[16810]67 virtual void NodalFunctionsDerivatives(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss)=0;
[16831]68 virtual void NodalFunctionsDerivativesVelocity(IssmDouble* dbasis,IssmDouble* xyz_list,Gauss* gauss)=0;
[16839]69 virtual void NormalSection(IssmDouble* normal,IssmDouble* xyz_list)=0;
[16827]70 virtual void NormalTop(IssmDouble* normal,IssmDouble* xyz_list)=0;
[16844]71 virtual void NormalBase(IssmDouble* normal,IssmDouble* xyz_list)=0;
[16813]72 virtual IssmDouble PureIceEnthalpy(IssmDouble pressure)=0;
[16799]73 virtual void TransformLoadVectorCoord(ElementVector* pe,int transformenum)=0;
74 virtual void TransformLoadVectorCoord(ElementVector* pe,int* transformenum_list)=0;
75 virtual void TransformLoadVectorCoord(ElementVector* pe,int numnodes,int transformenum)=0;
76 virtual void TransformLoadVectorCoord(ElementVector* pe,int numnodes,int* transformenum_list)=0;
[16693]77 virtual void TransformSolutionCoord(IssmDouble* values,int transformenum)=0;
[16715]78 virtual void TransformSolutionCoord(IssmDouble* values,int* transformenum_list)=0;
[16775]79 virtual void TransformSolutionCoord(IssmDouble* values,int numnodes,int transformenum)=0;
80 virtual void TransformSolutionCoord(IssmDouble* values,int numnodes,int* transformenum_list)=0;
[16818]81 virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int transformenum)=0;
82 virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int* transformenum_list)=0;
83 virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int transformenum)=0;
84 virtual void TransformStiffnessMatrixCoord(ElementMatrix* Ke,int numnodes,int* transformenum_list)=0;
[16762]85 virtual Element* GetBasalElement(void)=0;
[16675]86 virtual void GetDofList(int** pdoflist,int approximation_enum,int setenum)=0;
87 virtual void GetDofListVelocity(int** pdoflist,int setenum)=0;
88 virtual void GetDofListPressure(int** pdoflist,int setenum)=0;
[16799]89 virtual void JacobianDeterminant(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
[16850]90 virtual void JacobianDeterminantLine(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
[16838]91 virtual void JacobianDeterminantSurface(IssmDouble* Jdet, IssmDouble* xyz_list,Gauss* gauss)=0;
[16803]92 virtual void JacobianDeterminantBase(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
[16827]93 virtual void JacobianDeterminantTop(IssmDouble* Jdet,IssmDouble* xyz_list_base,Gauss* gauss)=0;
[16675]94 virtual void GetSolutionFromInputsOneDof(Vector<IssmDouble>* solution,int solutionenum)=0;
[5719]95 virtual int GetNodeIndex(Node* node)=0;
[13886]96 virtual int GetNumberOfNodes(void)=0;
[16715]97 virtual int GetNumberOfNodesVelocity(void)=0;
98 virtual int GetNumberOfNodesPressure(void)=0;
[16727]99 virtual int GetNumberOfVertices(void)=0;
[13892]100 virtual void GetNodesSidList(int* sidlist)=0;
[16042]101 virtual void GetNodesLidList(int* sidlist)=0;
[13892]102
[7089]103 virtual int Sid()=0;
[10143]104 virtual bool IsFloating()=0;
[12471]105 virtual bool IsNodeOnShelfFromFlags(IssmDouble* flags)=0;
[5745]106 virtual bool IsOnBed()=0;
[16827]107 virtual bool IsOnSurface()=0;
[16872]108 virtual void GetGroundedPart(int* point1,IssmDouble* fraction1,IssmDouble* fraction2, bool* mainlyfloating)=0;
109 virtual IssmDouble GetGroundedPortion(IssmDouble* xyz_list)=0;
[16693]110 virtual void GetInputListOnNodes(IssmDouble* pvalue,int enumtype)=0;
111 virtual void GetInputListOnNodes(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
[12471]112 virtual void GetInputListOnVertices(IssmDouble* pvalue,int enumtype)=0;
113 virtual void GetInputListOnVertices(IssmDouble* pvalue,int enumtype,IssmDouble defaultvalue)=0;
[16675]114 virtual Input* GetInput(int inputenum)=0;
[16848]115 virtual Input* GetMaterialInput(int inputenum)=0;
[12471]116 virtual void GetInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
[16675]117 virtual void GetInputValue(bool* pvalue,int enum_type)=0;
118 virtual void GetInputValue(int* pvalue,int enum_type)=0;
119 virtual void GetInputValue(IssmDouble* pvalue,int enum_type)=0;
[16698]120 virtual void GetVerticesCoordinates(IssmDouble** xyz_list)=0;
[16803]121 virtual void GetVerticesCoordinatesBase(IssmDouble** xyz_list)=0;
[16827]122 virtual void GetVerticesCoordinatesTop(IssmDouble** xyz_list)=0;
[16839]123 virtual IssmDouble GetZcoord(Gauss* gauss)=0;
[16866]124 virtual IssmDouble GetYcoord(Gauss* gauss)=0;
[16188]125 virtual void GetMaterialInputValue(IssmDouble* pvalue,Node* node,int enumtype)=0;
[13623]126
[12471]127 virtual IssmDouble SurfaceArea(void)=0;
[4931]128 virtual void InputDepthAverageAtBase(int enum_type,int average_enum_type,int object_enum)=0;
[16693]129 virtual void InputChangeName(int enum_type,int enum_type_old)=0;
[13216]130 virtual void ComputeBasalStress(Vector<IssmDouble>* sigma_b)=0;
131 virtual void ComputeStrainRate(Vector<IssmDouble>* eps)=0;
[16848]132 virtual void ComputeStressTensor(void)=0;
[16461]133 virtual void ResultInterpolation(int* pinterpolation,int output_enum)=0;
[16589]134 virtual void ResultToVector(Vector<IssmDouble>* vector,int output_enum)=0;
[15613]135 virtual void Update(int index, IoModel* iomodel,int analysis_counter,int analysis_type,int finite_element)=0;
[8967]136 virtual void InputDuplicate(int original_enum,int new_enum)=0;
[16208]137 virtual void InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code)=0;
[16715]138 virtual void InputUpdateFromSolutionOneDofCollapsed(IssmDouble* solution,int inputenum)=0;
[16717]139 virtual void InputUpdateFromSolutionOneDof(IssmDouble* solution,int inputenum)=0;
[13623]140
[15130]141 virtual int NodalValue(IssmDouble* pvalue, int index, int natureofdataenum)=0;
[16675]142 virtual int NumberofNodesVelocity(void)=0;
143 virtual int NumberofNodesPressure(void)=0;
144 virtual Gauss* NewGauss(void)=0;
[16799]145 virtual Gauss* NewGauss(int order)=0;
[16838]146 virtual Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order)=0;
[16839]147 virtual Gauss* NewGauss(IssmDouble* xyz_list, IssmDouble* xyz_list_front,int order_horiz,int order_vert)=0;
[16872]148 virtual Gauss* NewGauss(int point1,IssmDouble fraction1,IssmDouble fraction2,bool mainlyfloating,int order)=0;
[16803]149 virtual Gauss* NewGaussBase(int order)=0;
[16850]150 virtual Gauss* NewGaussLine(int vertex1,int vertex2,int order)=0;
[16827]151 virtual Gauss* NewGaussTop(int order)=0;
[16803]152 virtual ElementVector* NewElementVector(int approximation_enum=NoneApproximationEnum)=0;
[16818]153 virtual ElementMatrix* NewElementMatrix(int approximation_enum=NoneApproximationEnum)=0;
[12471]154 virtual void InputScale(int enum_type,IssmDouble scale_factor)=0;
[13216]155 virtual void GetVectorFromInputs(Vector<IssmDouble>* vector, int name_enum)=0;
[12471]156 virtual IssmDouble TimeAdapt()=0;
157 virtual void PositiveDegreeDay(IssmDouble* pdds,IssmDouble* pds,IssmDouble signorm)=0;
[12748]158 virtual void Delta18oParameterization(void)=0;
[16721]159 virtual void SmbGradients(void)=0;
160 virtual Element* SpawnBasalElement(void)=0;
[16699]161 virtual IssmDouble TMeltingPoint(IssmDouble pressure)=0;
[16789]162 virtual void ReduceMatrices(ElementMatrix* Ke,ElementVector* pe)=0;
[10440]163 virtual void ResetCoordinateSystem()=0;
[16810]164 virtual IssmDouble StabilizationParameter(IssmDouble u, IssmDouble v, IssmDouble w, IssmDouble diameter, IssmDouble kappa)=0;
[16860]165 virtual void ValueP1OnGauss(IssmDouble* pvalue,IssmDouble* values,Gauss* gauss)=0;
166 virtual void ValueP1DerivativesOnGauss(IssmDouble* dvalue,IssmDouble* values,IssmDouble* xyz_list,Gauss* gauss)=0;
[16810]167 virtual void ViscousHeating(IssmDouble* pphi,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
[16831]168 virtual void ViscosityFS(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input,Input* vz_input)=0;
[16829]169 virtual void ViscosityHO(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
[16818]170 virtual void ViscositySSA(IssmDouble* pviscosity,IssmDouble* xyz_list,Gauss* gauss,Input* vx_input,Input* vy_input)=0;
[16675]171 virtual int VelocityInterpolation()=0;
172 virtual int PressureInterpolation()=0;
[16833]173 virtual bool IsZeroLevelset(int levelset_enum)=0;
[16838]174 virtual void ZeroLevelsetCoordinates(IssmDouble** pxyz_zero,IssmDouble* xyz_list,int levelsetenum)=0;
[9817]175
176 #ifdef _HAVE_RESPONSES_
[15387]177 virtual void AverageOntoPartition(Vector<IssmDouble>* partition_contributions,Vector<IssmDouble>* partition_areas,IssmDouble* vertex_response,IssmDouble* qmu_part)=0;
[15130]178 virtual void MinVel(IssmDouble* pminvel)=0;
179 virtual void MaxVel(IssmDouble* pmaxvel)=0;
180 virtual void MinVx(IssmDouble* pminvx)=0;
181 virtual void MaxVx(IssmDouble* pmaxvx)=0;
182 virtual void MaxAbsVx(IssmDouble* pmaxabsvx)=0;
183 virtual void MinVy(IssmDouble* pminvy)=0;
184 virtual void MaxVy(IssmDouble* pmaxvy)=0;
185 virtual void MaxAbsVy(IssmDouble* pmaxabsvy)=0;
186 virtual void MinVz(IssmDouble* pminvz)=0;
187 virtual void MaxVz(IssmDouble* pmaxvz)=0;
188 virtual void MaxAbsVz(IssmDouble* pmaxabsvz)=0;
189 virtual IssmDouble MassFlux(IssmDouble* segment)=0;
[16388]190 virtual IssmDouble MassFlux(IssmDouble x1,IssmDouble y1, IssmDouble x2, IssmDouble y2,int segment_id)=0;
[15129]191 virtual void ElementResponse(IssmDouble* presponse,int response_enum)=0;
[12471]192 virtual IssmDouble IceVolume(void)=0;
[16275]193 virtual IssmDouble IceVolumeAboveFloatation(void)=0;
[12773]194 virtual IssmDouble TotalSmb(void)=0;
[16787]195 virtual IssmDouble Misfit(int modelenum,int observationenum,int weightsenum)=0;
[16849]196 virtual int VertexConnectivity(int vertexindex)=0;
[16850]197 virtual void VerticalSegmentIndices(int** pindices,int* pnumseg)=0;
[9817]198 #endif
[4055]199
[14589]200 #ifdef _HAVE_GIA_
[14807]201 virtual void GiaDeflection(Vector<IssmDouble>* wg,Vector<IssmDouble>* dwgdt,IssmDouble* x,IssmDouble* y)=0;
[14589]202 #endif
203
[9817]204 #ifdef _HAVE_CONTROL_
[13216]205 virtual void Gradj(Vector<IssmDouble>* gradient,int control_type,int control_index)=0;
[16314]206 virtual IssmDouble ThicknessAbsMisfit(void)=0;
207 virtual IssmDouble SurfaceAbsVelMisfit(void)=0;
208 virtual IssmDouble SurfaceRelVelMisfit(void)=0;
209 virtual IssmDouble SurfaceLogVelMisfit(void)=0;
210 virtual IssmDouble SurfaceLogVxVyMisfit(void)=0;
211 virtual IssmDouble SurfaceAverageVelMisfit(void)=0;
212 virtual IssmDouble ThicknessAbsGradient(void)=0;
213 virtual IssmDouble ThicknessAlongGradient(void)=0;
214 virtual IssmDouble ThicknessAcrossGradient(void)=0;
215 virtual IssmDouble BalancethicknessMisfit(void)=0;
216 virtual IssmDouble RheologyBbarAbsGradient(void)=0;
217 virtual IssmDouble DragCoefficientAbsGradient(void)=0;
[13216]218 virtual void ControlInputGetGradient(Vector<IssmDouble>* gradient,int enum_type,int control_index)=0;
[12471]219 virtual void ControlInputSetGradient(IssmDouble* gradient,int enum_type,int control_index)=0;
220 virtual void ControlInputScaleGradient(int enum_type, IssmDouble scale)=0;
[16494]221 virtual void ControlToVectors(Vector<IssmPDouble>* vector_control, Vector<IssmPDouble>* vector_gradient,int control_enum)=0;
[13216]222 virtual void GetVectorFromControlInputs(Vector<IssmDouble>* gradient,int control_enum,int control_index,const char* data)=0;
[12471]223 virtual void SetControlInputsFromVector(IssmDouble* vector,int control_enum,int control_index)=0;
224 virtual void InputControlUpdate(IssmDouble scalar,bool save_parameter)=0;
[9817]225 #endif
[14796]226
[16442]227 virtual void UpdateConstraintsExtrudeFromBase(void)=0;
228 virtual void UpdateConstraintsExtrudeFromTop(void)=0;
229
[15853]230 #ifdef _HAVE_THERMAL_
[16272]231 virtual void UpdateBasalConstraintsEnthalpy(void)=0;
[16026]232 virtual void ComputeBasalMeltingrate(void)=0;
[16816]233 virtual void DrainWaterfraction(IssmDouble* drainrate_element)=0;
[15853]234 #endif
235
[14796]236 #ifdef _HAVE_HYDROLOGY_
[14967]237 virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, Node* innode)=0;
[16761]238 virtual void GetHydrologyDCInefficientHmax(IssmDouble* ph_max, int index)=0;
[15015]239 virtual void GetHydrologyTransfer(Vector<IssmDouble>* transfer)=0;
[15249]240 virtual void HydrologyEPLGetMask(Vector<IssmDouble>* mask)=0;
241 virtual void HydrologyEPLGetActive(Vector<IssmDouble>* active)=0;
[16600]242 virtual void ComputeEPLThickness(void)=0;
[14796]243 #endif
[15643]244
[15386]245 #ifdef _HAVE_GROUNDINGLINE_
[15962]246 virtual void MigrateGroundingLine(IssmDouble* sheet_ungrounding)=0;
[15386]247 virtual void PotentialUngrounding(Vector<IssmDouble>* potential_sheet_ungrounding)=0;
248 virtual int UpdatePotentialUngrounding(IssmDouble* potential_sheet_ungrounding,Vector<IssmDouble>* vec_nodes_on_iceshelf,IssmDouble* nodes_on_iceshelf)=0;
249 #endif
250
[3683]251};
252#endif
Note: See TracBrowser for help on using the repository browser.