LCOV - code coverage report
Current view: top level - src/loops - ComputeJacobianForScalingThread.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 33 43 76.7 %
Date: 2025-07-17 01:28:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "ComputeJacobianForScalingThread.h"
      11             : #include "MooseError.h"
      12             : #include "NonlinearSystemBase.h"
      13             : 
      14             : #include "libmesh/elem.h"
      15             : 
      16             : using namespace libMesh;
      17             : 
      18         594 : ComputeJacobianForScalingThread::ComputeJacobianForScalingThread(FEProblemBase & fe_problem,
      19         594 :                                                                  const std::set<TagID> & tags)
      20         594 :   : ComputeFullJacobianThread(fe_problem, tags)
      21             : {
      22         594 : }
      23             : 
      24             : // Splitting Constructor
      25          60 : ComputeJacobianForScalingThread::ComputeJacobianForScalingThread(
      26          60 :     ComputeJacobianForScalingThread & x, Threads::split split)
      27          60 :   : ComputeFullJacobianThread(x, split)
      28             : {
      29          60 : }
      30             : 
      31             : void
      32         654 : ComputeJacobianForScalingThread::operator()(const ConstElemRange & range,
      33             :                                             bool bypass_threading /*= false*/)
      34             : {
      35             :   try
      36             :   {
      37             :     try
      38             :     {
      39         654 :       ParallelUniqueId puid;
      40         654 :       _tid = bypass_threading ? 0 : puid.id;
      41             : 
      42         654 :       pre();
      43             : 
      44         654 :       _subdomain = Moose::INVALID_BLOCK_ID;
      45         654 :       _neighbor_subdomain = Moose::INVALID_BLOCK_ID;
      46         654 :       typename ConstElemRange::const_iterator el = range.begin();
      47       80994 :       for (el = range.begin(); el != range.end(); ++el)
      48             :       {
      49       80340 :         if (!keepGoing())
      50           0 :           break;
      51             : 
      52       80340 :         const Elem * elem = *el;
      53             : 
      54       80340 :         preElement(elem);
      55             : 
      56       80340 :         _old_subdomain = _subdomain;
      57       80340 :         _subdomain = elem->subdomain_id();
      58       80340 :         if (_subdomain != _old_subdomain)
      59         665 :           subdomainChanged();
      60             : 
      61       80340 :         onElement(elem);
      62             : 
      63       80340 :         postElement(elem);
      64             :       } // range
      65             : 
      66         654 :       post();
      67         654 :     }
      68           0 :     catch (libMesh::LogicError & e)
      69             :     {
      70           0 :       mooseException("We caught a libMesh error in ComputeJacobianForScalingThread: ", e.what());
      71           0 :     }
      72           0 :     catch (MetaPhysicL::LogicError & e)
      73             :     {
      74           0 :       moose::translateMetaPhysicLError(e);
      75           0 :     }
      76             :   }
      77           0 :   catch (MooseException & e)
      78             :   {
      79           0 :     caughtMooseException(e);
      80           0 :   }
      81         654 : }
      82             : 
      83             : void
      84       80340 : ComputeJacobianForScalingThread::computeOnElement()
      85             : {
      86       80340 :   if (_nl.offDiagonalsInAutoScaling())
      87         902 :     ComputeFullJacobianThread::computeOnElement();
      88             :   else
      89       79438 :     ComputeJacobianThread::computeOnElement();
      90       80340 : }

Generated by: LCOV version 1.14