idaholab/moose: framework coverage diff

Base e0c998 Head #31800 3d6550
Total Total +/- New
Rate 85.98% 85.98% +0.00% 100.00%
Hits 124191 124195 +4 20
Misses 20255 20255 - 0
Filename Stmts Miss Cover
framework/src/systems/NonlinearSystemBase.C +4 0 +0.02%
TOTAL +4 0 +0.00%
code
coverage unchanged
code
coverage increased
code
coverage decreased
+
line added or modified

framework/src/constraints/NodalConstraint.C

57  
58  
59  
60 +
61  
62  
63  
}

void
NodalConstraint::computeResidual(const NumericVector<Number> & residual)
{
  if ((_weights.size() == 0) && (_primary_node_vector.size() == 1))
    _weights.push_back(1.0);
99  
100  
101  
102 +
103  
104  
105  
}

void
NodalConstraint::computeJacobian(const SparseMatrix<Number> & jacobian)
{
  if ((_weights.size() == 0) && (_primary_node_vector.size() == 1))
    _weights.push_back(1.0);

framework/src/systems/NonlinearSystemBase.C

1126  
1127  
1128  
1129 +
1130  
1131  
1132  
}

bool
NonlinearSystemBase::enforceNodalConstraintsJacobian(const SparseMatrix<Number> & jacobian_to_view)
{
  if (!hasMatrix(systemMatrixTag()))
    mooseError(" A system matrix is required");
1145  
1146  
1147  
1148 +
1149  
1150  
1151  
1152  
1153 +
1154  
1155  
1156 +
1157  
1158  
1159  
      {
        _fe_problem.reinitNodes(primary_node_ids, tid);
        _fe_problem.reinitNodesNeighbor(secondary_node_ids, tid);
        nc->computeJacobian(jacobian_to_view);
      }
    }
    _fe_problem.addCachedJacobian(tid);

    return true;
  }
  else
    return false;
}

void
3056  
3057  
3058  
3059 +
3060  
3061  
3062 +
3063  
3064 +
3065 +
3066  
3067  
3068 +
3069  
3070  
3071  
3072 +
3073 +
3074 +
3075  
3076 +
3077  
3078  
3079 +
3080 +
3081  
3082 +
3083  
3084  
3085 +
3086  
3087  
3088  
3089 +
3090  
3091  
3092  
      auto & system_matrix = getMatrix(systemMatrixTag());
      std::unique_ptr<SparseMatrix<Number>> hash_copy;
      const SparseMatrix<Number> * view_jac_ptr;
      auto make_readable_jacobian = [&]()
      {
#if PETSC_RELEASE_GREATER_EQUALS(3, 23, 0)
        if (system_matrix.use_hash_table())
        {
          hash_copy = libMesh::cast_ref<PetscMatrix<Number> &>(system_matrix).copy_from_hash();
          view_jac_ptr = hash_copy.get();
        }
        else
          view_jac_ptr = &system_matrix;
#else
        view_jac_ptr = &system_matrix;
#endif
        if (view_jac_ptr == &system_matrix)
          system_matrix.close();
      };

      make_readable_jacobian();

      // Nodal Constraints
      const bool had_nodal_constraints = enforceNodalConstraintsJacobian(*view_jac_ptr);
      if (had_nodal_constraints)
        // We have to make a new readable Jacobian
        make_readable_jacobian();

      // Undisplaced Constraints
      constraintJacobians(*view_jac_ptr, false);

      // Displaced Constraints
      if (_fe_problem.getDisplacedProblem())
        constraintJacobians(*view_jac_ptr, true);
    }
  }
  PARALLEL_CATCH;