MFEM  v4.6.0
Finite element discretization library
stable3d.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2023, Lawrence Livermore National Security, LLC. Produced
2 // at the Lawrence Livermore National Laboratory. All Rights reserved. See files
3 // LICENSE and NOTICE for details. LLNL-CODE-806117.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability visit https://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the BSD-3 license. We welcome feedback and contributions, see file
10 // CONTRIBUTING.md for details.
11 
12 #ifndef MFEM_STABLE3D
13 #define MFEM_STABLE3D
14 
15 #include "mem_alloc.hpp"
16 #include "../general/globals.hpp"
17 
18 namespace mfem
19 {
20 
22 {
23 public:
26 };
27 
28 /** @brief Symmetric 3D Table stored as an array of rows each of which has a
29  stack of column, floor, number nodes. The number of the node is assigned by
30  counting the nodes from zero as they are pushed into the table. Diagonals of
31  any kind are not allowed so the row, column and floor must all be different
32  for each node. Only one node is stored for all 6 symmetric entries that are
33  indexable by unique triplets of row, column, and floor. */
34 class STable3D
35 {
36 private:
37  int Size, NElem;
38  STable3DNode **Rows;
39 
40 #ifdef MFEM_USE_MEMALLOC
42 #endif
43 
44 public:
45  /// Construct the table with a total of 'nr' rows.
46  explicit STable3D (int nr);
47 
48  /** @brief Check to see if this entry is in the table and add it to the table
49  if it is not there. Returns the number assigned to the table entry. */
50  int Push (int r, int c, int f);
51 
52  /// Return the number assigned to the table entry. Abort if it's not there.
53  int operator() (int r, int c, int f) const;
54 
55  /** Return the number assigned to the table entry. Return -1 if it's not
56  there. */
57  int Index (int r, int c, int f) const;
58 
59  /** @brief Check to see if this entry is in the table and add it to the table
60  if it is not there. The entry is addressed by the three smallest values
61  of (r,c,f,t). Returns the number assigned to the table entry. */
62  int Push4 (int r, int c, int f, int t);
63 
64  /** @brief Return the number assigned to the table entry. The entry is
65  addressed by the three smallest values of (r,c,f,t). Return -1 if it is
66  not there. */
67  int operator() (int r, int c, int f, int t) const;
68 
69  /// Return the number of elements added to the table.
70  int NumberOfElements() { return NElem; }
71 
72  /// Print out all of the table elements.
73  void Print(std::ostream &out = mfem::out) const;
74 
75  ~STable3D ();
76 };
77 
78 }
79 
80 #endif
int Push(int r, int c, int f)
Check to see if this entry is in the table and add it to the table if it is not there. Returns the number assigned to the table entry.
Definition: stable3d.cpp:64
std::function< double(const Vector &)> f(double mass_coeff)
Definition: lor_mms.hpp:30
Symmetric 3D Table stored as an array of rows each of which has a stack of column, floor, number nodes. The number of the node is assigned by counting the nodes from zero as they are pushed into the table. Diagonals of any kind are not allowed so the row, column and floor must all be different for each node. Only one node is stored for all 6 symmetric entries that are indexable by unique triplets of row, column, and floor.
Definition: stable3d.hpp:34
void Print(std::ostream &out=mfem::out) const
Print out all of the table elements.
Definition: stable3d.cpp:210
STable3D(int nr)
Construct the table with a total of &#39;nr&#39; rows.
Definition: stable3d.cpp:21
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
Definition: globals.hpp:66
int Push4(int r, int c, int f, int t)
Check to see if this entry is in the table and add it to the table if it is not there. The entry is addressed by the three smallest values of (r,c,f,t). Returns the number assigned to the table entry.
Definition: stable3d.cpp:140
int Index(int r, int c, int f) const
Definition: stable3d.cpp:117
STable3DNode * Prev
Definition: stable3d.hpp:24
int operator()(int r, int c, int f) const
Return the number assigned to the table entry. Abort if it&#39;s not there.
Definition: stable3d.cpp:97
RefCoord t[3]
int NumberOfElements()
Return the number of elements added to the table.
Definition: stable3d.hpp:70