Nektar++
DisContField3DHomogeneous1D.cpp
Go to the documentation of this file.
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // File DisContField3DHomogeneous1D.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Field definition for 3D domain with boundary
32 // conditions using LDG flux and a 1D homogeneous direction
33 //
34 ///////////////////////////////////////////////////////////////////////////////
35 
36 #include <boost/core/ignore_unused.hpp>
37 
41 
42 
43 namespace Nektar
44 {
45  namespace MultiRegions
46  {
47 
50  m_bndCondExpansions(),
51  m_bndConditions()
52  {
53  }
54 
57  const LibUtilities::BasisKey &HomoBasis,
58  const NekDouble lhom,
59  const bool useFFT,
60  const bool dealiasing):
61  ExpList3DHomogeneous1D(pSession,HomoBasis,lhom,useFFT,dealiasing),
64  {
65  }
66 
69  const bool DeclarePlanesSetCoeffPhys)
70  : ExpList3DHomogeneous1D (In,false),
73  {
74  if (DeclarePlanesSetCoeffPhys)
75  {
76  DisContField2DSharedPtr zero_plane =
77  std::dynamic_pointer_cast<DisContField2D> (In.m_planes[0]);
78 
79  for(int n = 0; n < m_planes.num_elements(); ++n)
80  {
81  m_planes[n] =
83  AllocateSharedPtr(*zero_plane, false);
84  }
85 
86  SetCoeffPhys();
87  }
88  }
89 
92  const LibUtilities::BasisKey &HomoBasis,
93  const NekDouble lhom,
94  const bool useFFT,
95  const bool dealiasing,
97  const std::string &variable,
98  const Collections::ImplementationType ImpType):
99  ExpList3DHomogeneous1D(pSession, HomoBasis, lhom, useFFT,
100  dealiasing),
103  {
104  int i, n, nel;
105  DisContField2DSharedPtr plane_zero;
107 
108  // note that nzplanes can be larger than nzmodes
109  m_planes[0] = plane_zero = MemoryManager<DisContField2D>::
110  AllocateSharedPtr(pSession, graph2D, variable, true, false,
111  ImpType);
112 
115 
116  nel = m_planes[0]->GetExpSize();
117 
118  for (i = 0; i < nel; ++i)
119  {
120  (*m_exp).push_back(m_planes[0]->GetExp(i));
121  }
122 
123  for (n = 1; n < m_planes.num_elements(); ++n)
124  {
126  AllocateSharedPtr(*plane_zero, graph2D,
127  variable, true, false);
128  for(i = 0; i < nel; ++i)
129  {
130  (*m_exp).push_back((*m_exp)[i]);
131  }
132  }
133 
134  // Set up trace object.
135  Array<OneD, ExpListSharedPtr> trace(m_planes.num_elements());
136  for (n = 0; n < m_planes.num_elements(); ++n)
137  {
138  trace[n] = m_planes[n]->GetTrace();
139  }
140 
142  pSession, HomoBasis, lhom, useFFT,
143  dealiasing, trace);
144 
145  // Setup default optimisation information
146  nel = GetExpSize();
147 
149  AllocateSharedPtr(nel);
150 
151  SetCoeffPhys();
152 
153  // Do not set up BCs if default variable
154  if(variable.compare("DefaultVar") != 0)
155  {
156  SetupBoundaryConditions(HomoBasis, lhom, bcs, variable);
157  }
158 
159  SetUpDG();
160  }
161 
162  /**
163  * @brief Default destructor
164  */
166  {
167  }
168 
170  const LibUtilities::BasisKey &HomoBasis,
171  const NekDouble lhom,
173  const std::string variable)
174  {
175  int n, cnt = 0;
176 
177  // Setup an ExpList2DHomogeneous1D expansion for boundary
178  // conditions and link to class declared in m_planes
180  bcs.GetBoundaryRegions();
182  bcs.GetBoundaryConditions();
183 
185  bregions.size());
186  m_bndConditions = m_planes[0]->UpdateBndConditions();
187 
188  int nplanes = m_planes.num_elements();
190  PlanesBndCondExp(nplanes);
191 
192  for (auto &it : bregions)
193  {
194  SpatialDomains::BoundaryConditionShPtr boundaryCondition =
195  GetBoundaryCondition(bconditions, it.first, variable);
196  for (n = 0; n < nplanes; ++n)
197  {
198  PlanesBndCondExp[n] = m_planes[n]->
200  }
201 
202  // Initialise comm for the boundary regions
203  auto comm = boundaryCondition->GetComm();
204  int size = boundaryCondition->GetComm()->GetSize();
205 
206  if(size > 1)
207  {
208  // It seems to work either way
209  // comm->SplitComm(1,size);
210  comm->SplitComm(m_StripZcomm->GetSize(),
211  size/m_StripZcomm->GetSize());
212  }
213 
214  m_bndCondExpansions[cnt++] =
216  AllocateSharedPtr(m_session, HomoBasis, lhom,
217  m_useFFT, false,
218  PlanesBndCondExp, comm);
219  }
220  v_EvaluateBoundaryConditions(0.0, variable);
221  }
222 
224  const Array<OneD, const NekDouble> &inarray,
225  Array<OneD, NekDouble> &outarray,
226  const FlagList &flags,
227  const StdRegions::ConstFactorMap &factors,
228  const StdRegions::VarCoeffMap &varcoeff,
229  const MultiRegions::VarFactorsMap &varfactors,
230  const Array<OneD, const NekDouble> &dirForcing,
231  const bool PhysSpaceForcing)
232  {
233  int n;
234  int cnt = 0;
235  int cnt1 = 0;
236  NekDouble beta;
237  StdRegions::ConstFactorMap new_factors;
238 
240  Array<OneD, NekDouble> fce(inarray.num_elements());
242 
243  // Transform forcing function in half-physical space if required
244  if (m_WaveSpace)
245  {
246  fce = inarray;
247  }
248  else
249  {
250  HomogeneousFwdTrans(inarray,fce);
251  }
252 
253  for (n = 0; n < m_planes.num_elements(); ++n)
254  {
255  if (n != 1 || m_transposition->GetK(n) != 0)
256  {
257  beta = 2*M_PI*(m_transposition->GetK(n))/m_lhom;
258  new_factors = factors;
259  // add in Homogeneous Fourier direction and SVV if turned on
260  new_factors[StdRegions::eFactorLambda] +=
261  beta*beta*(1+GetSpecVanVisc(n));
262 
263  wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
264  m_planes[n]->HelmSolve(
265  wfce,
266  e_out = outarray + cnt1,
267  flags, new_factors, varcoeff, varfactors,
268  dirForcing,
269  PhysSpaceForcing);
270  }
271 
272  cnt += m_planes[n]->GetTotPoints();
273  cnt1 += m_planes[n]->GetNcoeffs();
274  }
275  }
276 
278  const NekDouble time,
279  const std::string varName,
280  const NekDouble x2_in,
281  const NekDouble x3_in)
282  {
283  boost::ignore_unused(x2_in,x3_in);
284  int i;
285  int npoints;
286  int nbnd = m_bndCondExpansions.num_elements();
288 
289  for (i = 0; i < nbnd; ++i)
290  {
291  if (time == 0.0 || m_bndConditions[i]->IsTimeDependent())
292  {
293  locExpList = m_bndCondExpansions[i];
294  npoints = locExpList->GetNpoints();
295 
296  Array<OneD, NekDouble> x0(npoints, 0.0);
297  Array<OneD, NekDouble> x1(npoints, 0.0);
298  Array<OneD, NekDouble> x2(npoints, 0.0);
299  Array<OneD, NekDouble> valuesFile(npoints, 1.0), valuesExp(npoints, 1.0);
300 
301  locExpList->GetCoords(x0, x1, x2);
302 
303  if (m_bndConditions[i]->GetBoundaryConditionType()
305  {
306  SpatialDomains::DirichletBCShPtr bcPtr = std::static_pointer_cast<
308  m_bndConditions[i]);
309  std::string filebcs = bcPtr->m_filename;
310  std::string exprbcs = bcPtr->m_expr;
311 
312  if (filebcs != "")
313  {
314  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
315  valuesFile = locExpList->GetPhys();
316  }
317 
318  if (exprbcs != "")
319  {
320  LibUtilities::Equation condition =
321  std::static_pointer_cast<SpatialDomains::
322  DirichletBoundaryCondition >(
323  m_bndConditions[i])->m_dirichletCondition;
324 
325  condition.Evaluate(x0, x1, x2, time, valuesExp);
326  }
327 
328  Vmath::Vmul(npoints, valuesExp, 1, valuesFile, 1,
329  locExpList->UpdatePhys(), 1);
330 
331  // set wave space to false since have set up phys values
332  locExpList->SetWaveSpace(false);
333 
334  locExpList->FwdTrans_BndConstrained(
335  locExpList->GetPhys(),
336  locExpList->UpdateCoeffs());
337  }
338  else if (m_bndConditions[i]->GetBoundaryConditionType()
340  {
341  SpatialDomains::NeumannBCShPtr bcPtr = std::static_pointer_cast<
343  m_bndConditions[i]);
344 
345  std::string filebcs = bcPtr->m_filename;
346 
347  if (filebcs != "")
348  {
349  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
350  }
351  else
352  {
353  LibUtilities::Equation condition = std::
354  static_pointer_cast<SpatialDomains::
355  NeumannBoundaryCondition>(
356  m_bndConditions[i])->m_neumannCondition;
357 
358  condition.Evaluate(x0, x1, x2, time,
359  locExpList->UpdatePhys());
360 
361  locExpList->IProductWRTBase(locExpList->GetPhys(),
362  locExpList->UpdateCoeffs());
363  }
364  }
365  else if (m_bndConditions[i]->GetBoundaryConditionType()
367  {
368  SpatialDomains::RobinBCShPtr bcPtr = std::static_pointer_cast<
370  m_bndConditions[i]);
371  std::string filebcs = bcPtr->m_filename;
372 
373  if (filebcs != "")
374  {
375  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
376  }
377  else
378  {
379  LibUtilities::Equation condition = std::
380  static_pointer_cast<SpatialDomains::
381  RobinBoundaryCondition>(
382  m_bndConditions[i])->m_robinFunction;
383 
384  condition.Evaluate(x0, x1, x2, time,
385  locExpList->UpdatePhys());
386 
387  }
388 
389  locExpList->IProductWRTBase(locExpList->GetPhys(),
390  locExpList->UpdateCoeffs());
391 
392  }
393  else if (m_bndConditions[i]->GetBoundaryConditionType()
395  {
396  continue;
397  }
398  else
399  {
400  ASSERTL0(false, "This type of BC not implemented yet");
401  }
402  }
403  }
404  }
405 
406  std::shared_ptr<ExpList> &DisContField3DHomogeneous1D::
408  {
409  return UpdateBndCondExpansion(i);
410  }
411 
414  {
415  return UpdateBndConditions();
416  }
417 
419  Array<OneD, int> &ElmtID,
420  Array<OneD,int> &EdgeID)
421  {
422 
423  if(m_BCtoElmMap.num_elements() == 0)
424  {
425  Array<OneD, int> ElmtID_tmp;
426  Array<OneD, int> EdgeID_tmp;
427 
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();
431 
432  int MapSize = ElmtID_tmp.num_elements();
433 
434  m_BCtoElmMap = Array<OneD, int>(nplanes*MapSize);
435  m_BCtoEdgMap = Array<OneD, int>(nplanes*MapSize);
436 
437  // If this mesh (or partition) has no BCs, skip this step
438  if (MapSize > 0)
439  {
440  int i ,j, n, cnt;
441  int cntPlane = 0;
442  for (cnt=n=0; n < m_bndCondExpansions.num_elements(); ++n)
443  {
444  int planeExpSize = m_planes[0]
445  ->GetBndCondExpansions()[n]
446  ->GetExpSize();
447  for (i = 0; i < planeExpSize ; ++i, ++cntPlane)
448  {
449  for(j = 0; j < nplanes; j++)
450  {
451  m_BCtoElmMap[cnt+i+j*planeExpSize] =
452  ElmtID_tmp[cntPlane]+j*nel_per_plane;
453  m_BCtoEdgMap[cnt+i+j*planeExpSize] =
454  EdgeID_tmp[cntPlane];
455  }
456  }
457  cnt += m_bndCondExpansions[n]->GetExpSize();
458  }
459  }
460  }
461  ElmtID = m_BCtoElmMap;
462  EdgeID = m_BCtoEdgMap;
463  }
464 
466  std::shared_ptr<ExpList> &result,
467  const bool DeclareCoeffPhysArrays)
468  {
469  int n, cnt, nq;
470  int offsetOld, offsetNew;
471 
472  std::vector<unsigned int> eIDs;
473  Array<OneD, int> ElmtID,EdgeID;
474  GetBoundaryToElmtMap(ElmtID,EdgeID);
475 
476  // Skip other boundary regions
477  for (cnt = n = 0; n < i; ++n)
478  {
479  cnt += m_bndCondExpansions[n]->GetExpSize();
480  }
481 
482  // Populate eIDs with information from BoundaryToElmtMap
483  for (n = 0; n < m_bndCondExpansions[i]->GetExpSize(); ++n)
484  {
485  eIDs.push_back(ElmtID[cnt+n]);
486  }
487 
488  // Create expansion list
489  result =
491  (*this, eIDs);
492 
493  // Copy phys and coeffs to new explist
494  if ( DeclareCoeffPhysArrays)
495  {
496  Array<OneD, NekDouble> tmp1, tmp2;
497  for (n = 0; n < result->GetExpSize(); ++n)
498  {
499  nq = GetExp(ElmtID[cnt+n])->GetTotPoints();
500  offsetOld = GetPhys_Offset(ElmtID[cnt+n]);
501  offsetNew = result->GetPhys_Offset(n);
502  Vmath::Vcopy(nq, tmp1 = GetPhys()+ offsetOld, 1,
503  tmp2 = result->UpdatePhys()+ offsetNew, 1);
504 
505  nq = GetExp(ElmtID[cnt+n])->GetNcoeffs();
506  offsetOld = GetCoeff_Offset(ElmtID[cnt+n]);
507  offsetNew = result->GetCoeff_Offset(n);
508  Vmath::Vcopy(nq, tmp1 = GetCoeffs()+ offsetOld, 1,
509  tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
510  }
511  }
512 
513  // Set wavespace value
514  result->SetWaveSpace(GetWaveSpace());
515  }
516 
518  const Array<OneD, NekDouble> & TotField,
519  int BndID )
520  {
523 
525  Array<OneD, NekDouble> tmp_BC;
526 
527  int cnt = 0;
528  int pos = 0;
529  int exp_size, exp_size_per_plane, elmtID, boundaryID;
530  int offset, exp_dim;
531 
532  for (int k = 0; k < m_planes.num_elements(); k++)
533  {
534  for (int n = 0; n < m_bndConditions.num_elements(); ++n)
535  {
536  exp_size = m_bndCondExpansions[n]->GetExpSize();
537  exp_size_per_plane = exp_size/m_planes.num_elements();
538 
539  for (int i = 0; i < exp_size_per_plane; i++)
540  {
541  if(n == BndID)
542  {
543  elmtID = m_BCtoElmMap[cnt];
544  boundaryID = m_BCtoEdgMap[cnt];
545  exp_dim = m_bndCondExpansions[n]->
546  GetExp(i+k*exp_size_per_plane)->GetTotPoints();
547  offset = GetPhys_Offset(elmtID);
548  elmt = GetExp(elmtID);
549  temp_BC_exp = std::dynamic_pointer_cast<
551  m_bndCondExpansions[n]->GetExp(
552  i + k * exp_size_per_plane )
553  );
554 
555  elmt->GetEdgePhysVals(boundaryID, temp_BC_exp,
556  tmp_Tot = TotField + offset,
557  tmp_BC = BndVals + pos);
558  pos += exp_dim;
559  }
560  cnt++;
561  }
562  }
563  }
564  }
565 
569  Array<OneD, NekDouble> &outarray,
570  int BndID)
571  {
574 
575  Array<OneD, NekDouble> tmp_V1;
576  Array<OneD, NekDouble> tmp_V2;
577  Array<OneD, NekDouble> tmp_outarray;
578 
579  int cnt = 0;
580  int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
581 
582  for(int k = 0; k < m_planes.num_elements(); k++)
583  {
584  for(int n = 0; n < m_bndConditions.num_elements(); ++n)
585  {
586  exp_size = m_bndCondExpansions[n]->GetExpSize();
587  exp_size_per_plane = exp_size/m_planes.num_elements();
588 
589  for(int i = 0; i < exp_size_per_plane; i++)
590  {
591  if(n == BndID)
592  {
593  elmtID = m_BCtoElmMap[cnt];
594 
595  Phys_offset = m_bndCondExpansions[n]->
596  GetPhys_Offset(i+k*exp_size_per_plane);
597  Coef_offset = m_bndCondExpansions[n]->
598  GetCoeff_Offset(i+k*exp_size_per_plane);
599 
600  elmt = GetExp(elmtID);
601  temp_BC_exp = std::dynamic_pointer_cast<
603  m_bndCondExpansions[n]->GetExp(
604  i + k * exp_size_per_plane )
605  );
606 
607  temp_BC_exp->NormVectorIProductWRTBase(
608  tmp_V1 = V1 + Phys_offset,
609  tmp_V2 = V2 + Phys_offset,
610  tmp_outarray = outarray + Coef_offset);
611  }
612  cnt++;
613  }
614  }
615  }
616  }
617 
619  Array<OneD, NekDouble> &outarray)
620  {
621  ASSERTL1(m_physState == true,
622  "Field must be in physical state to extract trace space.");
623 
624  v_ExtractTracePhys(m_phys, outarray);
625  }
626 
627  /**
628  * @brief This method extracts the trace (edges in 2D) for each plane
629  * from the field @a inarray and puts the values in @a outarray.
630  *
631  * It assumes the field is C0 continuous so that it can overwrite the
632  * edge data when visited by the two adjacent elements.
633  *
634  * @param inarray An array containing the 2D data from which we wish
635  * to extract the edge data.
636  * @param outarray The resulting edge information.
637  */
639  const Array<OneD, const NekDouble> &inarray,
640  Array<OneD, NekDouble> &outarray)
641  {
642  int nPoints_plane = m_planes[0]->GetTotPoints();
643  int nTracePts = m_planes[0]->GetTrace()->GetTotPoints();
644 
645  for (int i = 0; i < m_planes.num_elements(); ++i)
646  {
647  Array<OneD, NekDouble> inarray_plane(nPoints_plane, 0.0);
648  Array<OneD, NekDouble> outarray_plane(nPoints_plane, 0.0);
649 
650  Vmath::Vcopy(nPoints_plane,
651  &inarray[i*nPoints_plane], 1,
652  &inarray_plane[0], 1);
653 
654  m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
655 
656  Vmath::Vcopy(nTracePts,
657  &outarray_plane[0], 1,
658  &outarray[i*nTracePts], 1);
659  }
660  }
661 
662  /**
663  */
665  Array<OneD, Array<OneD, NekDouble> > & normals )
666  {
667  int expdim = GetCoordim(0);
668  int coordim = 3;
671 
672  Array<OneD, int> ElmtID,EdgeID;
673  GetBoundaryToElmtMap(ElmtID,EdgeID);
674 
675  // Initialise result
676  normals = Array<OneD, Array<OneD, NekDouble> > (coordim);
677  for (int j = 0; j < coordim; ++j)
678  {
679  normals[j] = Array<OneD, NekDouble> ( GetBndCondExpansions()[i]->GetTotPoints(), 0.0 );
680  }
681 
682  // Skip other boundary regions
683  int cnt = 0;
684  for( int n = 0; n < i; ++n )
685  {
686  cnt += GetBndCondExpansions()[n]->GetExpSize();
687  }
688 
689  int offset;
690  for( int n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n )
691  {
692  offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
693  int nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
694 
695  elmt = GetExp(ElmtID[cnt+n]);
696  const Array<OneD, const Array<OneD, NekDouble> > normalsElmt
697  = elmt->GetSurfaceNormal(EdgeID[cnt+n]);
698  // Copy to result
699  for (int j = 0; j < expdim; ++j)
700  {
701  Vmath::Vcopy(nq, normalsElmt[j], 1,
702  tmp = normals[j] + offset, 1);
703  }
704  }
705  }
706 
707  /**
708  * @brief Set up all DG member variables and maps.
709  */
711  {
712  const int nPlanes = m_planes.num_elements();
713  const int nTracePlane = m_planes[0]->GetTrace()->GetExpSize();
714 
715  // Get trace map from first plane.
716  AssemblyMapDGSharedPtr traceMap = m_planes[0]->GetTraceMap();
717  const Array<OneD, const int> &traceBndMap
718  = traceMap->GetBndCondTraceToGlobalTraceMap();
719  int mapSize = traceBndMap.num_elements();
720 
721  // Set up trace boundary map
722  m_traceBndMap = Array<OneD, int>(nPlanes * mapSize);
723 
724  int i, n, e, cnt = 0, cnt1 = 0;
725 
726  for (i = 0; i < m_bndCondExpansions.num_elements(); ++i)
727  {
728  int nExp = m_bndCondExpansions[i]->GetExpSize();
729  int nPlaneExp = nExp / nPlanes;
730 
731  if (m_bndConditions[i]->GetBoundaryConditionType() ==
733  {
734  continue;
735  }
736 
737  for (n = 0; n < nPlanes; ++n)
738  {
739  const int offset = n * nTracePlane;
740  for (e = 0; e < nPlaneExp; ++e)
741  {
742  m_traceBndMap[cnt++] = offset + traceBndMap[cnt1+e];
743  }
744  }
745 
746  cnt1 += nPlaneExp;
747  }
748  }
749  } // end of namespace
750 } //end of namespace
const Array< OneD, const NekDouble > & GetPhys() const
This function returns (a reference to) the array (implemented as m_phys) containing the function ev...
Definition: ExpList.h:2161
std::shared_ptr< DisContField2D > DisContField2DSharedPtr
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
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.
Definition: ExpList.h:1090
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
NekOptimize::GlobalOptParamSharedPtr m_globalOptParam
Definition: ExpList.h:1106
LibUtilities::TranspositionSharedPtr m_transposition
void SetUpDG()
Set up all DG member variables and maps.
const BoundaryConditionCollection & GetBoundaryConditions(void) const
Definition: Conditions.h:248
const Array< OneD, const NekDouble > & GetCoeffs() const
This function returns (a reference to) the array (implemented as m_coeffs) containing all local expa...
Definition: ExpList.h:2062
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:741
std::shared_ptr< NeumannBoundaryCondition > NeumannBCShPtr
Definition: Conditions.h:221
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
Definition: StdRegions.hpp:294
NekDouble m_lhom
Width of homogeneous direction.
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1069
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2170
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2191
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...
Definition: ExpList.h:1657
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
Definition: Conditions.h:222
void SetCoeffPhys(void)
Definition of the total number of degrees of freedom and quadrature points. Sets up the storage for m...
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:264
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1078
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:217
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.
Definition: ExpList.h:1023
Array< OneD, ExpListSharedPtr > m_planes
NekDouble Evaluate() const
Definition: Equation.cpp:95
double NekDouble
Defines a list of flags.
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
Definition: Conditions.h:226
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
Definition: ExpList.cpp:2095
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
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
Definition: Expansion.h:65
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...
Definition: StdExpansion.h:874
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
Definition: Conditions.h:220
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:3261
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:48
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:2013
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...
Definition: ExpList.h:2200
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:250
int GetPhys_Offset(int n) const
Get the start offset position for a global list of m_phys correspoinding to element n...
Definition: ExpList.h:2208
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1064
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:51
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Describes the specification for a Basis.
Definition: Basis.h:49
std::shared_ptr< SessionReader > SessionReaderSharedPtr
const BoundaryRegionCollection & GetBoundaryRegions(void) const
Definition: Conditions.h:238
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.
Definition: Vmath.cpp:186
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