nextsimhub / nextsimdg

neXtSIM_DG : next generation sea-ice model with DG
https://nextsim-dg.readthedocs.io/en/latest/?badge=latest
Apache License 2.0
10 stars 13 forks source link

Compiling DG1 doesn't work #723

Closed einola closed 4 weeks ago

einola commented 1 month ago

We are not setting the DGadvection, DGstress and CG optinos correctly everywhere, because when compiling after running cmake -DDynamicsType=DG1 gives the following error

In file included from /cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/Core:164,
                 from /cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/Dense:1,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/ParametricMesh.hpp:10,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/ParametricMap.hpp:11,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/DGTransport.hpp:10,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/DynamicsKernel.hpp:11,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/CGDynamicsKernel.hpp:11,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/BrittleCGDynamicsKernel.hpp:11,
                 from /cluster/home/einola/src/nextsimdg/dynamics/src/include/BBMDynamicsKernel.hpp:12,
                 from /cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/include/BBMDynamics.hpp:11,
                 from /cluster/home/einola/src/nextsimdg/core/src/modules/DynamicsModule/BBMDynamics.cpp:9:
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/AssignEvaluator.h: In instantiation of ‘void Eigen::internal::call_assignment_no_alias(Dst&, const Src&, const Func&) [with Dst = Eigen::Matrix<double, 1, 4>; Src = Eigen::Matrix<double, 1, 9>; Func = Eigen::internal::assign_op<double, double>]’:
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/PlainObjectBase.h:797:41:   required from ‘Derived& Eigen::PlainObjectBase<Derived>::_set_noalias(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 1, 9>; Derived = Eigen::Matrix<double, 1, 4>]’
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/PlainObjectBase.h:594:19:   required from ‘Eigen::PlainObjectBase<Derived>::PlainObjectBase(const Eigen::DenseBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 1, 9>; Derived = Eigen::Matrix<double, 1, 4>]’
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/Matrix.h:423:29:   required from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const Eigen::EigenBase<OtherDerived>&) [with OtherDerived = Eigen::Matrix<double, 1, 9>; _Scalar = double; int _Rows = 1; int _Cols = 4; int _Options = 1; int _MaxRows = 1; int _MaxCols = 4]’
/cluster/home/einola/src/nextsimdg/dynamics/src/include/BBMStressUpdateStep.hpp:168:72:   required from ‘void Nextsim::BBMStressUpdateStep<DGadvection, DGstress, CG>::stressUpdateHighOrder(const Nextsim::DynamicsParameters&, const Nextsim::ParametricMesh&, Nextsim::BBMStressUpdateStep<DGadvection, DGstress, CG>::SymmetricTensorVector&, const SymmetricTensorVector&, const Nextsim::DGVector<DG>&, const Nextsim::DGVector<DG>&, double) [with int DGadvection = 3; int DGstress = 3; int CG = 1; Nextsim::BBMStressUpdateStep<DGadvection, DGstress, CG>::SymmetricTensorVector = std::array<std::reference_wrapper<Nextsim::DGVector<3> >, 3>]’
/cluster/home/einola/src/nextsimdg/dynamics/src/include/BBMStressUpdateStep.hpp:31:10:   required from here
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/AssignEvaluator.h:887:3: error: static assertion failed: YOU_MIXED_MATRICES_OF_DIFFERENT_SIZES
  887 |   EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned,Src)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/cluster/software/Eigen/3.4.0-GCCcore-11.3.0/include/Eigen/src/Core/AssignEvaluator.h:887:3: note: ‘(((((int)Eigen::internal::size_of_xpr_at_compile_time<Eigen::Matrix<double, 1, 4> >::ret) == 0) && (((int)Eigen::internal::size_of_xpr_at_compile_time<Eigen::Matrix<double, 1, 9> >::ret) == 0)) || ((((((int)Eigen::Matrix<double, 1, 4>::RowsAtCompileTime) == ((int)Eigen::Dynamic)) || (((int)Eigen::Matrix<double, 1, 9>::RowsAtCompileTime) == ((int)Eigen::Dynamic))) || (((int)Eigen::Matrix<double, 1, 4>::RowsAtCompileTime) == ((int)Eigen::Matrix<double, 1, 9>::RowsAtCompileTime))) && (((((int)Eigen::Matrix<double, 1, 4>::ColsAtCompileTime) == ((int)Eigen::Dynamic)) || (((int)Eigen::Matrix<double, 1, 9>::ColsAtCompileTime) == ((int)Eigen::Dynamic))) || (((int)Eigen::Matrix<double, 1, 4>::ColsAtCompileTime) == ((int)Eigen::Matrix<double, 1, 9>::ColsAtCompileTime)))))’ evaluates to false
make[2]: *** [CMakeFiles/nextsimlib.dir/build.make:482: CMakeFiles/nextsimlib.dir/core/src/modules/DynamicsModule/BBMDynamics.cpp.o] Error 1
Thanduriel commented 4 weeks ago

Looks like a duplicate of #651 to me.

einola commented 4 weeks ago

Yes, it is!