MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
cut.hpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2022, 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_TRANSFER_CUT_HPP
13 #define MFEM_TRANSFER_CUT_HPP
14 
15 #include "../fem.hpp"
16 #include <memory>
17 
18 namespace mfem
19 {
20 
21 /*!
22  * @brief All subclasses of Cut will implement intersection routines and
23  * quadrature point generation within the cut in the intersection of two
24  * elements. Although, this class is designed to support MortarAssembler and
25  * ParMortarAssembler, it can be used for any problem requiring to perform
26  * Petrov-Galerkin formulations on non-matching elements.
27  */
28 class Cut
29 {
30 public:
31  virtual ~Cut() = default;
32 
33  /*!
34  * @brief This method creates/updates the quadrature on the reference element
35  * based on the integration order
36  * @param order the order of the quadrature rule
37  */
38  virtual void SetIntegrationOrder(const int order) = 0;
39 
40  /*!
41  * @brief This computes the intersection of the finite element geometries and
42  * generates quadratures formulas for the two reference configurations
43  * @param from_space the space from which we want to transfer a function with
44  * MortarAssembler and ParMortarAssembler
45  * @param from_elem_idx the index of the element of the from_space
46  * @param to_space the space to which we want to transfer a function with
47  * MortarAssembler and ParMortarAssembler
48  * @param to_elem_idx the index of the element of the to_space
49  * @param[out] from_quadrature the quadrature rule in the reference coordinate
50  * system of the from element
51  * @param[out] to_quadrature the quadrature rule in the reference coordinate
52  * system of the to element
53  * @return true if the two element intersected and if the output must be used
54  * or ignored.
55  */
56  virtual bool BuildQuadrature(const FiniteElementSpace &from_space,
57  const int from_elem_idx,
58  const FiniteElementSpace &to_space,
59  const int to_elem_idx,
60  IntegrationRule &from_quadrature,
61  IntegrationRule &to_quadrature) = 0;
62 
63  /*!
64  * @brief Method for printing information to the command line
65  */
66  virtual void Describe() const {}
67 
68 protected:
69  virtual void SetQuadratureRule(const IntegrationRule &ir) = 0;
70 };
71 
72 /// Create a new cut object based on the spatial dimension
73 /// @param dim the spatial dimension
74 std::shared_ptr<Cut> NewCut(const int dim);
75 
76 } // namespace mfem
77 
78 #endif // MFEM_TRANSFER_CUT_HPP
Class for an integration rule - an Array of IntegrationPoint.
Definition: intrules.hpp:90
virtual ~Cut()=default
virtual void Describe() const
Method for printing information to the command line.
Definition: cut.hpp:66
virtual void SetIntegrationOrder(const int order)=0
This method creates/updates the quadrature on the reference element based on the integration order...
All subclasses of Cut will implement intersection routines and quadrature point generation within the...
Definition: cut.hpp:28
virtual void SetQuadratureRule(const IntegrationRule &ir)=0
virtual bool BuildQuadrature(const FiniteElementSpace &from_space, const int from_elem_idx, const FiniteElementSpace &to_space, const int to_elem_idx, IntegrationRule &from_quadrature, IntegrationRule &to_quadrature)=0
This computes the intersection of the finite element geometries and generates quadratures formulas fo...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Definition: fespace.hpp:96
std::shared_ptr< Cut > NewCut(const int dim)
Definition: cut.cpp:436
int dim
Definition: ex24.cpp:53