interpolate_from_integral_points.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 // Augments an element to be able to interpolate from integral points to the nodes
6 // This is useful when we only know data at the integral points but for whatever reason
7 // need to be able to calculate it at the nodes.
8 // E.g. if data can only be taken from an external element which can only be done at the integral points
9 // but we want to be able to interpolate it to some point in this element.
10 // OR if the data can only be found at the integral points by taking from an external element
11 // but we want to use the data for providing a z2 error measure
12 
13 #ifndef INTERPOLATE_FROM_INTEGRAL_POINTS_HEADER
14 #define INTERPOLATE_FROM_INTEGRAL_POINTS_HEADER
15 
16 // Config header generated by autoconfig
17 #ifdef HAVE_CONFIG_H
18 #include <oomph-lib-config.h>
19 #endif
20 
21 #include "../../../oomph-lib/src/generic/elements.h"
22 #include "../../../oomph-lib/src/generic/shape.h"
23 #include "../../../oomph-lib/src/generic/linear_solver.h"
24 #include "../../../oomph-lib/src/generic/stored_shape_function_elements.h"
25 namespace oomph
26 {
27 
29 {
30 public:
34  {}
35 
37  {
39  }
40 
41  // Const access to pointer to the inverse mapping data
42  inline DenseMatrix<double>* const& inverse_mapping_pt() const
43  {
44  return Inverse_mapping_pt;
45  }
46 
47  // Set the integration scheme, set the scheme according to the base element then compute the integral point to node mapping
49  {
50  // Call the base class to handle assigning integration scheme
52 
53  // Compute the inverse mapping of the matrix
55  }
56 
57  // We need a OomphCommunicator in order to create a linear solver to invert the mapping
58  // from the nodes to the integral points
59  void set_communicator_pt(OomphCommunicator* communicator_pt)
60  {
61  Communicator_pt = communicator_pt;
62  }
63 
64  // Fill in the matrix mapping from the integral points to the nodes of the element
66 
67  // Set the matrix mapping from the integral points to the nodes of the element from that stored in another element
69 
70  // Return the weight stored for mapping from the ipt-th integral point to the n-th node.
71  inline double integral_point_to_node_weight(const unsigned& ipt, const unsigned& n)
72  {
73  return (*Inverse_mapping_pt)(n, ipt);
74  }
75 
76 private:
77  // Delete the matrix mapping from the integral points to the nodes of the element
79 
80  // Pointer to the communicator
82 
83  // Pointer to the inverse mapping - the mapping from the integral points to the nodes
84  // DenseDoubleMatrix to inherit solving functionality from DoubleMatrix class
86 
87  // If the element can delete the Inverse_mapping_pt data
89 };
90 
91 template<class ELEMENT>
92 class InterpolateFromIntegralPointsFaceElement : public virtual ELEMENT,
94 {
95 public:
97  const int& face_index,
98  const bool& called_from_refineable_constructor = false)
100  ELEMENT(element_pt, face_index, called_from_refineable_constructor)
101  {}
102 
104 };
105 
106 } // End namespace
107 #endif
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Definition: elements.h:1313
Integral *const & integral_pt() const
Return the pointer to the integration scheme (const version)
Definition: elements.h:1963
virtual void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
Definition: elements.cc:3210
Definition: integral.h:49
Definition: interpolate_from_integral_points.h:29
void set_compute_ipt_to_node_mapping_from_element(InterpolateFromIntegralPointsBase *const &element_pt)
Definition: interpolate_from_integral_points.cc:97
DenseMatrix< double > *const & inverse_mapping_pt() const
Definition: interpolate_from_integral_points.h:42
void set_integration_scheme(Integral *const &integral_pt)
Set the spatial integration scheme.
Definition: interpolate_from_integral_points.h:48
OomphCommunicator * Communicator_pt
Definition: interpolate_from_integral_points.h:81
InterpolateFromIntegralPointsBase()
Definition: interpolate_from_integral_points.h:31
~InterpolateFromIntegralPointsBase()
Definition: interpolate_from_integral_points.h:36
bool Can_delete_inverse_mapping_stored
Definition: interpolate_from_integral_points.h:88
double integral_point_to_node_weight(const unsigned &ipt, const unsigned &n)
Definition: interpolate_from_integral_points.h:71
void pre_compute_ipt_to_node_mapping()
Definition: interpolate_from_integral_points.cc:9
void delete_all_ipt_to_node_mapping()
Definition: interpolate_from_integral_points.cc:110
void set_communicator_pt(OomphCommunicator *communicator_pt)
Definition: interpolate_from_integral_points.h:59
DenseMatrix< double > * Inverse_mapping_pt
Definition: interpolate_from_integral_points.h:85
Definition: interpolate_from_integral_points.h:94
~InterpolateFromIntegralPointsFaceElement()
Definition: interpolate_from_integral_points.h:103
InterpolateFromIntegralPointsFaceElement(FiniteElement *const &element_pt, const int &face_index, const bool &called_from_refineable_constructor=false)
Definition: interpolate_from_integral_points.h:96
Definition: communicator.h:54
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
Definition: AnisotropicHookean.h:10