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