|
Nektar++
|
Interior penalty diffusion, redesign against legacy. More...
#include <TestDiffusionIP.hpp>
Public Member Functions | |
| TestDiffusionIP ()=default | |
| void | SetTestCase () |
| void | RunTestCase () |
| void | ExpectedSolution () |
| void | GetFluxCons (const int nDim, const Array< OneD, Array< OneD, TData > > &inarray, const TensorOfArray3D< TData > &qfield, TensorOfArray3D< TData > &viscousTensor, Array< OneD, int > &nonZeroIndex, const Array< OneD, Array< OneD, TData > > &normal) |
| Isotropic unit viscous tensor, matching m_diffCoeff. | |
| void | GetFluxConsTrace (const int nDim, const Array< OneD, Array< OneD, TData > > &inarray, const TensorOfArray3D< TData > &qfield, TensorOfArray3D< TData > &outarray, Array< OneD, int > &nonZeroIndex, const Array< OneD, Array< OneD, TData > > &normal) |
| The same flux on a trace, where it is already contracted with the normal. | |
| void | GetSymmFluxCons (const int nDim, const Array< OneD, Array< OneD, TData > > &inaverg, const Array< OneD, Array< OneD, TData > > &inarray, TensorOfArray3D< TData > &outarray, Array< OneD, int > &nonZeroIndex, const Array< OneD, Array< OneD, TData > > &normal) |
| Symmetric flux for the interior penalty form. | |
| void | SpecialBndTreat (Array< OneD, Array< OneD, TData > > &consvar) |
| Boundary fix-up hook. A scalar diffusion has nothing to correct - it exists for the compressible solver, which resets the energy at a wall - but DiffusionIP calls it unconditionally, so it has to be bound. | |
Public Member Functions inherited from TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField > | |
| TestOp ()=default | |
| virtual | ~TestOp () |
| void | Configure (void) |
| void | Configure3DH1 (const unsigned int nhomo=1) |
| void | Configure3DH2 (const unsigned int nhomoY=1, const unsigned int nhomoZ=1) |
| void | SetSession (void) |
| void | SetExpList (void) |
| void | SetExpList3DH1 (const unsigned int nhomo=1) |
| void | SetExpList3DH2 (const unsigned int nhomoY=1, const unsigned int nhomoZ=1) |
| virtual void | SetFixture (const unsigned int nhomo) |
| virtual bool | Compare (TData tol) |
| Compare this field to another field, with absolute tolerance tol. The two must have the same blocks and components; their interleave widths may differ. | |
Static Public Member Functions | |
| static void | SetAllNonZero (const unsigned n, Array< OneD, int > &nonZeroIndex) |
| Mark every variable as carrying a non-zero flux. | |
Static Public Member Functions inherited from TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField > | |
| static void | MixInterleaveWidths (TField &field) |
Put the blocks of field at alternating interleave widths, the execution space's vector width on even blocks and 1 on odd ones, reshaping the data in place: a field whose blocks differ in width, for an operator that must read any mix, such as the trace flux, which addresses each trace at the width of the element block it lies in. On Serial every width is 1 and nothing changes. | |
Public Attributes | |
| std::vector< TData > | m_diffCoeff |
Additional Inherited Members | |
Protected Attributes inherited from TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField > | |
| std::string | meshName |
| Field< TData, stateIn > * | fixt_in |
| Field< TData, stateOut > * | fixt_out |
| Field< TData, stateIn > * | fixt_out_2 |
| Field< TData, stateOut > * | fixt_expected |
| std::shared_ptr< MultiRegions::ExpList > | fixt_explist |
| LibUtilities::SessionReaderSharedPtr | session |
Interior penalty diffusion, redesign against legacy.
Mirrors the AdvectionWeakDG fixture. The value of having it is that diffusion previously had no operator-level test at all: its only cover was the solver regression cases, which report an L2 error against an exact solution and so say only that something is wrong, not where. This compares the operator's output pointwise against the legacy operator applied to the same field, which is what makes a discrepancy locatable.
Definition at line 61 of file TestDiffusionIP.hpp.
|
default |
|
inline |
Definition at line 154 of file TestDiffusionIP.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::LibUtilities::NekFactoryBase< tKey, tBase, tBasePtr, tParam >::CreateInstance(), Nektar::Collections::eNoCollection, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_expected, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_in, Nektar::SolverUtils::GetDiffusionFactory(), TestDiffusionIP< TData >::GetFluxCons(), TestDiffusionIP< TData >::GetFluxConsTrace(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), TestDiffusionIP< TData >::GetSymmFluxCons(), graph, Nektar::SpatialDomains::MeshGraphIO::Read(), TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::session, TestDiffusionIP< TData >::SpecialBndTreat(), and Nektar::LibUtilities::Field< TData, TState >::ToArray().
Referenced by TestDiffusionIP< TData >::SetTestCase().
|
inline |
Isotropic unit viscous tensor, matching m_diffCoeff.
Serves both the volume and the trace hook: with a constant unit diffusivity the flux is the gradient itself either side of a trace, so there is nothing to distinguish them.
Definition at line 247 of file TestDiffusionIP.hpp.
References TestDiffusionIP< TData >::SetAllNonZero(), and Vmath::Vcopy().
Referenced by TestDiffusionIP< TData >::ExpectedSolution().
|
inline |
The same flux on a trace, where it is already contracted with the normal.
So the output has one direction rather than nDim - which is the whole difference between this and GetFluxCons(), and why the reference implementation in NavierStokesCFE binds a different instantiation of its flux function here rather than the same one. Binding the volume form in this slot indexes the output past its first direction, and the failure surfaces well inside SolverUtils rather than at the binding.
Definition at line 284 of file TestDiffusionIP.hpp.
References TestDiffusionIP< TData >::SetAllNonZero(), Vmath::Vvtvp(), and Vmath::Zero().
Referenced by TestDiffusionIP< TData >::ExpectedSolution().
|
inline |
Symmetric flux for the interior penalty form.
With unit isotropic diffusivity this is the jump carried into each coordinate direction weighted by the trace normal. Kept separate from GetFluxCons() because it is the term the symmetrising work varies, and having it as its own hook is what lets that be exercised here.
Definition at line 315 of file TestDiffusionIP.hpp.
References TestDiffusionIP< TData >::SetAllNonZero(), and Vmath::Vmul().
Referenced by TestDiffusionIP< TData >::ExpectedSolution().
|
inline |
Definition at line 121 of file TestDiffusionIP.hpp.
References Nektar::DiffusionScalarVolFluxOp< TData >::Create(), TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_in, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_out, TestDiffusionIP< TData >::m_diffCoeff, and TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::session.
|
inlinestatic |
Mark every variable as carrying a non-zero flux.
Definition at line 231 of file TestDiffusionIP.hpp.
Referenced by TestDiffusionIP< TData >::GetFluxCons(), TestDiffusionIP< TData >::GetFluxConsTrace(), and TestDiffusionIP< TData >::GetSymmFluxCons().
|
inline |
Definition at line 67 of file TestDiffusionIP.hpp.
References el, TestDiffusionIP< TData >::ExpectedSolution(), TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_explist, TestOp< TData, FieldState::Phys, FieldState::Phys, MultiRegions::DisContField >::fixt_in, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), and TestDiffusionIP< TData >::m_diffCoeff.
|
inline |
Boundary fix-up hook. A scalar diffusion has nothing to correct - it exists for the compressible solver, which resets the energy at a wall - but DiffusionIP calls it unconditionally, so it has to be bound.
Definition at line 340 of file TestDiffusionIP.hpp.
Referenced by TestDiffusionIP< TData >::ExpectedSolution().
| std::vector<TData> TestDiffusionIP< TData >::m_diffCoeff |
Definition at line 346 of file TestDiffusionIP.hpp.
Referenced by TestDiffusionIP< TData >::RunTestCase(), and TestDiffusionIP< TData >::SetTestCase().