Skip to content

Commit

Permalink
Addressing Tim's github comments
Browse files Browse the repository at this point in the history
A bit of tidying up comments and diagnostic messages.
  • Loading branch information
einola committed Dec 6, 2024
1 parent f5235fa commit d962d50
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 41 deletions.
10 changes: 7 additions & 3 deletions dynamics/src/cgParametricMomentum.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @file ParametricMomentum.cpp
* @date 19 Nov 2024
* @date 06 Dec 2024
* @author Thomas Richter <thomas.richter@ovgu.de>
*/

Expand Down Expand Up @@ -216,10 +216,14 @@ void CGParametricMomentum<CG>::mEVPStep(const VPParameters& params, const size_t

// Update the stresses according to the mEVP model

std::cerr << "Fatal: Stressupdatehigherorder requires ParametricMomnetumMap with proper "
"template parameter. See headerfile and use Kernel-infrastructure"
std::cerr << "CGParametricMomentum::mEVPStep(): Fatal: StressUpdateHighOrder requires "
"ParametricMomentumMap with proper template parameter. See header file and use "
"kernel infrastructure."
<< std::endl;
abort();
/* NB! For this function to work, StressUpdateHighOrder must be called with the proper template
* parameters. This would require some work, but cgParametricMomentum is depricated and will be
* removed in future version. */
// Nextsim::mEVP::StressUpdateHighOrder(
// params, pmap, smesh, S11, S12, S22, E11, E12, E22, H, A, alpha, beta);

Expand Down
12 changes: 1 addition & 11 deletions dynamics/src/include/BBM.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @file BBM.hpp
* @date 19 Nov 2024
* @date 06 Dec 2024
* @author Einar Olason <Einar.Olason@nersc.no>
* @author Piotr Minakowski <piotr.minakowski@ovgu.de>
*/
Expand Down Expand Up @@ -170,16 +170,6 @@ namespace BBM {
// // INTEGRATION OF STRESS AND DAMAGE
const Eigen::Matrix<Nextsim::FloatType, 1, NGP * NGP> J
= ParametricTools::J<3>(smesh, i);
// // get the inverse of the mass matrix scaled with the test-functions in the gauss
// // points, with the gauss weights and with J. This is a 8 x 9 matrix
// const Eigen::Matrix<Nextsim::FloatType, DGs, NGP * NGP> imass_psi
// = ParametricTools::massMatrix<DGs>(smesh, i).inverse()
// * (PSI<DGs, NGP>.array().rowwise() * (GAUSSWEIGHTS<NGP>.array() * J.array()))
// .matrix();

// S11.row(i) = imass_psi * s11_gauss.matrix().transpose();
// S12.row(i) = imass_psi * s12_gauss.matrix().transpose();
// S22.row(i) = imass_psi * s22_gauss.matrix().transpose();

S11.row(i) = pmap.iMJwPSI[i] * s11_gauss.matrix().transpose();
S12.row(i) = pmap.iMJwPSI[i] * s12_gauss.matrix().transpose();
Expand Down
23 changes: 1 addition & 22 deletions dynamics/src/include/BBMStressUpdateStep.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @file BBMStressUpdateStep.hpp
*
* @date 19 Nov 2024
* @date 06 Dec 2024
* @author Tim Spain <timothy.spain@nersc.no>
*/

Expand Down Expand Up @@ -167,30 +167,9 @@ class BBMStressUpdateStep : public StressUpdateStep<DGadvection, DGstress> {
s22Gauss.array() -= s22Gauss.array() * (1. - dcrit.array()) * deltaT / td.array();

// INTEGRATION OF STRESS AND DAMAGE
// const Eigen::Matrix<Nextsim::FloatType, 1, nGauss * nGauss> J
// = ParametricTools::J<3>(smesh, i);
// // get the inverse of the mass matrix scaled with the test-functions in the gauss
// // points, with the gauss weights and with J. This is a 8 x 9 matrix
// const Eigen::Matrix<Nextsim::FloatType, DGstress, nGauss * nGauss> imass_psi
// = ParametricTools::massMatrix<DGstress>(smesh, i).inverse()
// * (PSI<DGstress, nGauss>.array().rowwise()
// * (GAUSSWEIGHTS<nGauss>.array() * J.array()))
// .matrix();

// s11.row(i) = imass_psi * s11Gauss.matrix().transpose();
// s12.row(i) = imass_psi * s12Gauss.matrix().transpose();
// s22.row(i) = imass_psi * s22Gauss.matrix().transpose();

s11.row(i) = pmap->iMJwPSI[i] * s11Gauss.matrix().transpose();
s12.row(i) = pmap->iMJwPSI[i] * s12Gauss.matrix().transpose();
s22.row(i) = pmap->iMJwPSI[i] * s22Gauss.matrix().transpose();

// const Eigen::Matrix<Nextsim::FloatType, DGadvection, nGauss* nGauss> imass_psi2
// = ParametricTools::massMatrix<DGadvection>(smesh, i).inverse()
// * (PSI<DGadvection, nGauss>.array().rowwise()
// * (GAUSSWEIGHTS<nGauss>.array() * J.array()))
// .matrix();

p_d->row(i) = pmap->iMJwPSI_dam[i] * dGauss.matrix().transpose();
}
}
Expand Down
10 changes: 5 additions & 5 deletions dynamics/src/include/cgParametricMomentum.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* @file cgParametricMomentum.hpp
* @date 09 Nov 2024
* @date 06 Dec 2024
* @author Thomas Richter <thomas.richter@ovgu.de>
*/

Expand Down Expand Up @@ -64,10 +64,10 @@ template <int CG> class CGParametricMomentum {
: smesh(sm)
, pmap(sm)
{
std::cerr << "CGParametricMomentum can't be used any more. It is replaced by the different "
"Kernels. Reason is that the ParamwetricMomentumMap requires the DGadvection "
"degree as template but this is not provided. It could be easily changed, but "
"instead one should use the Kernel-infrastructure."
std::cerr << "CGParametricMomentum can't be used any more. It is replaced by the various "
"dynamics kernels. ParametricMomentumMap requires the DGadvection degree as "
"template but this is not available in CGParametricMomentum. Please use the "
"Kernel-infrastructure instead."
<< std::endl;

if (!(smesh.nelements > 0)) {
Expand Down

0 comments on commit d962d50

Please # to comment.