Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
segment_Hcurl.inl
Go to the documentation of this file.
1 // Copyright (c) Lawrence Livermore National Security, LLC and
2 // other Smith Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 
13 // specialization of finite_element for Hcurl on segment geometry
14 //
15 // this specialization defines shape functions (and their gradients) that
16 // interpolate at Gauss-Lobatto nodes for the appropriate polynomial order
17 //
18 // note: mfem assumes the parent element domain is [0,1]
19 // for additional information on the finite_element concept requirements, see finite_element.hpp
21 template <int p, int c>
22 struct finite_element<mfem::Geometry::SEGMENT, Hcurl<p, c> > {
23  static constexpr auto geometry = mfem::Geometry::SEGMENT;
24  static constexpr auto family = Family::HCURL;
25  static constexpr int components = c;
26  static constexpr int dim = 1;
27  static constexpr int ndof = (p + 1);
28 
29  using dof_type = tensor<double, c, ndof>;
30  using dof_type_if = dof_type;
31 
32  SMITH_HOST_DEVICE static constexpr tensor<double, ndof> shape_functions(double xi)
33  {
34  return GaussLegendreInterpolation<ndof>(xi);
35  }
36 
37  SMITH_HOST_DEVICE static constexpr tensor<double, ndof> shape_function_gradients(double xi)
38  {
39  return GaussLegendreInterpolationDerivative<ndof>(xi);
40  }
41 };
#define SMITH_HOST_DEVICE
Macro that evaluates to __host__ __device__ when compiling with nvcc and does nothing on a host compi...
Definition: accelerator.hpp:38