36#include <boost/core/ignore_unused.hpp>
57 const bool useFFT,
const bool dealiasing)
59 m_bndCondExpansions(), m_bndCondBndWeight(), m_bndConditions()
66 m_bndCondExpansions(In.m_bndCondExpansions),
67 m_bndCondBndWeight(In.m_bndCondBndWeight),
68 m_bndConditions(In.m_bndConditions)
70 if (DeclarePlanesSetCoeffPhys)
73 std::dynamic_pointer_cast<DisContField>(In.
m_planes[0]);
75 for (
int n = 0; n <
m_planes.size(); ++n)
88 const bool useFFT,
const bool dealiasing,
92 m_bndCondExpansions(), m_bndCondBndWeight(), m_bndConditions()
100 pSession, graph2D, variable,
true,
false, ImpType);
106 for (i = 0; i < nel; ++i)
111 for (n = 1; n <
m_planes.size(); ++n)
114 *plane_zero, graph2D, variable,
true,
false);
116 for (i = 0; i < nel; ++i)
118 (*m_exp).push_back((*
m_exp)[i]);
124 for (n = 0; n <
m_planes.size(); ++n)
130 pSession, HomoBasis, lhom, useFFT, dealiasing, trace);
138 if (variable.compare(
"DefaultVar") != 0)
176 for (
auto &it : bregions)
181 for (n = 0; n < nplanes; ++n)
183 PlanesBndCondExp[n] =
m_planes[n]->UpdateBndCondExpansion(cnt);
187 auto comm = boundaryCondition->GetComm();
188 int size = boundaryCondition->GetComm()->GetSize();
201 PlanesBndCondExp, comm);
211 const int nPlanes =
m_planes.size();
212 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
217 traceMap->GetBndCondIDToGlobalTraceID();
218 int mapSize = traceBndMap.size();
223 int i, n, e, cnt = 0, cnt1 = 0;
228 int nPlaneExp = nExp / nPlanes;
236 for (n = 0; n < nPlanes; ++n)
238 const int offset = n * nTracePlane;
239 for (e = 0; e < nPlaneExp; ++e)
277 for (n = 0; n <
m_planes.size(); ++n)
287 wfce = (PhysSpaceForcing) ? fce + cnt : fce + cnt1;
288 m_planes[n]->HelmSolve(wfce, e_out = outarray + cnt1, new_factors,
289 varcoeff, varfactors, dirForcing,
315 "Field must be in physical state to extract trace space.");
335 int nPoints_plane =
m_planes[0]->GetTotPoints();
336 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
338 for (
int i = 0; i <
m_planes.size(); ++i)
343 Vmath::Vcopy(nPoints_plane, &inarray[i * nPoints_plane], 1,
344 &inarray_plane[0], 1);
346 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
348 Vmath::Vcopy(nTracePts, &outarray_plane[0], 1, &outarray[i * nTracePts],
359 int i, std::shared_ptr<ExpList> &result,
const bool DeclareCoeffPhysArrays)
362 int offsetOld, offsetNew;
364 std::vector<unsigned int> eIDs;
369 for (cnt = n = 0; n < i; ++n)
377 eIDs.push_back(ElmtID[cnt + n]);
388 if (DeclareCoeffPhysArrays)
391 for (n = 0; n < result->GetExpSize(); ++n)
393 nq =
GetExp(ElmtID[cnt + n])->GetTotPoints();
395 offsetNew = result->GetPhys_Offset(n);
397 tmp2 = result->UpdatePhys() + offsetNew, 1);
399 nq =
GetExp(ElmtID[cnt + n])->GetNcoeffs();
401 offsetNew = result->GetCoeff_Offset(n);
403 tmp2 = result->UpdateCoeffs() + offsetNew, 1);
420 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
421 int nel_per_plane =
m_planes[0]->GetExpSize();
424 int MapSize = ElmtID_tmp.size();
437 m_planes[0]->GetBndCondExpansions()[n]->GetExpSize();
438 for (i = 0; i < planeExpSize; ++i, ++cntPlane)
440 for (j = 0; j < nplanes; j++)
443 ElmtID_tmp[cntPlane] + j * nel_per_plane;
445 EdgeID_tmp[cntPlane];
468 int exp_size, exp_size_per_plane, elmtID, boundaryID;
471 for (
int k = 0; k <
m_planes.size(); k++)
476 exp_size_per_plane = exp_size /
m_planes.size();
478 for (
int i = 0; i < exp_size_per_plane; i++)
485 ->GetExp(i + k * exp_size_per_plane)
490 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
492 i + k * exp_size_per_plane));
494 elmt->GetTracePhysVals(boundaryID, temp_BC_exp,
495 tmp_Tot = TotField + offset,
496 tmp_BC = BndVals + pos);
517 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
519 for (
int k = 0; k <
m_planes.size(); k++)
524 exp_size_per_plane = exp_size /
m_planes.size();
526 for (
int i = 0; i < exp_size_per_plane; i++)
533 i + k * exp_size_per_plane);
535 i + k * exp_size_per_plane);
539 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
541 i + k * exp_size_per_plane));
543 temp_BC_exp->NormVectorIProductWRTBase(
544 tmp_V1 = V1 + Phys_offset, tmp_V2 = V2 + Phys_offset,
545 tmp_outarray = outarray + Coef_offset);
568 for (
int j = 0; j < coordim; ++j)
576 for (
int n = 0; n < i; ++n)
587 elmt =
GetExp(ElmtID[cnt + n]);
589 elmt->GetTraceNormal(EdgeID[cnt + n]);
591 for (
int j = 0; j < expdim; ++j)
593 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
601 return std::map<int, RobinBCInfoSharedPtr>();
608 boost::ignore_unused(x2_in, x3_in);
614 for (i = 0; i < nbnd; ++i)
619 npoints = locExpList->GetNpoints();
625 valuesExp(npoints, 1.0);
627 locExpList->GetCoords(x0, x1, x2);
633 std::static_pointer_cast<
637 std::string exprbcs = bcPtr->m_expr;
639 if (bcfilename !=
"")
641 locExpList->ExtractCoeffsFromFile(
642 bcfilename, bcPtr->GetComm(), varName,
643 locExpList->UpdateCoeffs());
644 locExpList->BwdTrans(locExpList->GetCoeffs(),
645 locExpList->UpdatePhys());
646 valuesFile = locExpList->GetPhys();
652 std::static_pointer_cast<
655 ->m_dirichletCondition;
657 condition.
Evaluate(x0, x1, x2, time, valuesExp);
661 locExpList->UpdatePhys(), 1);
663 locExpList->SetWaveSpace(
false);
664 locExpList->FwdTransBndConstrained(locExpList->GetPhys(),
665 locExpList->UpdateCoeffs());
676 if (bcfilename !=
"")
678 locExpList->ExtractCoeffsFromFile(
679 bcfilename, bcPtr->GetComm(), varName,
680 locExpList->UpdateCoeffs());
681 locExpList->BwdTrans(locExpList->GetCoeffs(),
682 locExpList->UpdatePhys());
687 std::static_pointer_cast<
690 ->m_neumannCondition;
692 condition.
Evaluate(x0, x1, x2, time,
693 locExpList->UpdatePhys());
696 locExpList->IProductWRTBase(locExpList->GetPhys(),
697 locExpList->UpdateCoeffs());
707 if (bcfilename !=
"")
709 locExpList->ExtractCoeffsFromFile(
710 bcfilename, bcPtr->GetComm(), varName,
711 locExpList->UpdateCoeffs());
712 locExpList->BwdTrans(locExpList->GetCoeffs(),
713 locExpList->UpdatePhys());
718 std::static_pointer_cast<
723 condition.
Evaluate(x0, x1, x2, time,
724 locExpList->UpdatePhys());
727 locExpList->IProductWRTBase(locExpList->GetPhys(),
728 locExpList->UpdateCoeffs());
737 ASSERTL0(
false,
"This type of BC not implemented yet");
#define ASSERTL0(condition, msg)
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Describes the specification for a Basis.
NekDouble Evaluate() const
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
virtual void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID) override
virtual GlobalLinSysKey v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing) override
void SetUpDG()
Set up all DG member variables and maps.
Array< OneD, int > m_traceBndMap
virtual AssemblyMapDGSharedPtr & v_GetTraceMap() override
virtual void v_ExtractTracePhys(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray) override
This method extracts the trace (edges in 2D) for each plane from the field inarray and puts the value...
Array< OneD, NekDouble > m_bndCondBndWeight
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays) override
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i) override
virtual ExpListSharedPtr & v_GetTrace() override
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
Array< OneD, int > m_BCtoElmMap
Storage space for the boundary to element and boundary to trace map. This member variable is really a...
Array< OneD, int > m_BCtoEdgMap
void SetupBoundaryConditions(const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom, SpatialDomains::BoundaryConditions &bcs, const std::string variable)
virtual void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID) override
virtual ~DisContField3DHomogeneous1D()
Destructor.
virtual void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID) override
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals) override
virtual void v_EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="", const NekDouble x2_in=NekConstants::kNekUnsetDouble, const NekDouble x3_in=NekConstants::kNekUnsetDouble) override
This function evaluates the boundary conditions at a certain time-level.
virtual const Array< OneD, const MultiRegions::ExpListSharedPtr > & v_GetBndCondExpansions(void) override
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
virtual const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions() override
virtual const Array< OneD, const int > & v_GetTraceBndMap() override
virtual std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo() override
virtual void v_SetBndCondBwdWeight(const int index, const NekDouble value) override
DisContField3DHomogeneous1D()
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions() override
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
NekDouble m_lhom
Width of homogeneous direction.
LibUtilities::TranspositionSharedPtr m_transposition
Array< OneD, ExpListSharedPtr > m_planes
NekDouble GetSpecVanVisc(const int k)
LibUtilities::CommSharedPtr m_StripZcomm
bool m_useFFT
FFT variables.
const Array< OneD, const std::shared_ptr< ExpList > > & GetBndCondExpansions()
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
int GetCoeff_Offset(int n) const
Get the start offset position for a local contiguous list of coeffs correspoinding to element n.
int GetExpSize(void)
This function returns the number of elements in the expansion.
bool m_physState
The state of the array m_phys.
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
int m_ncoeffs
The total number of local degrees of freedom. m_ncoeffs .
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
LibUtilities::SessionReaderSharedPtr m_session
Session.
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
int GetPhys_Offset(int n) const
Get the start offset position for a local contiguous list of quadrature points in a full array corres...
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
void HomogeneousFwdTrans(const int npts, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Describe a linear system.
const BoundaryRegionCollection & GetBoundaryRegions(void) const
const BoundaryConditionCollection & GetBoundaryConditions(void) const
std::shared_ptr< SessionReader > SessionReaderSharedPtr
@ beta
Gauss Radau pinned at x=-1,.
std::shared_ptr< Expansion > ExpansionSharedPtr
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
std::shared_ptr< DisContField > DisContFieldSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static GlobalLinSysKey NullGlobalLinSysKey(StdRegions::eNoMatrixType)
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
std::shared_ptr< DirichletBoundaryCondition > DirichletBCShPtr
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< NeumannBoundaryCondition > NeumannBCShPtr
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
std::map< ConstFactorType, NekDouble > ConstFactorMap
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
StdRegions::ConstFactorMap factors
The above copyright notice and this permission notice shall be included.
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)