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
Get it
Installation guide
Get code from subversion repository
Get code as tar file
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// Version 1.0; svn revision $LastChangedRevision$
7
//LIC//
8
//LIC// $LastChangedDate$
9
//LIC//
10
//LIC// Copyright (C) 2006-2016 Matthias Heil and Andrew Hazel
11
//LIC//
12
//LIC// This library is free software; you can redistribute it and/or
13
//LIC// modify it under the terms of the GNU Lesser General Public
14
//LIC// License as published by the Free Software Foundation; either
15
//LIC// version 2.1 of the License, or (at your option) any later version.
16
//LIC//
17
//LIC// This library is distributed in the hope that it will be useful,
18
//LIC// but WITHOUT ANY WARRANTY; without even the implied warranty of
19
//LIC// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
//LIC// Lesser General Public License for more details.
21
//LIC//
22
//LIC// You should have received a copy of the GNU Lesser General Public
23
//LIC// License along with this library; if not, write to the Free Software
24
//LIC// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
//LIC// 02110-1301 USA.
26
//LIC//
27
//LIC// The authors may be contacted at oomph-lib@maths.man.ac.uk.
28
//LIC//
29
//LIC//====================================================================
30
//Non inline functions for Hijacked elements
31
#include "
hijacked_elements.h
"
32
33
namespace
oomph
34
{
35
36
//======================================================================
37
/// Static default value of the multiplier for the original residuals
38
/// The contribution to the total residuals is the product of the
39
/// multiplier and the original value of the residuals
40
//======================================================================
41
double
HijackedElementBase::Default_residual_multiplier
=0.0;
42
43
//====================================================================
44
/// Destructor that cleans up any memory allocated by the class
45
//===================================================================
46
HijackedElementBase::~HijackedElementBase
()
47
{
48
//If the hijacked equation number storage has been alloacted
49
//clear it
50
if
(
Hijacked_global_eqn_number_pt
!=0)
51
{
delete
Hijacked_global_eqn_number_pt
;}
52
53
//If the hijacked equation number storage has been alloacted
54
//clear it
55
if
(
Hijacked_local_eqn_number_pt
!=0)
56
{
delete
Hijacked_local_eqn_number_pt
;}
57
}
58
59
//======================================================================
60
/// Mark the global equation, addressed by global_eqn_pt,
61
/// as hijacked by this element.
62
//======================================================================
63
void
HijackedElementBase::hijack_global_eqn
(
long
*
const
&global_eqn_pt)
64
{
65
//If the storage has not been allocated, allocate it
66
if
(
Hijacked_global_eqn_number_pt
==0)
67
{
68
Hijacked_global_eqn_number_pt
=
new
std::set<long*>;
69
}
70
71
//Now insert the value, note that this prevents multiple inclusions,
72
//which is neater, but possibly inefficient.
73
Hijacked_global_eqn_number_pt
->insert(global_eqn_pt);
74
}
75
76
//=====================================================================
77
/// The global equation, addressed by global_eqn_pt,
78
/// is no longer hijacked by this element.
79
//====================================================================
80
void
HijackedElementBase::unhijack_global_eqn
(
long
*
const
&global_eqn_pt)
81
{
82
//Check that the storage has been allocated
83
if
(
Hijacked_global_eqn_number_pt
!=0)
84
{
85
Hijacked_global_eqn_number_pt
->erase(global_eqn_pt);
86
}
87
}
88
89
}
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:63
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:90
oomph
Definition:
advection_diffusion_elements.cc:33
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:100
oomph::HijackedElementBase::~HijackedElementBase
virtual ~HijackedElementBase()
Destructor, destroy the storage for the equation numbers.
Definition:
hijacked_elements.cc:46
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:80
oomph::HijackedElementBase::Hijacked_global_eqn_number_pt
std::set< long * > * Hijacked_global_eqn_number_pt
Definition:
hijacked_elements.h:85
hijacked_elements.h