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 602 : ComputeJacobianForScalingThread::ComputeJacobianForScalingThread(FEProblemBase & fe_problem, 19 602 : const std::set<TagID> & tags) 20 602 : : ComputeFullJacobianThread(fe_problem, tags) 21 : { 22 602 : } 23 : 24 : // Splitting Constructor 25 59 : ComputeJacobianForScalingThread::ComputeJacobianForScalingThread( 26 59 : ComputeJacobianForScalingThread & x, Threads::split split) 27 59 : : ComputeFullJacobianThread(x, split) 28 : { 29 59 : } 30 : 31 : void 32 661 : ComputeJacobianForScalingThread::operator()(const ConstElemRange & range, 33 : bool bypass_threading /*= false*/) 34 : { 35 : try 36 : { 37 : try 38 : { 39 661 : ParallelUniqueId puid; 40 661 : _tid = bypass_threading ? 0 : puid.id; 41 : 42 661 : pre(); 43 : 44 661 : _subdomain = Moose::INVALID_BLOCK_ID; 45 661 : _neighbor_subdomain = Moose::INVALID_BLOCK_ID; 46 661 : typename ConstElemRange::const_iterator el = range.begin(); 47 81554 : for (el = range.begin(); el != range.end(); ++el) 48 : { 49 80893 : if (!keepGoing()) 50 0 : break; 51 : 52 80893 : const Elem * elem = *el; 53 : 54 80893 : preElement(elem); 55 : 56 80893 : _old_subdomain = _subdomain; 57 80893 : _subdomain = elem->subdomain_id(); 58 80893 : if (_subdomain != _old_subdomain) 59 673 : subdomainChanged(); 60 : 61 80893 : onElement(elem); 62 : 63 80893 : postElement(elem); 64 : } // range 65 : 66 661 : post(); 67 661 : } 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 661 : } 82 : 83 : void 84 80893 : ComputeJacobianForScalingThread::computeOnElement() 85 : { 86 80893 : if (_nl.offDiagonalsInAutoScaling()) 87 964 : ComputeFullJacobianThread::computeOnElement(); 88 : else 89 79929 : ComputeJacobianThread::computeOnElement(); 90 80893 : }