https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
20 const std::set<TagID> & tags)
21 : ComputeFullJacobianThread(fe_problem, tags)
22{
23}
24
25// Splitting Constructor
31
32void
34 bool bypass_threading /*= false*/)
35{
36 try
37 {
38 try
39 {
41 _tid = bypass_threading ? 0 : puid.id;
42
43 pre();
44
47 typename ConstElemRange::const_iterator el = range.begin();
48 for (el = range.begin(); el != range.end(); ++el)
49 {
50 if (!keepGoing())
51 break;
52
53 const Elem * elem = *el;
54
55 preElement(elem);
56
58 _subdomain = elem->subdomain_id();
61
62 onElement(elem);
63
64 postElement(elem);
65 } // range
66
67 post();
68 }
69 catch (MetaPhysicL::LogicError & e)
70 {
72 }
73 catch (std::exception & e)
74 {
75 // Continue if we find a libMesh degenerate map exception, but
76 // just re-throw for any real error
77 if (!strstr(e.what(), "Jacobian") && !strstr(e.what(), "singular") &&
78 !strstr(e.what(), "det != 0"))
79 throw;
80
81 mooseException(
82 "We caught a libMesh degeneracy exception in ComputeJacobianForScalingThread:\n",
83 e.what());
84 }
85 }
86 catch (MooseException & e)
87 {
89 }
90}
91
92void
virtual void computeOnElement() override
void operator()(const libMesh::ConstElemRange &range, bool bypass_threading=false) final
ComputeJacobianForScalingThread(FEProblemBase &fe_problem, const std::set< TagID > &tags)
virtual void postElement(const Elem *) override
Called after the element assembly is done (including surface assembling)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Provides a way for users to bail out of the current solve.
bool offDiagonalsInAutoScaling() const
virtual void post() override
Called after the element range loop.
virtual void computeOnElement()
NonlinearSystemBase & _nl
Reference to the underlying NonlinearSystemBase.
virtual void subdomainChanged() override
Called every time the current subdomain changes (i.e.
virtual void onElement(const Elem *elem) override
Assembly of the element (not including surface assembly)
SubdomainID _old_subdomain
The subdomain for the last element.
SubdomainID _subdomain
The subdomain for the current element.
SubdomainID _neighbor_subdomain
The subdomain for the current neighbor.
virtual void pre()
Called before the element range loop.
virtual void caughtMooseException(MooseException &e) override
virtual void preElement(const Elem *elem) override
const SubdomainID INVALID_BLOCK_ID
Definition MooseTypes.C:20
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition MooseError.C:153