galerkin_petrov_equal_order/space_time_unsteady_heat_block_preconditionable_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-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 // Non-inline functions for BlockPrecSpaceTimeUnsteadyHeat elements
27 #include "space_time_unsteady_heat_block_preconditionable_elements.h"
28 
29 /// /////////////////////////////////////////////////////////////////////////
30 /// /////////////////////////////////////////////////////////////////////////
31 /// /////////////////////////////////////////////////////////////////////////
32 
33 namespace oomph
34 {
35  //=====start_of_setup=========================================================
36  /// The setup function...
37  //============================================================================
38  template<unsigned SPATIAL_DIM, unsigned NNODE_1D>
41  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
42  {
43  // Number of nodes
44  unsigned n_node = this->nnode();
45 
46  // Temporary pair (used to store dof lookup prior to being added to list)
47  std::pair<unsigned, unsigned> dof_lookup;
48 
49  // Loop over the nodes but ignore the nodes on the first local time-slice
50  // because their dof number will either be set by elements from the
51  // previous space-time slab (including on time-periodic meshes) or they'll
52  // be pinned through an initial condition.
53  for (unsigned i = NNODE_1D * NNODE_1D; i < n_node; i++)
54  {
55  // Find the index at which the variable is stored
56  unsigned u_nodal_index = this->u_index_ust_heat();
57 
58  // Determine local eqn number
59  int local_eqn_number = this->nodal_local_eqn(i, u_nodal_index);
60 
61  // Ignore pinned values - far away degrees of freedom resulting
62  // from hanging nodes can be ignored since these are be dealt
63  // with by the element containing their master nodes
64  if (local_eqn_number >= 0)
65  {
66  // Store dof lookup in temporary pair: Global equation number
67  // is the first entry in pair
68  dof_lookup.first = this->eqn_number(local_eqn_number);
69 
70  // Set dof numbers: dof number is the second entry in pair
71  dof_lookup.second = (this->Time_slab_id);
72 
73  // Add to list
74  dof_lookup_list.push_front(dof_lookup);
75  } // if (local_eqn_number>=0)
76  } // for (unsigned i=NNODE_1D*NNODE_1D; i<n_node; i++)
77  } // End of get_dof_numbers_for_unknowns
78 
79 
80  //=====start_of_setup=========================================================
81  /// The setup function...
82  //============================================================================
83  template<unsigned SPATIAL_DIM, unsigned NNODE_1D>
86  std::list<std::pair<unsigned long, unsigned>>& dof_lookup_list) const
87  {
88  // Number of nodes
89  unsigned n_node = this->nnode();
90 
91  // Temporary pair (used to store dof lookup prior to being added to list)
92  std::pair<unsigned, unsigned> dof_lookup;
93 
94  // Loop over the nodes but ignore the nodes on the first local time-slice
95  // because their dof number will either be set by elements from the
96  // previous space-time slab (including on time-periodic meshes) or they'll
97  // be pinned through an initial condition.
98  for (unsigned i = NNODE_1D * NNODE_1D; i < n_node; i++)
99  {
100  // Find the index at which the variable is stored
101  unsigned u_nodal_index = this->u_index_ust_heat();
102 
103  // Determine local eqn number
104  int local_eqn_number = this->nodal_local_eqn(i, u_nodal_index);
105 
106  // Ignore pinned values - far away degrees of freedom resulting
107  // from hanging nodes can be ignored since these are be dealt
108  // with by the element containing their master nodes
109  if (local_eqn_number >= 0)
110  {
111  // Store dof lookup in temporary pair: Global equation number
112  // is the first entry in pair
113  dof_lookup.first = this->eqn_number(local_eqn_number);
114 
115  // Set dof numbers: dof number is the second entry in pair
116  dof_lookup.second = (this->Time_slab_id);
117 
118  // Add to list
119  dof_lookup_list.push_front(dof_lookup);
120  } // if (local_eqn_number>=0)
121  } // for (unsigned i=NNODE_1D*NNODE_1D; i<n_node; i++)
122  } // End of get_dof_numbers_for_unknowns
123 
124 
125  //====================================================================
126  // Force build of templates
127  //====================================================================
128  template class BlockPrecQUnsteadyHeatSpaceTimeElement<2, 2>;
129  template class BlockPrecQUnsteadyHeatSpaceTimeElement<2, 3>;
130  template class BlockPrecQUnsteadyHeatSpaceTimeElement<2, 4>;
131  template class BlockPrecRefineableQUnsteadyHeatSpaceTimeElement<2, 2>;
132  template class BlockPrecRefineableQUnsteadyHeatSpaceTimeElement<2, 3>;
133  template class BlockPrecRefineableQUnsteadyHeatSpaceTimeElement<2, 4>;
134 } // End of namespace oomph
cstr elem_len * i
Definition: cfortran.h:603
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Overload the pure virtual base class implementation. Create a list of pairs for all unknowns in this ...
void get_dof_numbers_for_unknowns(std::list< std::pair< unsigned long, unsigned >> &dof_lookup_list) const
Overload the pure virtual base class implementation. Create a list of pairs for all unknowns in this ...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...