-
Notifications
You must be signed in to change notification settings - Fork 19
Issue 779: stress restart #930
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
5c83aa9
809f590
6a93434
c76fb3b
0707c10
365243c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,12 +20,6 @@ namespace Nextsim { | |
| // The brittle momentum solver for CG velocity fields | ||
| template <int DGadvection> class BrittleCGDynamicsKernel : public CGDynamicsKernel<DGadvection> { | ||
| protected: | ||
| using DynamicsKernel<DGadvection, DGstressComp>::s11; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::s12; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::s22; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::e11; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::e12; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::e22; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::hice; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::cice; | ||
| using DynamicsKernel<DGadvection, DGstressComp>::smesh; | ||
|
|
@@ -37,6 +31,12 @@ template <int DGadvection> class BrittleCGDynamicsKernel : public CGDynamicsKern | |
|
|
||
| using CGDynamicsKernel<DGadvection>::u; | ||
| using CGDynamicsKernel<DGadvection>::v; | ||
| using CGDynamicsKernel<DGadvection>::s11; | ||
| using CGDynamicsKernel<DGadvection>::s12; | ||
| using CGDynamicsKernel<DGadvection>::s22; | ||
| using CGDynamicsKernel<DGadvection>::e11; | ||
| using CGDynamicsKernel<DGadvection>::e12; | ||
| using CGDynamicsKernel<DGadvection>::e22; | ||
| using CGDynamicsKernel<DGadvection>::xGradSeaSurfaceHeight; | ||
| using CGDynamicsKernel<DGadvection>::yGradSeaSurfaceHeight; | ||
| using CGDynamicsKernel<DGadvection>::uAtmos; | ||
|
|
@@ -157,6 +157,12 @@ template <int DGadvection> class BrittleCGDynamicsKernel : public CGDynamicsKern | |
| { | ||
| if (name == damageName) { | ||
| throw std::runtime_error(std::string("Use setDGArray() to set the data for ") + name); | ||
| // } else if (name == stress11Name) { | ||
| // DGModelArray::ma2dg(data, s11); | ||
| // } else if (name == stress12Name) { | ||
| // DGModelArray::ma2dg(data, s12); | ||
| // } else if (name == stress22Name) { | ||
| // DGModelArray::ma2dg(data, s22); | ||
|
Comment on lines
+160
to
+165
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not needed |
||
| } else { | ||
| CGDynamicsKernel<DGadvection>::setData(name, data); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,20 +57,20 @@ template <int DGadvection, int DGstress> class DynamicsKernel { | |
|
|
||
| seaSurfaceHeight.resize_by_mesh(*smesh); | ||
|
|
||
| e11.resize_by_mesh(*smesh); | ||
| e12.resize_by_mesh(*smesh); | ||
| e22.resize_by_mesh(*smesh); | ||
| s11.resize_by_mesh(*smesh); | ||
| s12.resize_by_mesh(*smesh); | ||
| s22.resize_by_mesh(*smesh); | ||
| // e11.resize_by_mesh(*smesh); | ||
| // e12.resize_by_mesh(*smesh); | ||
| // e22.resize_by_mesh(*smesh); | ||
| // s11.resize_by_mesh(*smesh); | ||
| // s12.resize_by_mesh(*smesh); | ||
| // s22.resize_by_mesh(*smesh); | ||
|
Comment on lines
+60
to
+65
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove commented code |
||
|
|
||
| // Set initial values to zero. Prognostic fields will be filled from the restart file. | ||
| e11.zero(); | ||
| e12.zero(); | ||
| e22.zero(); | ||
| s11.zero(); | ||
| s12.zero(); | ||
| s22.zero(); | ||
| // e11.zero(); | ||
| // e12.zero(); | ||
| // e22.zero(); | ||
| // s11.zero(); | ||
| // s12.zero(); | ||
| // s22.zero(); | ||
|
Comment on lines
+68
to
+73
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove commented code |
||
| } | ||
|
|
||
| /*! | ||
|
|
@@ -91,9 +91,16 @@ template <int DGadvection, int DGstress> class DynamicsKernel { | |
| */ | ||
| virtual void setData(const std::string& name, const ModelArray& data) | ||
| { | ||
|
|
||
| static const std::set<std::string> vectorHolderNames = { | ||
| hiceName, | ||
| ciceName, | ||
| hsnowName, | ||
| stress11Name, | ||
| stress12Name, | ||
| stress22Name, | ||
| }; | ||
| // Special cases: hice, cice, (damage, stress) <- not yet implemented | ||
| if (name == hiceName || name == ciceName || name == hsnowName) { | ||
| if (vectorHolderNames.count(name)) { | ||
| throw std::runtime_error(std::string("Use setDGArray() to set the data for ") + name); | ||
| } else if (name == sshName) { | ||
| DGModelArray::ma2dg(data, seaSurfaceHeight); | ||
|
|
@@ -125,14 +132,6 @@ template <int DGadvection, int DGstress> class DynamicsKernel { | |
| if (name == hiceName || name == ciceName || name == hsnowName) { | ||
| throw std::runtime_error( | ||
| std::string("DynamicsKernel::getDG0Data: Use array sharing for ") + name); | ||
| } else if (name == shearName) { | ||
| return DGModelArray::dg2ma(Tools::Shear(*smesh, e11, e12, e22), data); | ||
| } else if (name == divergenceName) { | ||
| return DGModelArray::dg2ma(Tools::TensorInvI(*smesh, e11, e12, e22), data); | ||
| } else if (name == sigmaIName) { | ||
| return DGModelArray::dg2ma(Tools::TensorInvI(*smesh, s11, s12, s22), data); | ||
| } else if (name == sigmaIIName) { | ||
| return DGModelArray::dg2ma(Tools::TensorInvII(*smesh, s11, s12, s22), data); | ||
| } else { | ||
| // Any other named field must exist | ||
| return ModelArray(ModelArray::component0Type(ModelArray::AdvectionType)); | ||
|
|
@@ -199,8 +198,9 @@ template <int DGadvection, int DGstress> class DynamicsKernel { | |
| DGVector<1> seaSurfaceHeight; | ||
|
|
||
| //! Vectors storing strain and stress components | ||
| DGVector<DGstress> e11, e12, e22; | ||
| DGVector<DGstress> s11, s12, s22; | ||
| // DGVector<DGstress> e11, e12, e22; | ||
| // DGVector<DGstress> /*s11,*/ s12, s22; | ||
| // DGVectorHolder<DGstress> s11, s12, s22; | ||
|
Comment on lines
+201
to
+203
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove commented code |
||
|
|
||
| size_t stepNumber = 0; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should be reverted?