36 #include <boost/core/ignore_unused.hpp> 45 namespace MultiRegions
50 m_bndCondExpansions(),
60 const bool dealiasing):
69 const bool DeclarePlanesSetCoeffPhys)
74 if (DeclarePlanesSetCoeffPhys)
79 for(
int n = 0; n <
m_planes.num_elements(); ++n)
95 const bool dealiasing,
97 const std::string &variable,
118 for (i = 0; i < nel; ++i)
123 for (n = 1; n <
m_planes.num_elements(); ++n)
127 variable,
true,
false);
128 for(i = 0; i < nel; ++i)
130 (*m_exp).push_back((*
m_exp)[i]);
136 for (n = 0; n <
m_planes.num_elements(); ++n)
142 pSession, HomoBasis, lhom, useFFT,
154 if(variable.compare(
"DefaultVar") != 0)
173 const std::string variable)
188 int nplanes =
m_planes.num_elements();
190 PlanesBndCondExp(nplanes);
192 for (
auto &it : bregions)
196 for (n = 0; n < nplanes; ++n)
203 auto comm = boundaryCondition->GetComm();
204 int size = boundaryCondition->GetComm()->GetSize();
218 PlanesBndCondExp, comm);
231 const bool PhysSpaceForcing)
253 for (n = 0; n <
m_planes.num_elements(); ++n)
258 new_factors = factors;
263 wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
266 e_out = outarray + cnt1,
267 flags, new_factors, varcoeff, varfactors,
279 const std::string varName,
283 boost::ignore_unused(x2_in,x3_in);
289 for (i = 0; i < nbnd; ++i)
294 npoints = locExpList->GetNpoints();
301 locExpList->GetCoords(x0, x1, x2);
310 std::string exprbcs = bcPtr->m_expr;
315 valuesFile = locExpList->GetPhys();
321 std::static_pointer_cast<SpatialDomains::
322 DirichletBoundaryCondition >(
325 condition.
Evaluate(x0, x1, x2, time, valuesExp);
329 locExpList->UpdatePhys(), 1);
332 locExpList->SetWaveSpace(
false);
334 locExpList->FwdTrans_BndConstrained(
335 locExpList->GetPhys(),
336 locExpList->UpdateCoeffs());
354 static_pointer_cast<SpatialDomains::
355 NeumannBoundaryCondition>(
358 condition.
Evaluate(x0, x1, x2, time,
359 locExpList->UpdatePhys());
361 locExpList->IProductWRTBase(locExpList->GetPhys(),
362 locExpList->UpdateCoeffs());
380 static_pointer_cast<SpatialDomains::
381 RobinBoundaryCondition>(
384 condition.
Evaluate(x0, x1, x2, time,
385 locExpList->UpdatePhys());
389 locExpList->IProductWRTBase(locExpList->GetPhys(),
390 locExpList->UpdateCoeffs());
400 ASSERTL0(
false,
"This type of BC not implemented yet");
428 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
429 int nel_per_plane =
m_planes[0]->GetExpSize();
430 int nplanes =
m_planes.num_elements();
432 int MapSize = ElmtID_tmp.num_elements();
445 ->GetBndCondExpansions()[n]
447 for (i = 0; i < planeExpSize ; ++i, ++cntPlane)
449 for(j = 0; j < nplanes; j++)
452 ElmtID_tmp[cntPlane]+j*nel_per_plane;
453 m_BCtoEdgMap[cnt+i+j*planeExpSize] =
454 EdgeID_tmp[cntPlane];
466 std::shared_ptr<ExpList> &result,
467 const bool DeclareCoeffPhysArrays)
470 int offsetOld, offsetNew;
472 std::vector<unsigned int> eIDs;
477 for (cnt = n = 0; n < i; ++n)
485 eIDs.push_back(ElmtID[cnt+n]);
494 if ( DeclareCoeffPhysArrays)
497 for (n = 0; n < result->GetExpSize(); ++n)
499 nq =
GetExp(ElmtID[cnt+n])->GetTotPoints();
501 offsetNew = result->GetPhys_Offset(n);
503 tmp2 = result->UpdatePhys()+ offsetNew, 1);
505 nq =
GetExp(ElmtID[cnt+n])->GetNcoeffs();
507 offsetNew = result->GetCoeff_Offset(n);
509 tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
529 int exp_size, exp_size_per_plane, elmtID, boundaryID;
532 for (
int k = 0; k <
m_planes.num_elements(); k++)
537 exp_size_per_plane = exp_size/
m_planes.num_elements();
539 for (
int i = 0; i < exp_size_per_plane; i++)
546 GetExp(i+k*exp_size_per_plane)->GetTotPoints();
549 temp_BC_exp = std::dynamic_pointer_cast<
552 i + k * exp_size_per_plane )
556 tmp_Tot = TotField + offset,
557 tmp_BC = BndVals + pos);
580 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
582 for(
int k = 0; k <
m_planes.num_elements(); k++)
587 exp_size_per_plane = exp_size/
m_planes.num_elements();
589 for(
int i = 0; i < exp_size_per_plane; i++)
601 temp_BC_exp = std::dynamic_pointer_cast<
604 i + k * exp_size_per_plane )
608 tmp_V1 = V1 + Phys_offset,
609 tmp_V2 = V2 + Phys_offset,
610 tmp_outarray = outarray + Coef_offset);
622 "Field must be in physical state to extract trace space.");
642 int nPoints_plane =
m_planes[0]->GetTotPoints();
643 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
645 for (
int i = 0; i <
m_planes.num_elements(); ++i)
651 &inarray[i*nPoints_plane], 1,
652 &inarray_plane[0], 1);
654 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
657 &outarray_plane[0], 1,
658 &outarray[i*nTracePts], 1);
677 for (
int j = 0; j < coordim; ++j)
684 for(
int n = 0; n < i; ++n )
695 elmt =
GetExp(ElmtID[cnt+n]);
697 = elmt->GetSurfaceNormal(EdgeID[cnt+n]);
699 for (
int j = 0; j < expdim; ++j)
702 tmp = normals[j] + offset, 1);
712 const int nPlanes =
m_planes.num_elements();
713 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
718 = traceMap->GetBndCondTraceToGlobalTraceMap();
719 int mapSize = traceBndMap.num_elements();
724 int i, n, e, cnt = 0, cnt1 = 0;
729 int nPlaneExp = nExp / nPlanes;
737 for (n = 0; n < nPlanes; ++n)
739 const int offset = n * nTracePlane;
740 for (e = 0; e < nPlaneExp; ++e)
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
std::shared_ptr< DisContField2D > DisContField2DSharedPtr
#define ASSERTL0(condition, msg)
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
virtual void v_GetBndElmtExpansion(int i, std::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
virtual ~DisContField3DHomogeneous1D()
Destructor.
LibUtilities::TranspositionSharedPtr m_transposition
Array< OneD, int > m_BCtoEdgMap
void SetUpDG()
Set up all DG member variables and maps.
std::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
const BoundaryConditionCollection & GetBoundaryConditions(void) const
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
std::shared_ptr< NeumannBoundaryCondition > NeumannBCShPtr
Array< OneD, int > m_BCtoElmMap
Storage space for the boundary to element and boundary to trace map. This member variable is really a...
std::map< ConstFactorType, NekDouble > ConstFactorMap
NekDouble m_lhom
Width of homogeneous direction.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
NekDouble GetSpecVanVisc(const int k)
int GetExpSize(void)
This function returns the number of elements in the expansion.
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
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...
Array< OneD, MultiRegions::ExpListSharedPtr > m_bndCondExpansions
An object which contains the discretised boundary conditions.
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
DisContField3DHomogeneous1D()
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
bool m_physState
The state of the array m_phys.
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
virtual void v_HelmSolve(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, const FlagList &flags, const StdRegions::ConstFactorMap &factors, const StdRegions::VarCoeffMap &varcoeff, const MultiRegions::VarFactorsMap &varfactors, const Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
LibUtilities::SessionReaderSharedPtr m_session
Session.
Array< OneD, ExpListSharedPtr > m_planes
NekDouble Evaluate() const
void HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, CoeffState coeffstate=eLocal, bool Shuff=true, bool UnShuff=true)
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
Array< OneD, int > m_traceBndMap
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
void SetupBoundaryConditions(const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom, SpatialDomains::BoundaryConditions &bcs, const std::string variable)
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
std::shared_ptr< Expansion > ExpansionSharedPtr
const Array< OneD, const MultiRegions::ExpListSharedPtr > & GetBndCondExpansions()
void GetEdgePhysVals(const int edge, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray)
Extract the physical values along edge edge from inarray into outarray following the local edge orien...
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)
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...
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...
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.
std::shared_ptr< DirichletBoundaryCondition > DirichletBCShPtr
LibUtilities::CommSharedPtr m_StripZcomm
bool m_useFFT
FFT variables.
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
virtual std::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Describes the specification for a Basis.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
const BoundaryRegionCollection & GetBoundaryRegions(void) const
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.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap