Hi Kurt,
In some cases where we need to obtain derivatives at a boundary, it is useful to
define an expansion containing only the elements close to this boundary. We can
then calculate the derivatives using this expansion and extract the values
at the boundary. This expansion is what is refered in the code as BndElmtExp.
For example, in 2D with a mesh of quadrilateral elements, BndCondExp contains
the segments on the boundary while BndElmtExp contains the quads in contact with
these segments.
There are a few functions for working with BndElmtExp and BndCondExp:
- GetBndElmtExpansion(n, BndElmtExp, DeclareCoeffPhysArrays)
This creates the BndElmtExp for boundary n. If DeclareCoeffPhysArrays is
true the m_phys and m_coeffs of the field are extracted to the m_phys and
m_coeffs of BndElmtExp.
- ExtractPhysToBndElmt(n, phys, bndElmt)
Given a phys array for the whole expansion, this extracts the value at
the BndElmtExp for boundary n.
- ExtractElmtToBndPhys(n, element, boundary)
This extracts values from BndElmtExp to the corresponding BndCondExp.
- ExtractPhysToBnd(n, phys, bnd)
This extracts values from the whole expansion to BndCondExp.
I think the flowrate branch should be using ExtractPhysToBnd instead of
ExtractElmtToBndPhys. The idea in this case is to take the latest velocity
solution (in phys) and extract the values at the desired boundary (in bnd).
If you just want to take the values in physical space corresponding to the
coefficients that are already in the BndCondExp (as your code suggests), you
could just perform a BwdTrans using something like:
Array<OneD, Array<OneD, NekDouble> > boundary(m_spacedim);
MultiRegions::ExpListSharedPtr BndCondExp;
for(int i = 0; i < m_spacedim; i++)
{
BndCondExp = m_fields[i]->GetBndCondExpansions()[boundaryID];
boundary[i] = Array<OneD, NekDouble> (BndCondExp->GetTotPoints());
BndCondExp->BwdTrans(BndCondExp->GetCoeffs(), boundary[i]);
}
Cheers,
Douglas