44 namespace MultiRegions
49 m_bndCondExpansions(),
59 const bool dealiasing)
61 m_bndCondExpansions(),
68 const bool DeclarePlanesSetCoeffPhys)
70 m_bndCondExpansions (In.m_bndCondExpansions),
71 m_bndConditions (In.m_bndConditions)
73 if (DeclarePlanesSetCoeffPhys)
78 for(
int n = 0; n <
m_planes.num_elements(); ++n)
94 const bool dealiasing,
96 const std::string &variable)
99 m_bndCondExpansions(),
115 for (i = 0; i < nel; ++i)
120 for (n = 1; n <
m_planes.num_elements(); ++n)
124 variable,
true,
false);
125 for(i = 0; i < nel; ++i)
127 (*m_exp).push_back((*
m_exp)[i]);
133 for (n = 0; n <
m_planes.num_elements(); ++n)
139 pSession, HomoBasis, lhom, useFFT, dealiasing, trace);
150 if(variable.compare(
"DefaultVar") != 0)
169 const std::string variable)
179 SpatialDomains::BoundaryRegionCollection::const_iterator it;
183 for (it = bregions.begin(); it != bregions.end(); ++it)
187 if (boundaryCondition->GetBoundaryConditionType()
198 int nplanes =
m_planes.num_elements();
200 PlanesBndCondExp(nplanes);
203 for (it = bregions.begin(); it != bregions.end(); ++it)
207 if(boundaryCondition->GetBoundaryConditionType() !=
210 for (n = 0; n < nplanes; ++n)
228 const std::string varName)
234 for (n = 0; n <
m_planes.num_elements(); n++)
239 for (n = 0; n <
m_planes.num_elements(); ++n)
241 m_planes[n]->EvaluateBoundaryConditions(
242 time, varName, 0.5*
m_lhom*(1.0+local_z[n]));
270 const bool PhysSpaceForcing)
292 for (n = 0; n <
m_planes.num_elements(); ++n)
297 new_factors = factors;
302 wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
305 e_out = outarray + cnt1,
306 flags, new_factors, varcoeff, dirForcing,
317 const std::string varName,
346 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
347 int nel_per_plane =
m_planes[0]->GetExpSize();
348 int nplanes =
m_planes.num_elements();
350 int MapSize = ElmtID_tmp.num_elements();
363 ->GetBndCondExpansions()[n]
365 for (i = 0; i < planeExpSize ; ++i, ++cntPlane)
367 for(j = 0; j < nplanes; j++)
370 ElmtID_tmp[cntPlane]+j*nel_per_plane;
371 m_BCtoEdgMap[cnt+i+j*planeExpSize] =
372 EdgeID_tmp[cntPlane];
384 boost::shared_ptr<ExpList> &result,
385 const bool DeclareCoeffPhysArrays)
388 int offsetOld, offsetNew;
390 std::vector<unsigned int> eIDs;
395 for (cnt = n = 0; n < i; ++n)
403 eIDs.push_back(ElmtID[cnt+n]);
412 if ( DeclareCoeffPhysArrays)
415 for (n = 0; n < result->GetExpSize(); ++n)
417 nq =
GetExp(ElmtID[cnt+n])->GetTotPoints();
419 offsetNew = result->GetPhys_Offset(n);
421 tmp2 = result->UpdatePhys()+ offsetNew, 1);
423 nq =
GetExp(ElmtID[cnt+n])->GetNcoeffs();
425 offsetNew = result->GetCoeff_Offset(n);
427 tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
448 int exp_size, exp_size_per_plane, elmtID, boundaryID;
451 for (
int k = 0; k <
m_planes.num_elements(); k++)
456 exp_size_per_plane = exp_size/
m_planes.num_elements();
458 for (
int i = 0; i < exp_size_per_plane; i++)
465 GetExp(i+k*exp_size_per_plane)->GetTotPoints();
468 temp_BC_exp = boost::dynamic_pointer_cast<
471 i+k*exp_size_per_plane));
474 tmp_Tot = TotField + offset,
475 tmp_BC = BndVals + pos);
498 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
500 for(
int k = 0; k <
m_planes.num_elements(); k++)
505 exp_size_per_plane = exp_size/
m_planes.num_elements();
507 for(
int i = 0; i < exp_size_per_plane; i++)
519 temp_BC_exp = boost::dynamic_pointer_cast<
522 i+k*exp_size_per_plane));
525 tmp_V1 = V1 + Phys_offset,
526 tmp_V2 = V2 + Phys_offset,
527 tmp_outarray = outarray + Coef_offset);
539 "Field must be in physical state to extract trace space.");
559 int nPoints_plane =
m_planes[0]->GetTotPoints();
560 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
562 for (
int i = 0; i <
m_planes.num_elements(); ++i)
568 &inarray[i*nPoints_plane], 1,
569 &inarray_plane[0], 1);
571 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
574 &outarray_plane[0], 1,
575 &outarray[i*nTracePts], 1);
595 for (j = 0; j < coordim; ++j)
602 for (cnt = n = 0; n < i; ++n)
613 elmt =
GetExp(ElmtID[cnt+n]);
615 = elmt->GetSurfaceNormal(EdgeID[cnt+n]);
617 for (j = 0; j < expdim; ++j)
620 tmp = normals[j] + offset, 1);
630 const int nPlanes =
m_planes.num_elements();
631 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
636 = traceMap->GetBndCondTraceToGlobalTraceMap();
637 int mapSize = traceBndMap.num_elements();
642 int i, n, e, cnt = 0, cnt1 = 0;
647 int nPlaneExp = nExp / nPlanes;
649 for (n = 0; n < nPlanes; ++n)
651 const int offset = n * nTracePlane;
652 for (e = 0; e < nPlaneExp; ++e)
boost::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
int GetCoeff_Offset(int n) const
Get the start offset position for a global list of m_coeffs correspoinding to element n...
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
virtual ~DisContField3DHomogeneous1D()
Destructor.
LibUtilities::TranspositionSharedPtr m_transposition
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Array< OneD, int > m_BCtoEdgMap
const BoundaryConditionCollection & GetBoundaryConditions(void) const
Array< OneD, NekDouble > & UpdateCoeffs()
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
void SetUpDG()
Set up all DG member variables and maps.
boost::shared_ptr< ExpList > & UpdateBndCondExpansion(int i)
const boost::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
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.
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
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.
virtual void v_GetBndElmtExpansion(int i, boost::shared_ptr< ExpList > &result, const bool DeclareCoeffPhysArrays)
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
LibUtilities::BasisSharedPtr m_homogeneousBasis
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()
virtual boost::shared_ptr< ExpList > & v_UpdateBndCondExpansion(int i)
boost::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
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)
boost::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
boost::shared_ptr< DisContField2D > DisContField2DSharedPtr
boost::shared_ptr< StdExpansion1D > StdExpansion1DSharedPtr
LibUtilities::SessionReaderSharedPtr m_session
Session.
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 Array< OneD, const NekDouble > &dirForcing, const bool PhysSpaceForcing)
Array< OneD, ExpListSharedPtr > m_planes
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
Array< OneD, int > m_traceBndMap
void SetupBoundaryConditions(const LibUtilities::BasisKey &HomoBasis, const NekDouble lhom, SpatialDomains::BoundaryConditions &bcs, const std::string variable)
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
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.
bool m_useFFT
FFT variables.
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
const BoundaryRegionCollection & GetBoundaryRegions(void) const
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
boost::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
void EvaluateBoundaryConditions(const NekDouble time=0.0, const std::string varName="")
This function evaluates the boundary conditions at a certaintime-level.
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Describes the specification for a Basis.
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...