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
19using namespace libMesh;
20
22 const std::set<TagID> & tags)
23 : ComputeFullJacobianThread(fe_problem, tags)
24{
25}
26
27// Splitting Constructor
33
34void
36 bool bypass_threading /*= false*/)
37{
38 try
39 {
40 try
41 {
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
94void
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
subdomain_id_type subdomain_id() const
const_iterator begin() const
const_iterator end() const
vec_type::const_iterator const_iterator
const SubdomainID INVALID_BLOCK_ID
Definition MooseTypes.C:20
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition MooseError.C:155