53 const bool useFFT,
const bool dealiasing)
55 m_bndCondExpansions(), m_bndCondBndWeight(), m_bndConditions()
62 m_bndCondExpansions(In.m_bndCondExpansions),
63 m_bndCondBndWeight(In.m_bndCondBndWeight),
64 m_bndConditions(In.m_bndConditions)
66 if (DeclarePlanesSetCoeffPhys)
69 std::dynamic_pointer_cast<DisContField>(In.
m_planes[0]);
71 for (
int n = 0; n <
m_planes.size(); ++n)
84 const bool useFFT,
const bool dealiasing,
88 m_bndCondExpansions(), m_bndCondBndWeight(), m_bndConditions()
96 pSession, graph2D, variable,
true,
false, ImpType);
102 for (i = 0; i < nel; ++i)
107 for (n = 1; n <
m_planes.size(); ++n)
110 *plane_zero, graph2D, variable,
true,
false);
112 for (i = 0; i < nel; ++i)
114 (*m_exp).push_back((*
m_exp)[i]);
120 for (n = 0; n <
m_planes.size(); ++n)
126 pSession, HomoBasis, lhom, useFFT, dealiasing, trace);
134 if (variable.compare(
"DefaultVar") != 0)
172 for (
auto &it : bregions)
177 for (n = 0; n < nplanes; ++n)
179 PlanesBndCondExp[n] =
m_planes[n]->UpdateBndCondExpansion(cnt);
183 auto comm = boundaryCondition->GetComm();
184 int size = boundaryCondition->GetComm()->GetSize();
197 PlanesBndCondExp, comm);
207 const int nPlanes =
m_planes.size();
208 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
213 traceMap->GetBndCondIDToGlobalTraceID();
214 int mapSize = traceBndMap.size();
219 int i, n, e, cnt = 0, cnt1 = 0;
224 int nPlaneExp = nExp / nPlanes;
232 for (n = 0; n < nPlanes; ++n)
234 const int offset = n * nTracePlane;
235 for (e = 0; e < nPlaneExp; ++e)
273 for (n = 0; n <
m_planes.size(); ++n)
283 wfce = (PhysSpaceForcing) ? fce + cnt : fce + cnt1;
284 m_planes[n]->HelmSolve(wfce, e_out = outarray + cnt1, new_factors,
285 varcoeff, varfactors, dirForcing,
311 "Field must be in physical state to extract trace space.");
331 int nPoints_plane =
m_planes[0]->GetTotPoints();
332 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
334 for (
int i = 0; i <
m_planes.size(); ++i)
339 Vmath::Vcopy(nPoints_plane, &inarray[i * nPoints_plane], 1,
340 &inarray_plane[0], 1);
342 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
344 Vmath::Vcopy(nTracePts, &outarray_plane[0], 1, &outarray[i * nTracePts],
355 int i, std::shared_ptr<ExpList> &result,
const bool DeclareCoeffPhysArrays)
358 int offsetOld, offsetNew;
360 std::vector<unsigned int> eIDs;
365 for (cnt = n = 0; n < i; ++n)
373 eIDs.push_back(ElmtID[cnt + n]);
384 if (DeclareCoeffPhysArrays)
387 for (n = 0; n < result->GetExpSize(); ++n)
389 nq =
GetExp(ElmtID[cnt + n])->GetTotPoints();
391 offsetNew = result->GetPhys_Offset(n);
393 tmp2 = result->UpdatePhys() + offsetNew, 1);
395 nq =
GetExp(ElmtID[cnt + n])->GetNcoeffs();
397 offsetNew = result->GetCoeff_Offset(n);
399 tmp2 = result->UpdateCoeffs() + offsetNew, 1);
416 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
417 int nel_per_plane =
m_planes[0]->GetExpSize();
420 int MapSize = ElmtID_tmp.size();
433 m_planes[0]->GetBndCondExpansions()[n]->GetExpSize();
434 for (i = 0; i < planeExpSize; ++i, ++cntPlane)
436 for (j = 0; j < nplanes; j++)
439 ElmtID_tmp[cntPlane] + j * nel_per_plane;
441 EdgeID_tmp[cntPlane];
464 int exp_size, exp_size_per_plane, elmtID, boundaryID;
467 for (
int k = 0; k <
m_planes.size(); k++)
472 exp_size_per_plane = exp_size /
m_planes.size();
474 for (
int i = 0; i < exp_size_per_plane; i++)
481 ->GetExp(i + k * exp_size_per_plane)
486 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
488 i + k * exp_size_per_plane));
490 elmt->GetTracePhysVals(boundaryID, temp_BC_exp,
491 tmp_Tot = TotField + offset,
492 tmp_BC = BndVals + pos);
513 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
515 for (
int k = 0; k <
m_planes.size(); k++)
520 exp_size_per_plane = exp_size /
m_planes.size();
522 for (
int i = 0; i < exp_size_per_plane; i++)
529 i + k * exp_size_per_plane);
531 i + k * exp_size_per_plane);
535 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
537 i + k * exp_size_per_plane));
539 temp_BC_exp->NormVectorIProductWRTBase(
540 tmp_V1 = V1 + Phys_offset, tmp_V2 = V2 + Phys_offset,
541 tmp_outarray = outarray + Coef_offset);
564 for (
int j = 0; j < coordim; ++j)
572 for (
int n = 0; n < i; ++n)
583 elmt =
GetExp(ElmtID[cnt + n]);
585 elmt->GetTraceNormal(EdgeID[cnt + n]);
587 for (
int j = 0; j < expdim; ++j)
589 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
597 return std::map<int, RobinBCInfoSharedPtr>();
601 const NekDouble time,
const std::string varName,
610 for (i = 0; i < nbnd; ++i)
615 npoints = locExpList->GetNpoints();
621 valuesExp(npoints, 1.0);
623 locExpList->GetCoords(x0, x1, x2);
629 std::static_pointer_cast<
633 std::string exprbcs = bcPtr->m_expr;
635 if (bcfilename !=
"")
637 locExpList->ExtractCoeffsFromFile(
638 bcfilename, bcPtr->GetComm(), varName,
639 locExpList->UpdateCoeffs());
640 locExpList->BwdTrans(locExpList->GetCoeffs(),
641 locExpList->UpdatePhys());
642 valuesFile = locExpList->GetPhys();
648 std::static_pointer_cast<
651 ->m_dirichletCondition;
653 condition.
Evaluate(x0, x1, x2, time, valuesExp);
657 locExpList->UpdatePhys(), 1);
659 locExpList->SetWaveSpace(
false);
660 locExpList->FwdTransBndConstrained(locExpList->GetPhys(),
661 locExpList->UpdateCoeffs());
672 if (bcfilename !=
"")
674 locExpList->ExtractCoeffsFromFile(
675 bcfilename, bcPtr->GetComm(), varName,
676 locExpList->UpdateCoeffs());
677 locExpList->BwdTrans(locExpList->GetCoeffs(),
678 locExpList->UpdatePhys());
683 std::static_pointer_cast<
686 ->m_neumannCondition;
688 condition.
Evaluate(x0, x1, x2, time,
689 locExpList->UpdatePhys());
692 locExpList->IProductWRTBase(locExpList->GetPhys(),
693 locExpList->UpdateCoeffs());
703 if (bcfilename !=
"")
705 locExpList->ExtractCoeffsFromFile(
706 bcfilename, bcPtr->GetComm(), varName,
707 locExpList->UpdateCoeffs());
708 locExpList->BwdTrans(locExpList->GetCoeffs(),
709 locExpList->UpdatePhys());
714 std::static_pointer_cast<
719 condition.
Evaluate(x0, x1, x2, time,
720 locExpList->UpdatePhys());
723 locExpList->IProductWRTBase(locExpList->GetPhys(),
724 locExpList->UpdateCoeffs());
733 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.
void v_GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID) override
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
AssemblyMapDGSharedPtr & v_GetTraceMap() override
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
void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays) override
std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i) override
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)
void v_NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID) override
void v_GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID) override
void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals) override
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.
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...
const Array< OneD, const SpatialDomains::BoundaryConditionShPtr > & v_GetBndConditions() override
const Array< OneD, const int > & v_GetTraceBndMap() override
std::map< int, RobinBCInfoSharedPtr > v_GetRobinBCInfo() override
void v_SetBndCondBwdWeight(const int index, const NekDouble value) override
~DisContField3DHomogeneous1D() override
Destructor.
DisContField3DHomogeneous1D()
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
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)