general_purpose_space_time_block_preconditionable_elements.h
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-2023 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 // Header file for SpaceTimeUnsteadyHeat elements
27 #ifndef OOMPH_GENERAL_PURPOSE_SPACETIME_BLOCK_PRECONDITIONABLE_ELEMENTS_HEADER
28 #define OOMPH_GENERAL_PURPOSE_SPACETIME_BLOCK_PRECONDITIONABLE_ELEMENTS_HEADER
29 
30 // Config header generated by autoconfig
31 #ifdef HAVE_CONFIG_H
32 #include <oomph-lib-config.h>
33 #endif
34 
35 // Oomph-lib headers
36 #include "generic/elements.h"
37 
38 /// /////////////////////////////////////////////////////////////////////////
39 /// /////////////////////////////////////////////////////////////////////////
40 /// /////////////////////////////////////////////////////////////////////////
41 
42 namespace oomph
43 {
44  //======start_of_BlockPreconditionableSpaceTimeElement=========================
45  /// Block preconditionable space-time element base class.
46  /// NOTE: It has to derive from GeneralisedElement so that it can overload
47  /// the implementation of ndof_types() in GeneralisedElement.
48  //=============================================================================
50  : public virtual GeneralisedElement
51  {
52  public:
53  /// Constructor (empty)
55 
56  /// Destructor (empty)
58 
59  /// Access function to assign the time slice this element lies in
60  void set_time_slab_id(const int& time_slice_id)
61  {
62  // The time slice must be greater than -1. This happens when we use
63  // an impulsive start so there are no dofs in the first time slice
64  // of the first elemental time slice of the first but there are proper
65  // dofs in the final time slice of the first elemental time slice.
66  if (time_slice_id < -1)
67  {
68  // Throw an error
69  throw OomphLibError(
70  "Time slice ID must be greater than or equal to -1!",
71  OOMPH_CURRENT_FUNCTION,
72  OOMPH_EXCEPTION_LOCATION);
73  }
74 
75  // Return the value that is currently stored
76  Time_slab_id = time_slice_id;
77  } // End of set_time_slab_id
78 
79 
80  /// Access function to assign the number of dof types in the mesh
81  /// NOTE: We have an access function for this as N_dof_types relies
82  /// on the number of time slices in the mesh which isn't something one
83  /// individual element should know...
84  void set_ndof_types(const unsigned& n_dof_types)
85  {
86  // Return the value that is currently stored
87  N_dof_types = n_dof_types;
88  } // End of set_ndof_types
89 
90 
91  /// Return the number of "DOF types" that the degrees of freedom in
92  /// this element are sub-divided into
93  unsigned ndof_types() const
94  {
95  // Return the number of dof types being used in the mesh
96  return this->N_dof_types;
97  } // End of ndof_types
98 
99 
100  /// Pure virtual function to be implemented in a derived class.
101  /// Create a list of pairs for all unknowns in this element,
102  /// so the first entry in each pair contains the global equation
103  /// number of the unknown, while the second one contains the number
104  /// of the "DOF type" that this unknown is associated with.
106  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const = 0;
107 
108  protected:
109  /// The number of time slices in the mesh
110  unsigned N_dof_types;
111 
112  /// The time slice this element lies within
114  };
115 } // End of namespace oomph
116 #endif
Block preconditionable space-time element base class. NOTE: It has to derive from GeneralisedElement ...
void set_ndof_types(const unsigned &n_dof_types)
Access function to assign the number of dof types in the mesh NOTE: We have an access function for th...
unsigned ndof_types() const
Return the number of "DOF types" that the degrees of freedom in this element are sub-divided into.
virtual void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const =0
Pure virtual function to be implemented in a derived class. Create a list of pairs for all unknowns i...
void set_time_slab_id(const int &time_slice_id)
Access function to assign the time slice this element lies in.
A Generalised Element class.
Definition: elements.h:73
An OomphLibError object which should be thrown when an run-time error is encountered....
//////////////////////////////////////////////////////////////////// ////////////////////////////////...