-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1632 from CEED/jrwrigh/fix_basis_project
fix(basis): Use basis_from dim for projection matrices
- Loading branch information
Showing
3 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Copyright (c) 2017-2024, Lawrence Livermore National Security, LLC and other CEED contributors. | ||
// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// | ||
// This file is part of CEED: http://github.com/ceed | ||
|
||
#include <ceed.h> | ||
|
||
// Interpolation matrices for cell-to-face of Q1 hexahedral element onto it's "5" face (in PETSc) | ||
// Nodes are at Gauss-Lobatto points and quadrature points are Gauss, all over [-1,1] domain range | ||
const CeedScalar Q1_interp_gauss[4][8] = { | ||
{0.62200846792814612, 0, 0.16666666666666669, 0, 0.16666666666666669, 0, 0.044658198738520463, 0}, | ||
{0.16666666666666669, 0, 0.62200846792814612, 0, 0.044658198738520463, 0, 0.16666666666666669, 0}, | ||
{0.16666666666666669, 0, 0.044658198738520463, 0, 0.62200846792814612, 0, 0.16666666666666669, 0}, | ||
{0.044658198738520463, 0, 0.16666666666666669, 0, 0.16666666666666669, 0, 0.62200846792814612, 0} | ||
}; | ||
const CeedScalar Q1_grad_gauss[3][4][8] = { | ||
{{-0.31100423396407312, 0.31100423396407312, -0.083333333333333343, 0.083333333333333343, -0.083333333333333343, 0.083333333333333343, | ||
-0.022329099369260232, 0.022329099369260232}, | ||
{-0.083333333333333343, 0.083333333333333343, -0.31100423396407312, 0.31100423396407312, -0.022329099369260232, 0.022329099369260232, | ||
-0.083333333333333343, 0.083333333333333343}, | ||
{-0.083333333333333343, 0.083333333333333343, -0.022329099369260232, 0.022329099369260232, -0.31100423396407312, 0.31100423396407312, | ||
-0.083333333333333343, 0.083333333333333343}, | ||
{-0.022329099369260232, 0.022329099369260232, -0.083333333333333343, 0.083333333333333343, -0.083333333333333343, 0.083333333333333343, | ||
-0.31100423396407312, 0.31100423396407312} }, | ||
{{-0.39433756729740643, 0, 0.39433756729740643, 0, -0.10566243270259357, 0, 0.10566243270259357, 0}, | ||
{-0.39433756729740643, 0, 0.39433756729740643, 0, -0.10566243270259357, 0, 0.10566243270259357, 0}, | ||
{-0.10566243270259357, 0, 0.10566243270259357, 0, -0.39433756729740643, 0, 0.39433756729740643, 0}, | ||
{-0.10566243270259357, 0, 0.10566243270259357, 0, -0.39433756729740643, 0, 0.39433756729740643, 0}}, | ||
{{-0.39433756729740643, 0, -0.10566243270259357, 0, 0.39433756729740643, 0, 0.10566243270259357, 0}, | ||
{-0.10566243270259357, 0, -0.39433756729740643, 0, 0.10566243270259357, 0, 0.39433756729740643, 0}, | ||
{-0.39433756729740643, 0, -0.10566243270259357, 0, 0.39433756729740643, 0, 0.10566243270259357, 0}, | ||
{-0.10566243270259357, 0, -0.39433756729740643, 0, 0.10566243270259357, 0, 0.39433756729740643, 0}} | ||
}; | ||
|
||
const CeedScalar Q1_interp_gauss_lobatto[4][8] = { | ||
{1, 0, 0, 0, 0, 0, 0, 0}, | ||
{0, 0, 1, 0, 0, 0, 0, 0}, | ||
{0, 0, 0, 0, 1, 0, 0, 0}, | ||
{0, 0, 0, 0, 0, 0, 1, 0} | ||
}; | ||
/* clang-format off */ | ||
const CeedScalar Q1_grad_gauss_lobatto[3][4][8] = { | ||
{{-0.5, 0.5, 0, 0, 0, 0, 0, 0}, | ||
{0, 0, -0.5, 0.5, 0, 0, 0, 0}, | ||
{0, 0, 0, 0, -0.5, 0.5, 0, 0}, | ||
{0, 0, 0, 0, 0, 0, -0.5, 0.5}}, | ||
{{-0.5, 0, 0.5, 0, 0, 0, 0, 0}, | ||
{-0.5, 0, 0.5, 0, 0, 0, 0, 0}, | ||
{0, 0, 0, 0, -0.5, 0, 0.5, 0}, | ||
{0, 0, 0, 0, -0.5, 0, 0.5, 0}}, | ||
{{-0.5, 0, 0, 0, 0.5, 0, 0, 0}, | ||
{0, 0, -0.5, 0, 0, 0, 0.5, 0}, | ||
{-0.5, 0, 0, 0, 0.5, 0, 0, 0}, | ||
{0, 0, -0.5, 0, 0, 0, 0.5, 0}} | ||
}; | ||
/* clang-format on */ | ||
|
||
static void GetCellToFaceTabulation(CeedQuadMode quad_mode, CeedInt *P, CeedInt *Q, const CeedScalar **interp, const CeedScalar **grad) { | ||
if (P) *P = 8; | ||
if (Q) *Q = 4; | ||
|
||
if (quad_mode == CEED_GAUSS) { | ||
*interp = (const CeedScalar *)Q1_interp_gauss; | ||
*grad = (const CeedScalar *)Q1_grad_gauss; | ||
} | ||
if (quad_mode == CEED_GAUSS_LOBATTO) { | ||
*interp = (const CeedScalar *)Q1_interp_gauss_lobatto; | ||
*grad = (const CeedScalar *)Q1_grad_gauss_lobatto; | ||
} | ||
} |