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,
100 m_bndCondExpansions(),
117 for (i = 0; i < nel; ++i)
122 for (n = 1; n <
m_planes.num_elements(); ++n)
126 variable,
true,
false);
127 for(i = 0; i < nel; ++i)
129 (*m_exp).push_back((*
m_exp)[i]);
135 for (n = 0; n <
m_planes.num_elements(); ++n)
141 pSession, HomoBasis, lhom, useFFT,
153 if(variable.compare(
"DefaultVar") != 0)
172 const std::string variable)
182 SpatialDomains::BoundaryRegionCollection::const_iterator it;
186 for (it = bregions.begin(); it != bregions.end(); ++it)
190 if (boundaryCondition->GetBoundaryConditionType()
201 int nplanes =
m_planes.num_elements();
203 PlanesBndCondExp(nplanes);
206 for (it = bregions.begin(); it != bregions.end(); ++it)
210 if(boundaryCondition->GetBoundaryConditionType() !=
213 for (n = 0; n < nplanes; ++n)
231 const std::string varName)
237 for (n = 0; n <
m_planes.num_elements(); n++)
242 for (n = 0; n <
m_planes.num_elements(); ++n)
244 m_planes[n]->EvaluateBoundaryConditions(
245 time, varName, 0.5*
m_lhom*(1.0+local_z[n]));
271 const bool PhysSpaceForcing)
293 for (n = 0; n <
m_planes.num_elements(); ++n)
298 new_factors = factors;
303 wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
306 e_out = outarray + cnt1,
307 flags, new_factors, varcoeff, dirForcing,
318 const std::string varName,
347 m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
348 int nel_per_plane =
m_planes[0]->GetExpSize();
349 int nplanes =
m_planes.num_elements();
351 int MapSize = ElmtID_tmp.num_elements();
364 ->GetBndCondExpansions()[n]
366 for (i = 0; i < planeExpSize ; ++i, ++cntPlane)
368 for(j = 0; j < nplanes; j++)
371 ElmtID_tmp[cntPlane]+j*nel_per_plane;
372 m_BCtoEdgMap[cnt+i+j*planeExpSize] =
373 EdgeID_tmp[cntPlane];
385 boost::shared_ptr<ExpList> &result,
386 const bool DeclareCoeffPhysArrays)
389 int offsetOld, offsetNew;
391 std::vector<unsigned int> eIDs;
396 for (cnt = n = 0; n < i; ++n)
404 eIDs.push_back(ElmtID[cnt+n]);
413 if ( DeclareCoeffPhysArrays)
416 for (n = 0; n < result->GetExpSize(); ++n)
418 nq =
GetExp(ElmtID[cnt+n])->GetTotPoints();
420 offsetNew = result->GetPhys_Offset(n);
422 tmp2 = result->UpdatePhys()+ offsetNew, 1);
424 nq =
GetExp(ElmtID[cnt+n])->GetNcoeffs();
426 offsetNew = result->GetCoeff_Offset(n);
428 tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
449 int exp_size, exp_size_per_plane, elmtID, boundaryID;
452 for (
int k = 0; k <
m_planes.num_elements(); k++)
457 exp_size_per_plane = exp_size/
m_planes.num_elements();
459 for (
int i = 0; i < exp_size_per_plane; i++)
466 GetExp(i+k*exp_size_per_plane)->GetTotPoints();
469 temp_BC_exp = boost::dynamic_pointer_cast<
472 i+k*exp_size_per_plane));
475 tmp_Tot = TotField + offset,
476 tmp_BC = BndVals + pos);
499 int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
501 for(
int k = 0; k <
m_planes.num_elements(); k++)
506 exp_size_per_plane = exp_size/
m_planes.num_elements();
508 for(
int i = 0; i < exp_size_per_plane; i++)
520 temp_BC_exp = boost::dynamic_pointer_cast<
523 i+k*exp_size_per_plane));
526 tmp_V1 = V1 + Phys_offset,
527 tmp_V2 = V2 + Phys_offset,
528 tmp_outarray = outarray + Coef_offset);
540 "Field must be in physical state to extract trace space.");
560 int nPoints_plane =
m_planes[0]->GetTotPoints();
561 int nTracePts =
m_planes[0]->GetTrace()->GetTotPoints();
563 for (
int i = 0; i <
m_planes.num_elements(); ++i)
569 &inarray[i*nPoints_plane], 1,
570 &inarray_plane[0], 1);
572 m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
575 &outarray_plane[0], 1,
576 &outarray[i*nTracePts], 1);
596 for (j = 0; j < coordim; ++j)
603 for (cnt = n = 0; n < i; ++n)
614 elmt =
GetExp(ElmtID[cnt+n]);
616 = elmt->GetSurfaceNormal(EdgeID[cnt+n]);
618 for (j = 0; j < expdim; ++j)
621 tmp = normals[j] + offset, 1);
631 const int nPlanes =
m_planes.num_elements();
632 const int nTracePlane =
m_planes[0]->GetTrace()->GetExpSize();
637 = traceMap->GetBndCondTraceToGlobalTraceMap();
638 int mapSize = traceBndMap.num_elements();
643 int i, n, e, cnt = 0, cnt1 = 0;
648 int nPlaneExp = nExp / nPlanes;
650 for (n = 0; n < nPlanes; ++n)
652 const int offset = n * nTracePlane;
653 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...