Nektar++
|
A helper class to deal with trace operations in the discontinuous Galerkin code. More...
#include <LocTraceToTraceMap.h>
Public Member Functions | |
LocTraceToTraceMap (const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const std::vector< bool > &LeftAdjacents) | |
Set up trace to trace mapping components. More... | |
virtual | ~LocTraceToTraceMap () |
void | Setup2D (const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const std::vector< bool > &LeftAdjacents) |
Set up member variables for a two-dimensional problem. More... | |
void | Setup3D (const ExpList &locExp, const ExpListSharedPtr &trace, const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > &elmtToTrace, const std::vector< bool > &LeftAdjacents) |
Set up member variables for a three-dimensional problem. More... | |
void | LocTracesFromField (const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > faces) |
Gather the local traces in physical space from field using m_fieldToLocTraceMap. More... | |
void | FwdLocTracesFromField (const Array< OneD, const NekDouble > &field, Array< OneD, NekDouble > faces) |
Gather the forwards-oriented local traces in physical space from field using m_fieldToLocTraceMap. More... | |
void | InterpLocEdgesToTrace (const int dir, const Array< OneD, const NekDouble > &locfaces, Array< OneD, NekDouble > edges) |
Interpolate local trace edges to global trace edge point distributions where required. More... | |
void | InterpLocFacesToTrace (const int dir, const Array< OneD, const NekDouble > &locfaces, Array< OneD, NekDouble > faces) |
Interpolate local faces to trace face point distributions where required. More... | |
void | AddTraceCoeffsToFieldCoeffs (const Array< OneD, const NekDouble > &trace, Array< OneD, NekDouble > &field) |
Add contributions from trace coefficients to the elemental field storage. More... | |
void | AddTraceCoeffsToFieldCoeffs (const int dir, const Array< OneD, const NekDouble > &race, Array< OneD, NekDouble > &field) |
Add contributions from backwards or forwards oriented trace coefficients to the elemental field storage. More... | |
int | GetNFwdLocTracePts () |
Return the number of `forward' local trace points. More... | |
int | GetNLocTracePts () |
Return the number of local trace points. More... | |
Private Attributes | |
int | m_nFwdLocTracePts |
The number of forward trace points. A local trace element is `forward' if it is the side selected for the global trace. More... | |
int | m_nLocTracePts |
The number of local trace points. More... | |
int | m_nTracePts |
The number of global trace points. More... | |
Array< OneD, int > | m_fieldToLocTraceMap |
A mapping from the local trace points, arranged as all forwards traces followed by backwards traces, to elemental storage. More... | |
Array< OneD, Array< OneD, int > > | m_LocTraceToTraceMap |
A mapping from local trace points to the global trace. Dimension 0 holds forward traces, dimension 1 backward. More... | |
Array< OneD, Array< OneD, InterpLocTraceToTrace > > | m_interpTrace |
A mapping holding the type of interpolation needed for each local trace. Dimension 0 holds forward traces, dimension 1 backward. More... | |
Array< OneD, Array< OneD, DNekMatSharedPtr > > | m_interpTraceI0 |
Interpolation matrices for either 2D edges or first coordinate of 3D face. More... | |
Array< OneD, Array< OneD, DNekMatSharedPtr > > | m_interpTraceI1 |
Interpolation matrices for the second coordinate of 3D face, not used in 2D. More... | |
Array< OneD, Array< OneD, TraceInterpPoints > > | m_interpPoints |
Interpolation points key distributions for each of the local to global mappings. More... | |
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > | m_interpEndPtI0 |
Mapping to hold first coordinate direction endpoint interpolation, which can be more optimal if using Gauss-Radau distribution for triangles. More... | |
Array< OneD, Array< OneD, Array< OneD, NekDouble > > > | m_interpEndPtI1 |
Mapping to hold second coordinate direction endpoint interpolation, which can be more optimal if using Gauss-Radau distribution for triangles. More... | |
Array< OneD, Array< OneD, int > > | m_interpNfaces |
Number of edges/faces on a 2D/3D element that require interpolation. More... | |
int | m_nTraceCoeffs [2] |
Number of forwards/backwards trace coefficients. More... | |
Array< OneD, Array< OneD, int > > | m_traceCoeffsToElmtMap |
Mapping from forwards/backwards trace coefficients to elemental coefficient storage. More... | |
Array< OneD, Array< OneD, int > > | m_traceCoeffsToElmtTrace |
Mapping from forwards/backwards trace coefficients to the position of the trace element in global storage. More... | |
Array< OneD, Array< OneD, int > > | m_traceCoeffsToElmtSign |
Sign array for mapping from forwards/backwards trace coefficients to local trace storage. More... | |
A helper class to deal with trace operations in the discontinuous Galerkin code.
This class sets up a number of mappings to deal with operations that take the "local trace" of an expansion list – i.e. the concatenation of all elemental facets – to the "global trace" – where the duplicate facets between connected elements have been removed.
Elements: Local trace: Global trace: +----+----+ + +---+ + + +---+ + + +---+ + +---+ + | | | | | | | | | | | | | | | | | | | | +----+----+ + +---+ + + +---+ + + +---+ + +---+ +
There are a number of mappings that are required that this class provides maps for:
These are documented in the member variables and class functions.
Definition at line 154 of file LocTraceToTraceMap.h.
Nektar::MultiRegions::LocTraceToTraceMap::LocTraceToTraceMap | ( | const ExpList & | locExp, |
const ExpListSharedPtr & | trace, | ||
const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & | elmtToTrace, | ||
const std::vector< bool > & | LeftAdjacents | ||
) |
Set up trace to trace mapping components.
locExp | Expansion list of full dimension problem. |
trace | Expansion list of one dimension lower trace. |
elmtToTrace | Mapping from elemental facets to trace. |
leftAdjacents | Vector of bools denoting forwards-oriented traces. |
Definition at line 64 of file LocTraceToTraceMap.cpp.
References ASSERTL0, and Nektar::MultiRegions::ExpList::GetExp().
|
virtual |
Definition at line 93 of file LocTraceToTraceMap.cpp.
void Nektar::MultiRegions::LocTraceToTraceMap::AddTraceCoeffsToFieldCoeffs | ( | const Array< OneD, const NekDouble > & | trace, |
Array< OneD, NekDouble > & | field | ||
) |
Add contributions from trace coefficients to the elemental field storage.
trace | Array of global trace coefficients. |
field | Array containing field coefficients storage. |
Definition at line 1213 of file LocTraceToTraceMap.cpp.
void Nektar::MultiRegions::LocTraceToTraceMap::AddTraceCoeffsToFieldCoeffs | ( | const int | dir, |
const Array< OneD, const NekDouble > & | trace, | ||
Array< OneD, NekDouble > & | field | ||
) |
Add contributions from backwards or forwards oriented trace coefficients to the elemental field storage.
dir | Selects forwards (0) or backwards (1) direction |
trace | Array of global trace coefficients. |
field | Array containing field coefficients storage. |
Definition at line 1233 of file LocTraceToTraceMap.cpp.
void Nektar::MultiRegions::LocTraceToTraceMap::FwdLocTracesFromField | ( | const Array< OneD, const NekDouble > & | field, |
Array< OneD, NekDouble > | faces | ||
) |
Gather the forwards-oriented local traces in physical space from field using m_fieldToLocTraceMap.
field | Solution field in physical space |
faces | Resulting local forwards-oriented traces. |
Definition at line 866 of file LocTraceToTraceMap.cpp.
References Vmath::Gathr().
|
inline |
Return the number of `forward' local trace points.
Definition at line 212 of file LocTraceToTraceMap.h.
References m_nFwdLocTracePts.
|
inline |
Return the number of local trace points.
Definition at line 220 of file LocTraceToTraceMap.h.
References m_nLocTracePts.
void Nektar::MultiRegions::LocTraceToTraceMap::InterpLocEdgesToTrace | ( | const int | dir, |
const Array< OneD, const NekDouble > & | locedges, | ||
Array< OneD, NekDouble > | edges | ||
) |
Interpolate local trace edges to global trace edge point distributions where required.
dir | Selects forwards (0) or backwards (1) direction. |
locfaces | Local trace edge storage. |
faces | Global trace edge storage |
Definition at line 880 of file LocTraceToTraceMap.cpp.
References ASSERTL0, ASSERTL1, Vmath::Ddot(), Nektar::MultiRegions::eInterpDir0, Nektar::MultiRegions::eInterpEndPtDir0, Nektar::MultiRegions::eNoInterp, Nektar::LibUtilities::PointsKey::GetNumPoints(), Vmath::Scatr(), and Vmath::Vcopy().
void Nektar::MultiRegions::LocTraceToTraceMap::InterpLocFacesToTrace | ( | const int | dir, |
const Array< OneD, const NekDouble > & | locfaces, | ||
Array< OneD, NekDouble > | faces | ||
) |
Interpolate local faces to trace face point distributions where required.
dir | Selects forwards (0) or backwards (1) direction. |
locfaces | Local trace face storage. |
faces | Global trace face storage |
Definition at line 982 of file LocTraceToTraceMap.cpp.
References ASSERTL1, Vmath::Ddot(), Nektar::MultiRegions::eInterpBothDirs, Nektar::MultiRegions::eInterpDir0, Nektar::MultiRegions::eInterpDir1, Nektar::MultiRegions::eInterpEndPtDir0, Nektar::MultiRegions::eInterpEndPtDir0InterpDir1, Nektar::MultiRegions::eInterpEndPtDir1, Nektar::MultiRegions::eNoInterp, Nektar::LibUtilities::PointsKey::GetNumPoints(), Vmath::Scatr(), and Vmath::Vcopy().
void Nektar::MultiRegions::LocTraceToTraceMap::LocTracesFromField | ( | const Array< OneD, const NekDouble > & | field, |
Array< OneD, NekDouble > | faces | ||
) |
Gather the local traces in physical space from field using m_fieldToLocTraceMap.
field | Solution field in physical space |
faces | Resulting local traces. |
Definition at line 850 of file LocTraceToTraceMap.cpp.
References Vmath::Gathr().
void Nektar::MultiRegions::LocTraceToTraceMap::Setup2D | ( | const ExpList & | locExp, |
const ExpListSharedPtr & | trace, | ||
const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & | elmtToTrace, | ||
const std::vector< bool > & | LeftAdjacents | ||
) |
Set up member variables for a two-dimensional problem.
locExp | Expansion list of 2D elements |
trace | Expansion list of the one-dimensional trace. |
elmtToTrace | Mapping from elemental edges to trace. |
leftAdjacents | Vector of bools denoting forwards-oriented traces. |
Definition at line 105 of file LocTraceToTraceMap.cpp.
References Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::MultiRegions::eInterpDir0, Nektar::MultiRegions::eInterpEndPtDir0, Nektar::MultiRegions::eNoInterp, Nektar::LibUtilities::eNoPointsType, Nektar::LibUtilities::eTriangle, Nektar::MultiRegions::ExpList::GetCoeff_Offset(), Nektar::MultiRegions::ExpList::GetExp(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), Nektar::LibUtilities::PointsKey::GetPointsType(), Nektar::iterator, Nektar::LibUtilities::PointsManager(), sign, and Vmath::Vcopy().
void Nektar::MultiRegions::LocTraceToTraceMap::Setup3D | ( | const ExpList & | locExp, |
const ExpListSharedPtr & | trace, | ||
const Array< OneD, Array< OneD, LocalRegions::ExpansionSharedPtr > > & | elmtToTrace, | ||
const std::vector< bool > & | LeftAdjacents | ||
) |
Set up member variables for a three-dimensional problem.
locExp | Expansion list of 3D elements |
trace | Expansion list of the two-dimensional trace. |
elmtToTrace | Mapping from elemental faces to trace. |
leftAdjacents | Vector of bools denoting forwards-oriented traces. |
Definition at line 440 of file LocTraceToTraceMap.cpp.
References Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eGaussRadauMAlpha1Beta0, Nektar::MultiRegions::eInterpBothDirs, Nektar::MultiRegions::eInterpDir0, Nektar::MultiRegions::eInterpDir1, Nektar::MultiRegions::eInterpEndPtDir0, Nektar::MultiRegions::eInterpEndPtDir0InterpDir1, Nektar::MultiRegions::eInterpEndPtDir1, Nektar::MultiRegions::eNoInterp, Nektar::MultiRegions::ExpList::GetCoeff_Offset(), Nektar::MultiRegions::ExpList::GetExp(), Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), Nektar::LibUtilities::PointsKey::GetPointsType(), Nektar::iterator, Nektar::LibUtilities::PointsManager(), sign, and Vmath::Vcopy().
A mapping from the local trace points, arranged as all forwards traces followed by backwards traces, to elemental storage.
Definition at line 235 of file LocTraceToTraceMap.h.
|
private |
Mapping to hold first coordinate direction endpoint interpolation, which can be more optimal if using Gauss-Radau distribution for triangles.
Definition at line 253 of file LocTraceToTraceMap.h.
|
private |
Mapping to hold second coordinate direction endpoint interpolation, which can be more optimal if using Gauss-Radau distribution for triangles.
Definition at line 257 of file LocTraceToTraceMap.h.
Number of edges/faces on a 2D/3D element that require interpolation.
Definition at line 259 of file LocTraceToTraceMap.h.
|
private |
Interpolation points key distributions for each of the local to global mappings.
Definition at line 250 of file LocTraceToTraceMap.h.
|
private |
A mapping holding the type of interpolation needed for each local trace. Dimension 0 holds forward traces, dimension 1 backward.
Definition at line 241 of file LocTraceToTraceMap.h.
|
private |
Interpolation matrices for either 2D edges or first coordinate of 3D face.
Definition at line 244 of file LocTraceToTraceMap.h.
|
private |
Interpolation matrices for the second coordinate of 3D face, not used in 2D.
Definition at line 247 of file LocTraceToTraceMap.h.
|
private |
A mapping from local trace points to the global trace. Dimension 0 holds forward traces, dimension 1 backward.
Definition at line 238 of file LocTraceToTraceMap.h.
|
private |
The number of forward trace points. A local trace element is `forward' if it is the side selected for the global trace.
Definition at line 228 of file LocTraceToTraceMap.h.
Referenced by GetNFwdLocTracePts().
|
private |
The number of local trace points.
Definition at line 230 of file LocTraceToTraceMap.h.
Referenced by GetNLocTracePts().
|
private |
Number of forwards/backwards trace coefficients.
Definition at line 261 of file LocTraceToTraceMap.h.
|
private |
The number of global trace points.
Definition at line 232 of file LocTraceToTraceMap.h.
|
private |
Mapping from forwards/backwards trace coefficients to elemental coefficient storage.
Definition at line 264 of file LocTraceToTraceMap.h.
|
private |
Sign array for mapping from forwards/backwards trace coefficients to local trace storage.
Definition at line 270 of file LocTraceToTraceMap.h.