36 #include <boost/core/ignore_unused.hpp>
45 namespace MultiRegions
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);
115 for (i = 0; i < nel; ++i)
117 (*m_exp).push_back((*
m_exp)[i]);
123 for (n = 0; n <
m_planes.size(); ++n)
129 pSession, HomoBasis, lhom, useFFT, dealiasing, trace);
137 if (variable.compare(
"DefaultVar") != 0)
174 for (
auto &it : bregions)
178 for (n = 0; n < nplanes; ++n)
180 PlanesBndCondExp[n] =
m_planes[n]->UpdateBndCondExpansion(cnt);
184 auto comm = boundaryCondition->GetComm();
185 int size = boundaryCondition->GetComm()->GetSize();
198 PlanesBndCondExp, comm);
230 for (n = 0; n <
m_planes.size(); ++n)
235 new_factors = factors;
240 wfce = (PhysSpaceForcing) ? fce + cnt : fce + cnt1;
241 m_planes[n]->HelmSolve(wfce, e_out = outarray + cnt1, new_factors,
242 varcoeff, varfactors, dirForcing,
255 boost::ignore_unused(x2_in, x3_in);
261 for (i = 0; i < nbnd; ++i)
266 npoints = locExpList->GetNpoints();
272 valuesExp(npoints, 1.0);
274 locExpList->GetCoords(x0, x1, x2);
280 std::static_pointer_cast<
284 std::string exprbcs = bcPtr->m_expr;
290 valuesFile = locExpList->GetPhys();
296 std::static_pointer_cast<
299 ->m_dirichletCondition;
301 condition.
Evaluate(x0, x1, x2, time, valuesExp);
305 locExpList->UpdatePhys(), 1);
308 locExpList->SetWaveSpace(
false);
310 locExpList->FwdTransBndConstrained(locExpList->GetPhys(),
311 locExpList->UpdateCoeffs());
330 std::static_pointer_cast<
333 ->m_neumannCondition;
335 condition.
Evaluate(x0, x1, x2, time,
336 locExpList->UpdatePhys());
338 locExpList->IProductWRTBase(locExpList->GetPhys(),
339 locExpList->UpdateCoeffs());
357 std::static_pointer_cast<
362 condition.
Evaluate(x0, x1, x2, time,
363 locExpList->UpdatePhys());
366 locExpList->IProductWRTBase(locExpList->GetPhys(),
367 locExpList->UpdateCoeffs());
376 ASSERTL0(
false,
"This type of BC not implemented yet");
403 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
404 int nel_per_plane =
m_planes[0]->GetExpSize();
407 int MapSize = ElmtID_tmp.size();
420 m_planes[0]->GetBndCondExpansions()[n]->GetExpSize();
421 for (i = 0; i < planeExpSize; ++i, ++cntPlane)
423 for (j = 0; j < nplanes; j++)
426 ElmtID_tmp[cntPlane] + j * nel_per_plane;
428 EdgeID_tmp[cntPlane];
440 int i, std::shared_ptr<ExpList> &result,
const bool DeclareCoeffPhysArrays)
443 int offsetOld, offsetNew;
445 std::vector<unsigned int> eIDs;
450 for (cnt = n = 0; n < i; ++n)
458 eIDs.push_back(ElmtID[cnt + n]);
469 if (DeclareCoeffPhysArrays)
472 for (n = 0; n < result->GetExpSize(); ++n)
474 nq =
GetExp(ElmtID[cnt + n])->GetTotPoints();
476 offsetNew = result->GetPhys_Offset(n);
478 tmp2 = result->UpdatePhys() + offsetNew, 1);
480 nq =
GetExp(ElmtID[cnt + n])->GetNcoeffs();
482 offsetNew = result->GetCoeff_Offset(n);
484 tmp2 = result->UpdateCoeffs() + offsetNew, 1);
504 int exp_size, exp_size_per_plane, elmtID, boundaryID;
507 for (
int k = 0; k <
m_planes.size(); k++)
512 exp_size_per_plane = exp_size /
m_planes.size();
514 for (
int i = 0; i < exp_size_per_plane; i++)
521 ->GetExp(i + k * exp_size_per_plane)
526 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
528 i + k * exp_size_per_plane));
530 elmt->GetTracePhysVals(boundaryID, temp_BC_exp,
531 tmp_Tot = TotField + offset,
532 tmp_BC = BndVals + pos);
553 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
555 for (
int k = 0; k <
m_planes.size(); k++)
560 exp_size_per_plane = exp_size /
m_planes.size();
562 for (
int i = 0; i < exp_size_per_plane; i++)
569 i + k * exp_size_per_plane);
571 i + k * exp_size_per_plane);
575 std::dynamic_pointer_cast<LocalRegions::Expansion1D>(
577 i + k * exp_size_per_plane));
579 temp_BC_exp->NormVectorIProductWRTBase(
580 tmp_V1 = V1 + Phys_offset, tmp_V2 = V2 + Phys_offset,
581 tmp_outarray = outarray + Coef_offset);
593 "Field must be in physical state to extract trace space.");
613 int nPoints_plane =
m_planes[0]->GetTotPoints();
614 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
616 for (
int i = 0; i <
m_planes.size(); ++i)
621 Vmath::Vcopy(nPoints_plane, &inarray[i * nPoints_plane], 1,
622 &inarray_plane[0], 1);
624 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
626 Vmath::Vcopy(nTracePts, &outarray_plane[0], 1, &outarray[i * nTracePts],
646 for (
int j = 0; j < coordim; ++j)
654 for (
int n = 0; n < i; ++n)
665 elmt =
GetExp(ElmtID[cnt + n]);
667 elmt->GetTraceNormal(EdgeID[cnt + n]);
669 for (
int j = 0; j < expdim; ++j)
671 Vmath::Vcopy(nq, normalsElmt[j], 1, tmp = normals[j] + offset, 1);
681 const int nPlanes =
m_planes.size();
682 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
687 traceMap->GetBndCondIDToGlobalTraceID();
688 int mapSize = traceBndMap.size();
693 int i, n, e, cnt = 0, cnt1 = 0;
698 int nPlaneExp = nExp / nPlanes;
706 for (n = 0; n < nPlanes; ++n)
708 const int offset = n * nTracePlane;
709 for (e = 0; e < nPlaneExp; ++e)
#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 SetUpDG()
Set up all DG member variables and maps.
void GetBCValues(Array< OneD, NekDouble > &BndVals, const Array< OneD, NekDouble > &TotField, int BndID)
This funtion extract form a vector containing a full 3D-homogenous-1D field the value associated with...
Array< OneD, int > m_traceBndMap
void NormVectorIProductWRTBase(Array< OneD, const NekDouble > &V1, Array< OneD, const NekDouble > &V2, Array< OneD, NekDouble > &outarray, int BndID)
This function calculate the inner product of two vectors (V1 and V2) respect to the basis along a bou...
Array< OneD, NekDouble > m_bndCondBndWeight
virtual void v_ExtractTracePhys(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
This method extracts the trace (edges in 2D) for each plane from the field inarray and puts the value...
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
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 std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
virtual ~DisContField3DHomogeneous1D()
Destructor.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble >> &normals)
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
std::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
virtual void 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)
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)
const Array< OneD, const MultiRegions::ExpListSharedPtr > & GetBndCondExpansions()
void GetBoundaryToElmtMap(Array< OneD, int > &ElmtID, Array< OneD, int > &EdgeID)
Set up a list of element ids and edge ids the link to the boundary conditions.
DisContField3DHomogeneous1D()
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
void HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
bool m_useFFT
FFT variables.
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 global list of m_coeffs correspoinding to element n.
int GetExpSize(void)
This function returns the number of elements in the expansion.
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
bool m_physState
The state of the array m_phys.
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
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 global list of m_phys correspoinding to element n.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
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.
const BoundaryConditionCollection & GetBoundaryConditions(void) const
const BoundaryRegionCollection & GetBoundaryRegions(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.
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< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
std::map< ConstFactorType, NekDouble > ConstFactorMap
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)