// Copyright (c) 2010-2022, Lawrence Livermore National Security, LLC. Produced // at the Lawrence Livermore National Laboratory. All Rights reserved. See files // LICENSE and NOTICE for details. LLNL-CODE-806117. // // This file is part of the MFEM library. For more information and source code // availability visit https://mfem.org. // // MFEM is free software; you can redistribute it and/or modify it under the // terms of the BSD-3 license. We welcome feedback and contributions, see file // CONTRIBUTING.md for details. #include "fem.hpp" namespace mfem { void DofTransformation::TransformPrimal(Vector &v) const { TransformPrimal(v.GetData()); } void DofTransformation::TransformPrimalCols(DenseMatrix &V) const { for (int c=0; cTransformPrimalCols(elmat); dom_dof_trans->TransformDualRows(elmat); } else if (ran_dof_trans) { ran_dof_trans->TransformPrimalCols(elmat); } else if (dom_dof_trans) { dom_dof_trans->TransformDualRows(elmat); } else { // If both transformations are NULL this function should not be called } } void DofTransformation::InvTransformDual(Vector &v) const { InvTransformDual(v.GetData()); } void TransformDual(const DofTransformation *ran_dof_trans, const DofTransformation *dom_dof_trans, DenseMatrix &elmat) { if (ran_dof_trans && dom_dof_trans) { ran_dof_trans->TransformDualCols(elmat); dom_dof_trans->TransformDualRows(elmat); } else if (ran_dof_trans) { ran_dof_trans->TransformDualCols(elmat); } else if (dom_dof_trans) { dom_dof_trans->TransformDualRows(elmat); } else { // If both transformations are NULL this function should not be called } } void VDofTransformation::TransformPrimal(double *v) const { int size = doftrans_->Size(); if ((Ordering::Type)ordering_ == Ordering::byNODES || vdim_ == 1) { for (int i=0; iTransformPrimal(&v[i*size]); } } else { Vector vec(size); for (int i=0; iTransformPrimal(vec); for (int j=0; jHeight(); if ((Ordering::Type)ordering_ == Ordering::byNODES) { for (int i=0; iInvTransformPrimal(&v[i*size]); } } else { Vector vec(size); for (int i=0; iInvTransformPrimal(vec); for (int j=0; jSize(); if ((Ordering::Type)ordering_ == Ordering::byNODES) { for (int i=0; iTransformDual(&v[i*size]); } } else { Vector vec(size); for (int i=0; iTransformDual(vec); for (int j=0; jSize(); if ((Ordering::Type)ordering_ == Ordering::byNODES) { for (int i=0; iInvTransformDual(&v[i*size]); } } else { Vector vec(size); for (int i=0; iInvTransformDual(vec); for (int j=0; j(ND_DofTransformation::T_data), 2, 2, 6); const double ND_DofTransformation::TInv_data[24] = { 1.0, 0.0, 0.0, 1.0, -1.0, -1.0, 0.0, 1.0, -1.0, -1.0, 1.0, 0.0, 1.0, 0.0, -1.0, -1.0, 0.0, 1.0, -1.0, -1.0, 0.0, 1.0, 1.0, 0.0 }; const DenseTensor ND_DofTransformation ::TInv(const_cast(TInv_data), 2, 2, 6); ND_DofTransformation::ND_DofTransformation(int size, int p) : DofTransformation(size) , order(p) , nedofs(p) , nfdofs(p*(p-1)) { } ND_TriDofTransformation::ND_TriDofTransformation(int p) : ND_DofTransformation(p*(p + 2), p) { } void ND_TriDofTransformation::TransformPrimal(double *v) const { // Return immediately when no face DoFs are present if (nfdofs < 2) { return; } MFEM_VERIFY(Fo.Size() >= 1, "Face orientations are unset in ND_TriDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<1; f++) { for (int i=0; i= 1, "Face orientations are unset in ND_TriDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<1; f++) { for (int i=0; i= 1, "Face orientations are unset in ND_TriDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<1; f++) { for (int i=0; i= 1, "Face orientations are unset in ND_TriDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<1; f++) { for (int i=0; i= 4, "Face orientations are unset in ND_TetDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<4; f++) { for (int i=0; i= 4, "Face orientations are unset in ND_TetDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<4; f++) { for (int i=0; i= 4, "Face orientations are unset in ND_TetDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<4; f++) { for (int i=0; i= 4, "Face orientations are unset in ND_TetDofTransformation"); double data[2]; Vector v2(data, 2); // Transform face DoFs for (int f=0; f<4; f++) { for (int i=0; i= 2, "Face orientations are unset in ND_WedgeDofTransformation"); double data[2]; Vector v2(data, 2); // Transform triangular face DoFs for (int f=0; f<2; f++) { for (int i=0; i= 2, "Face orientations are unset in ND_WedgeDofTransformation"); double data[2]; Vector v2(data, 2); // Transform triangular face DoFs for (int f=0; f<2; f++) { for (int i=0; i= 2, "Face orientations are unset in ND_WedgeDofTransformation"); double data[2]; Vector v2(data, 2); // Transform triangular face DoFs for (int f=0; f<2; f++) { for (int i=0; i= 2, "Face orientations are unset in ND_WedgeDofTransformation"); double data[2]; Vector v2(data, 2); // Transform triangular face DoFs for (int f=0; f<2; f++) { for (int i=0; i