https://mooseframework.inl.gov
ComputeJacobianForScalingThread.C
Go to the documentation of this file.
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 
11 #include "MooseError.h"
12 #include "NonlinearSystemBase.h"
13 
14 #include "libmesh/elem.h"
15 
16 // C++
17 #include <cstring> // for "Jacobian" exception test
18 
19 using namespace libMesh;
20 
22  const std::set<TagID> & tags)
23  : ComputeFullJacobianThread(fe_problem, tags)
24 {
25 }
26 
27 // Splitting Constructor
31 {
32 }
33 
34 void
36  bool bypass_threading /*= false*/)
37 {
38  try
39  {
40  try
41  {
42  ParallelUniqueId puid;
43  _tid = bypass_threading ? 0 : puid.id;
44 
45  pre();
46 
49  typename ConstElemRange::const_iterator el = range.begin();
50  for (el = range.begin(); el != range.end(); ++el)
51  {
52  if (!keepGoing())
53  break;
54 
55  const Elem * elem = *el;
56 
57  preElement(elem);
58 
60  _subdomain = elem->subdomain_id();
63 
64  onElement(elem);
65 
66  postElement(elem);
67  } // range
68 
69  post();
70  }
71  catch (MetaPhysicL::LogicError & e)
72  {
74  }
75  catch (std::exception & e)
76  {
77  // Continue if we find a libMesh degenerate map exception, but
78  // just re-throw for any real error
79  if (!strstr(e.what(), "Jacobian") && !strstr(e.what(), "singular") &&
80  !strstr(e.what(), "det != 0"))
81  throw;
82 
83  mooseException(
84  "We caught a libMesh degeneracy exception in ComputeJacobianForScalingThread:\n",
85  e.what());
86  }
87  }
88  catch (MooseException & e)
89  {
91  }
92 }
93 
94 void
96 {
99  else
101 }
virtual void postElement(const Elem *) override
Called after the element assembly is done (including surface assembling)
ComputeJacobianForScalingThread(FEProblemBase &fe_problem, const std::set< TagID > &tags)
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition: MooseError.C:141
virtual void pre()
Called before the element range loop.
virtual void preElement(const Elem *elem) override
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.C:20
virtual void computeOnElement()
NonlinearSystemBase & _nl
bool offDiagonalsInAutoScaling() const
const_iterator end() const
tbb::split split
Provides a way for users to bail out of the current solve.
subdomain_id_type subdomain_id() const
vec_type::const_iterator const_iterator
const_iterator begin() const
virtual void caughtMooseException(MooseException &e) override
SubdomainID _subdomain
The subdomain for the current element.
void operator()(const libMesh::ConstElemRange &range, bool bypass_threading=false) final
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
SubdomainID _old_subdomain
The subdomain for the last element.
virtual void computeOnElement() override
virtual void post() override
Called after the element range loop.
SubdomainID _neighbor_subdomain
The subdomain for the current neighbor.
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.