Toggle navigation
Documentation
Big picture
The finite element method
The data structure
Not-so-quick guide
Optimisation
Order of action functions
Example codes and tutorials
List of example codes and tutorials
Meshing
Solvers
MPI parallel processing
Post-processing/visualisation
Other
Change log
Creating documentation
Coding conventions
Index
FAQ
Installation
Installation guide
Copyright
About
People
Contact/Get involved
Publications
Acknowledgements
Picture show
Go
src
generic
hijacked_elements.cc
Go to the documentation of this file.
1
// LIC// ====================================================================
2
// LIC// This file forms part of oomph-lib, the object-oriented,
3
// LIC// multi-physics finite-element library, available
4
// LIC// at http://www.oomph-lib.org.
5
// LIC//
6
// LIC// Copyright (C) 2006-2024 Matthias Heil and Andrew Hazel
7
// LIC//
8
// LIC// This library is free software; you can redistribute it and/or
9
// LIC// modify it under the terms of the GNU Lesser General Public
10
// LIC// License as published by the Free Software Foundation; either
11
// LIC// version 2.1 of the License, or (at your option) any later version.
12
// LIC//
13
// LIC// This library is distributed in the hope that it will be useful,
14
// LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
// LIC// Lesser General Public License for more details.
17
// LIC//
18
// LIC// You should have received a copy of the GNU Lesser General Public
19
// LIC// License along with this library; if not, write to the Free Software
20
// LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
// LIC// 02110-1301 USA.
22
// LIC//
23
// LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
24
// LIC//
25
// LIC//====================================================================
26
// Non inline functions for Hijacked elements
27
#include "
hijacked_elements.h
"
28
29
namespace
oomph
30
{
31
//======================================================================
32
/// Static default value of the multiplier for the original residuals
33
/// The contribution to the total residuals is the product of the
34
/// multiplier and the original value of the residuals
35
//======================================================================
36
double
HijackedElementBase::Default_residual_multiplier
= 0.0;
37
38
//====================================================================
39
/// Destructor that cleans up any memory allocated by the class
40
//===================================================================
41
HijackedElementBase::~HijackedElementBase
()
42
{
43
// If the hijacked equation number storage has been alloacted
44
// clear it
45
if
(
Hijacked_global_eqn_number_pt
!= 0)
46
{
47
delete
Hijacked_global_eqn_number_pt
;
48
}
49
50
// If the hijacked equation number storage has been alloacted
51
// clear it
52
if
(
Hijacked_local_eqn_number_pt
!= 0)
53
{
54
delete
Hijacked_local_eqn_number_pt
;
55
}
56
}
57
58
//======================================================================
59
/// Mark the global equation, addressed by global_eqn_pt,
60
/// as hijacked by this element.
61
//======================================================================
62
void
HijackedElementBase::hijack_global_eqn
(
long
*
const
& global_eqn_pt)
63
{
64
// If the storage has not been allocated, allocate it
65
if
(
Hijacked_global_eqn_number_pt
== 0)
66
{
67
Hijacked_global_eqn_number_pt
=
new
std::set<long*>;
68
}
69
70
// Now insert the value, note that this prevents multiple inclusions,
71
// which is neater, but possibly inefficient.
72
Hijacked_global_eqn_number_pt
->insert(global_eqn_pt);
73
}
74
75
//=====================================================================
76
/// The global equation, addressed by global_eqn_pt,
77
/// is no longer hijacked by this element.
78
//====================================================================
79
void
HijackedElementBase::unhijack_global_eqn
(
long
*
const
& global_eqn_pt)
80
{
81
// Check that the storage has been allocated
82
if
(
Hijacked_global_eqn_number_pt
!= 0)
83
{
84
Hijacked_global_eqn_number_pt
->erase(global_eqn_pt);
85
}
86
}
87
88
}
// namespace oomph
oomph::HijackedElementBase::Hijacked_global_eqn_number_pt
std::set< long * > * Hijacked_global_eqn_number_pt
Pointer to a Set of pointers to the equation numbers that will be hijacked by this element....
Definition:
hijacked_elements.h:86
oomph::HijackedElementBase::unhijack_global_eqn
void unhijack_global_eqn(long *const &global_eqn_pt)
The global equation, addressed by global_eqn_pt, is no longer hijacked by this element.
Definition:
hijacked_elements.cc:79
oomph::HijackedElementBase::hijack_global_eqn
void hijack_global_eqn(long *const &global_eqn_pt)
Mark the global equation, addressed by global_eqn_pt, as hijacked by this element.
Definition:
hijacked_elements.cc:62
oomph::HijackedElementBase::Hijacked_local_eqn_number_pt
Vector< int > * Hijacked_local_eqn_number_pt
Pointer to a vector of integers containing the local equation numbers of any hijacked variables in th...
Definition:
hijacked_elements.h:91
oomph::HijackedElementBase::~HijackedElementBase
virtual ~HijackedElementBase()
Destructor, destroy the storage for the equation numbers.
Definition:
hijacked_elements.cc:41
oomph::HijackedElementBase::Default_residual_multiplier
static double Default_residual_multiplier
Static default value for the double that multiplies the original residuals.
Definition:
hijacked_elements.h:102
hijacked_elements.h
oomph
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
Definition:
advection_diffusion_elements.cc:30