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 
42 
43 
44 namespace Nektar
45 {
46  namespace MultiRegions
47  {
48 
51  m_bndCondExpansions(),
52  m_bndCondBndWeight(),
53  m_bndConditions()
54  {
55  }
56 
59  const LibUtilities::BasisKey &HomoBasis,
60  const NekDouble lhom,
61  const bool useFFT,
62  const bool dealiasing):
63  ExpList3DHomogeneous1D(pSession,HomoBasis,lhom,useFFT,dealiasing),
64  m_bndCondExpansions(),
65  m_bndCondBndWeight(),
66  m_bndConditions()
67  {
68  }
69 
72  const bool DeclarePlanesSetCoeffPhys)
73  : ExpList3DHomogeneous1D (In,false),
74  m_bndCondExpansions (In.m_bndCondExpansions),
75  m_bndCondBndWeight (In.m_bndCondBndWeight),
76  m_bndConditions (In.m_bndConditions)
77  {
78  if (DeclarePlanesSetCoeffPhys)
79  {
80  DisContFieldSharedPtr zero_plane =
81  std::dynamic_pointer_cast<DisContField> (In.m_planes[0]);
82 
83  for(int n = 0; n < m_planes.size(); ++n)
84  {
85  m_planes[n] =
87  AllocateSharedPtr(*zero_plane, false);
88  }
89 
90  SetCoeffPhys();
91  }
92  }
93 
96  const LibUtilities::BasisKey &HomoBasis,
97  const NekDouble lhom,
98  const bool useFFT,
99  const bool dealiasing,
100  const SpatialDomains::MeshGraphSharedPtr &graph2D,
101  const std::string &variable,
102  const Collections::ImplementationType ImpType):
103  ExpList3DHomogeneous1D(pSession, HomoBasis, lhom, useFFT,
104  dealiasing),
105  m_bndCondExpansions(),
106  m_bndCondBndWeight(),
107  m_bndConditions()
108  {
109  int i, n, nel;
110  DisContFieldSharedPtr plane_zero;
112 
113  // note that nzplanes can be larger than nzmodes
114  m_planes[0] = plane_zero = MemoryManager<DisContField>::
115  AllocateSharedPtr(pSession, graph2D, variable, true, false,
116  ImpType);
117 
120 
121  nel = m_planes[0]->GetExpSize();
122 
123  for (i = 0; i < nel; ++i)
124  {
125  (*m_exp).push_back(m_planes[0]->GetExp(i));
126  }
127 
128  for (n = 1; n < m_planes.size(); ++n)
129  {
131  AllocateSharedPtr(*plane_zero, graph2D,
132  variable, true, false);
133  for(i = 0; i < nel; ++i)
134  {
135  (*m_exp).push_back((*m_exp)[i]);
136  }
137  }
138 
139  // Set up trace object.
141  for (n = 0; n < m_planes.size(); ++n)
142  {
143  trace[n] = m_planes[n]->GetTrace();
144  }
145 
147  pSession, HomoBasis, lhom, useFFT,
148  dealiasing, trace);
149 
150  // Setup default optimisation information
151  nel = GetExpSize();
152 
153  SetCoeffPhys();
154 
155  // Do not set up BCs if default variable
156  if(variable.compare("DefaultVar") != 0)
157  {
158  SetupBoundaryConditions(HomoBasis, lhom, bcs, variable);
159  }
160 
161  SetUpDG();
162  }
163 
164  /**
165  * @brief Default destructor
166  */
168  {
169  }
170 
172  const LibUtilities::BasisKey &HomoBasis,
173  const NekDouble lhom,
175  const std::string variable)
176  {
177  int n, cnt = 0;
178 
179  // Setup an ExpList2DHomogeneous1D expansion for boundary
180  // conditions and link to class declared in m_planes
182  bcs.GetBoundaryRegions();
184  bcs.GetBoundaryConditions();
185 
187  bregions.size());
188  m_bndConditions = m_planes[0]->UpdateBndConditions();
189 
190  m_bndCondBndWeight = Array<OneD, NekDouble> {bregions.size(),0.0};
191 
192  int nplanes = m_planes.size();
194  PlanesBndCondExp(nplanes);
195 
196  for (auto &it : bregions)
197  {
198  SpatialDomains::BoundaryConditionShPtr boundaryCondition =
199  GetBoundaryCondition(bconditions, it.first, variable);
200  for (n = 0; n < nplanes; ++n)
201  {
202  PlanesBndCondExp[n] = m_planes[n]->
204  }
205 
206  // Initialise comm for the boundary regions
207  auto comm = boundaryCondition->GetComm();
208  int size = boundaryCondition->GetComm()->GetSize();
209 
210  if(size > 1)
211  {
212  // It seems to work either way
213  // comm->SplitComm(1,size);
214  comm->SplitComm(m_StripZcomm->GetSize(),
215  size/m_StripZcomm->GetSize());
216  }
217 
218  m_bndCondExpansions[cnt++] =
220  AllocateSharedPtr(m_session, HomoBasis, lhom,
221  m_useFFT, false,
222  PlanesBndCondExp, comm);
223  }
224  v_EvaluateBoundaryConditions(0.0, variable);
225  }
226 
228  const Array<OneD, const NekDouble> &inarray,
229  Array<OneD, NekDouble> &outarray,
230  const StdRegions::ConstFactorMap &factors,
231  const StdRegions::VarCoeffMap &varcoeff,
232  const MultiRegions::VarFactorsMap &varfactors,
233  const Array<OneD, const NekDouble> &dirForcing,
234  const bool PhysSpaceForcing)
235  {
236  int n;
237  int cnt = 0;
238  int cnt1 = 0;
239  NekDouble beta;
240  StdRegions::ConstFactorMap new_factors;
241 
243  Array<OneD, NekDouble> fce(inarray.size());
245 
246  // Transform forcing function in half-physical space if required
247  if (m_WaveSpace)
248  {
249  fce = inarray;
250  }
251  else
252  {
253  HomogeneousFwdTrans(inarray,fce);
254  }
255 
256  for (n = 0; n < m_planes.size(); ++n)
257  {
258  if (n != 1 || m_transposition->GetK(n) != 0)
259  {
260  beta = 2*M_PI*(m_transposition->GetK(n))/m_lhom;
261  new_factors = factors;
262  // add in Homogeneous Fourier direction and SVV if turned on
263  new_factors[StdRegions::eFactorLambda] +=
264  beta*beta*(1+GetSpecVanVisc(n));
265 
266  wfce = (PhysSpaceForcing)? fce+cnt:fce+cnt1;
267  m_planes[n]->HelmSolve(
268  wfce,
269  e_out = outarray + cnt1,
270  new_factors, varcoeff, varfactors,
271  dirForcing,
272  PhysSpaceForcing);
273  }
274 
275  cnt += m_planes[n]->GetTotPoints();
276  cnt1 += m_planes[n]->GetNcoeffs();
277  }
278  }
279 
281  const NekDouble time,
282  const std::string varName,
283  const NekDouble x2_in,
284  const NekDouble x3_in)
285  {
286  boost::ignore_unused(x2_in,x3_in);
287  int i;
288  int npoints;
289  int nbnd = m_bndCondExpansions.size();
291 
292  for (i = 0; i < nbnd; ++i)
293  {
294  if (time == 0.0 || m_bndConditions[i]->IsTimeDependent())
295  {
296  locExpList = m_bndCondExpansions[i];
297  npoints = locExpList->GetNpoints();
298 
299  Array<OneD, NekDouble> x0(npoints, 0.0);
300  Array<OneD, NekDouble> x1(npoints, 0.0);
301  Array<OneD, NekDouble> x2(npoints, 0.0);
302  Array<OneD, NekDouble> valuesFile(npoints, 1.0), valuesExp(npoints, 1.0);
303 
304  locExpList->GetCoords(x0, x1, x2);
305 
306  if (m_bndConditions[i]->GetBoundaryConditionType()
308  {
309  SpatialDomains::DirichletBCShPtr bcPtr = std::static_pointer_cast<
311  m_bndConditions[i]);
312  std::string filebcs = bcPtr->m_filename;
313  std::string exprbcs = bcPtr->m_expr;
314 
315  if (filebcs != "")
316  {
317  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
318  valuesFile = locExpList->GetPhys();
319  }
320 
321  if (exprbcs != "")
322  {
323  LibUtilities::Equation condition =
324  std::static_pointer_cast<SpatialDomains::
325  DirichletBoundaryCondition >(
326  m_bndConditions[i])->m_dirichletCondition;
327 
328  condition.Evaluate(x0, x1, x2, time, valuesExp);
329  }
330 
331  Vmath::Vmul(npoints, valuesExp, 1, valuesFile, 1,
332  locExpList->UpdatePhys(), 1);
333 
334  // set wave space to false since have set up phys values
335  locExpList->SetWaveSpace(false);
336 
337  locExpList->FwdTrans_BndConstrained(
338  locExpList->GetPhys(),
339  locExpList->UpdateCoeffs());
340  }
341  else if (m_bndConditions[i]->GetBoundaryConditionType()
343  {
344  SpatialDomains::NeumannBCShPtr bcPtr = std::static_pointer_cast<
346  m_bndConditions[i]);
347 
348  std::string filebcs = bcPtr->m_filename;
349 
350  if (filebcs != "")
351  {
352  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
353  }
354  else
355  {
356  LibUtilities::Equation condition = std::
357  static_pointer_cast<SpatialDomains::
358  NeumannBoundaryCondition>(
359  m_bndConditions[i])->m_neumannCondition;
360 
361  condition.Evaluate(x0, x1, x2, time,
362  locExpList->UpdatePhys());
363 
364  locExpList->IProductWRTBase(locExpList->GetPhys(),
365  locExpList->UpdateCoeffs());
366  }
367  }
368  else if (m_bndConditions[i]->GetBoundaryConditionType()
370  {
371  SpatialDomains::RobinBCShPtr bcPtr = std::static_pointer_cast<
373  m_bndConditions[i]);
374  std::string filebcs = bcPtr->m_filename;
375 
376  if (filebcs != "")
377  {
378  ExtractFileBCs(filebcs, bcPtr->GetComm(), varName, locExpList);
379  }
380  else
381  {
382  LibUtilities::Equation condition = std::
383  static_pointer_cast<SpatialDomains::
384  RobinBoundaryCondition>(
385  m_bndConditions[i])->m_robinFunction;
386 
387  condition.Evaluate(x0, x1, x2, time,
388  locExpList->UpdatePhys());
389 
390  }
391 
392  locExpList->IProductWRTBase(locExpList->GetPhys(),
393  locExpList->UpdateCoeffs());
394 
395  }
396  else if (m_bndConditions[i]->GetBoundaryConditionType()
398  {
399  continue;
400  }
401  else
402  {
403  ASSERTL0(false, "This type of BC not implemented yet");
404  }
405  }
406  }
407  }
408 
409  std::shared_ptr<ExpList> &DisContField3DHomogeneous1D::
411  {
412  return UpdateBndCondExpansion(i);
413  }
414 
417  {
418  return UpdateBndConditions();
419  }
420 
422  Array<OneD, int> &ElmtID,
423  Array<OneD,int> &EdgeID)
424  {
425 
426  if(m_BCtoElmMap.size() == 0)
427  {
428  Array<OneD, int> ElmtID_tmp;
429  Array<OneD, int> EdgeID_tmp;
430 
431  m_planes[0]->GetBoundaryToElmtMap(ElmtID_tmp, EdgeID_tmp);
432  int nel_per_plane = m_planes[0]->GetExpSize();
433  int nplanes = m_planes.size();
434 
435  int MapSize = ElmtID_tmp.size();
436 
437  m_BCtoElmMap = Array<OneD, int>(nplanes*MapSize);
438  m_BCtoEdgMap = Array<OneD, int>(nplanes*MapSize);
439 
440  // If this mesh (or partition) has no BCs, skip this step
441  if (MapSize > 0)
442  {
443  int i ,j, n, cnt;
444  int cntPlane = 0;
445  for (cnt=n=0; n < m_bndCondExpansions.size(); ++n)
446  {
447  int planeExpSize = m_planes[0]
448  ->GetBndCondExpansions()[n]
449  ->GetExpSize();
450  for (i = 0; i < planeExpSize ; ++i, ++cntPlane)
451  {
452  for(j = 0; j < nplanes; j++)
453  {
454  m_BCtoElmMap[cnt+i+j*planeExpSize] =
455  ElmtID_tmp[cntPlane]+j*nel_per_plane;
456  m_BCtoEdgMap[cnt+i+j*planeExpSize] =
457  EdgeID_tmp[cntPlane];
458  }
459  }
460  cnt += m_bndCondExpansions[n]->GetExpSize();
461  }
462  }
463  }
464  ElmtID = m_BCtoElmMap;
465  EdgeID = m_BCtoEdgMap;
466  }
467 
469  std::shared_ptr<ExpList> &result,
470  const bool DeclareCoeffPhysArrays)
471  {
472  int n, cnt, nq;
473  int offsetOld, offsetNew;
474 
475  std::vector<unsigned int> eIDs;
476  Array<OneD, int> ElmtID,EdgeID;
477  GetBoundaryToElmtMap(ElmtID,EdgeID);
478 
479  // Skip other boundary regions
480  for (cnt = n = 0; n < i; ++n)
481  {
482  cnt += m_bndCondExpansions[n]->GetExpSize();
483  }
484 
485  // Populate eIDs with information from BoundaryToElmtMap
486  for (n = 0; n < m_bndCondExpansions[i]->GetExpSize(); ++n)
487  {
488  eIDs.push_back(ElmtID[cnt+n]);
489  }
490 
491  // Create expansion list
492  result =
494  (*this, eIDs);
495 
496  // Copy phys and coeffs to new explist
497  if ( DeclareCoeffPhysArrays)
498  {
499  Array<OneD, NekDouble> tmp1, tmp2;
500  for (n = 0; n < result->GetExpSize(); ++n)
501  {
502  nq = GetExp(ElmtID[cnt+n])->GetTotPoints();
503  offsetOld = GetPhys_Offset(ElmtID[cnt+n]);
504  offsetNew = result->GetPhys_Offset(n);
505  Vmath::Vcopy(nq, tmp1 = GetPhys()+ offsetOld, 1,
506  tmp2 = result->UpdatePhys()+ offsetNew, 1);
507 
508  nq = GetExp(ElmtID[cnt+n])->GetNcoeffs();
509  offsetOld = GetCoeff_Offset(ElmtID[cnt+n]);
510  offsetNew = result->GetCoeff_Offset(n);
511  Vmath::Vcopy(nq, tmp1 = GetCoeffs()+ offsetOld, 1,
512  tmp2 = result->UpdateCoeffs()+ offsetNew, 1);
513  }
514  }
515 
516  // Set wavespace value
517  result->SetWaveSpace(GetWaveSpace());
518  }
519 
521  const Array<OneD, NekDouble> & TotField,
522  int BndID )
523  {
526 
528  Array<OneD, NekDouble> tmp_BC;
529 
530  int cnt = 0;
531  int pos = 0;
532  int exp_size, exp_size_per_plane, elmtID, boundaryID;
533  int offset, exp_dim;
534 
535  for (int k = 0; k < m_planes.size(); k++)
536  {
537  for (int n = 0; n < m_bndConditions.size(); ++n)
538  {
539  exp_size = m_bndCondExpansions[n]->GetExpSize();
540  exp_size_per_plane = exp_size/m_planes.size();
541 
542  for (int i = 0; i < exp_size_per_plane; i++)
543  {
544  if(n == BndID)
545  {
546  elmtID = m_BCtoElmMap[cnt];
547  boundaryID = m_BCtoEdgMap[cnt];
548  exp_dim = m_bndCondExpansions[n]->
549  GetExp(i+k*exp_size_per_plane)->GetTotPoints();
550  offset = GetPhys_Offset(elmtID);
551  elmt = GetExp(elmtID);
552  temp_BC_exp = std::dynamic_pointer_cast<
554  m_bndCondExpansions[n]->GetExp(
555  i + k * exp_size_per_plane )
556  );
557 
558  elmt->GetTracePhysVals(boundaryID, temp_BC_exp,
559  tmp_Tot = TotField + offset,
560  tmp_BC = BndVals + pos);
561  pos += exp_dim;
562  }
563  cnt++;
564  }
565  }
566  }
567  }
568 
572  Array<OneD, NekDouble> &outarray,
573  int BndID)
574  {
577 
578  Array<OneD, NekDouble> tmp_V1;
579  Array<OneD, NekDouble> tmp_V2;
580  Array<OneD, NekDouble> tmp_outarray;
581 
582  int cnt = 0;
583  int exp_size, exp_size_per_plane, elmtID, Phys_offset, Coef_offset;
584 
585  for(int k = 0; k < m_planes.size(); k++)
586  {
587  for(int n = 0; n < m_bndConditions.size(); ++n)
588  {
589  exp_size = m_bndCondExpansions[n]->GetExpSize();
590  exp_size_per_plane = exp_size/m_planes.size();
591 
592  for(int i = 0; i < exp_size_per_plane; i++)
593  {
594  if(n == BndID)
595  {
596  elmtID = m_BCtoElmMap[cnt];
597 
598  Phys_offset = m_bndCondExpansions[n]->
599  GetPhys_Offset(i+k*exp_size_per_plane);
600  Coef_offset = m_bndCondExpansions[n]->
601  GetCoeff_Offset(i+k*exp_size_per_plane);
602 
603  elmt = GetExp(elmtID);
604  temp_BC_exp = std::dynamic_pointer_cast<
606  m_bndCondExpansions[n]->GetExp(
607  i + k * exp_size_per_plane )
608  );
609 
610  temp_BC_exp->NormVectorIProductWRTBase(
611  tmp_V1 = V1 + Phys_offset,
612  tmp_V2 = V2 + Phys_offset,
613  tmp_outarray = outarray + Coef_offset);
614  }
615  cnt++;
616  }
617  }
618  }
619  }
620 
622  Array<OneD, NekDouble> &outarray)
623  {
624  ASSERTL1(m_physState == true,
625  "Field must be in physical state to extract trace space.");
626 
627  v_ExtractTracePhys(m_phys, outarray);
628  }
629 
630  /**
631  * @brief This method extracts the trace (edges in 2D) for each plane
632  * from the field @a inarray and puts the values in @a outarray.
633  *
634  * It assumes the field is C0 continuous so that it can overwrite the
635  * edge data when visited by the two adjacent elements.
636  *
637  * @param inarray An array containing the 2D data from which we wish
638  * to extract the edge data.
639  * @param outarray The resulting edge information.
640  */
642  const Array<OneD, const NekDouble> &inarray,
643  Array<OneD, NekDouble> &outarray)
644  {
645  int nPoints_plane = m_planes[0]->GetTotPoints();
646  int nTracePts = m_planes[0]->GetTrace()->GetTotPoints();
647 
648  for (int i = 0; i < m_planes.size(); ++i)
649  {
650  Array<OneD, NekDouble> inarray_plane(nPoints_plane, 0.0);
651  Array<OneD, NekDouble> outarray_plane(nPoints_plane, 0.0);
652 
653  Vmath::Vcopy(nPoints_plane,
654  &inarray[i*nPoints_plane], 1,
655  &inarray_plane[0], 1);
656 
657  m_planes[i]->ExtractTracePhys(inarray_plane, outarray_plane);
658 
659  Vmath::Vcopy(nTracePts,
660  &outarray_plane[0], 1,
661  &outarray[i*nTracePts], 1);
662  }
663  }
664 
665  /**
666  */
668  Array<OneD, Array<OneD, NekDouble> > & normals )
669  {
670  int expdim = GetCoordim(0);
671  int coordim = 3;
674 
675  Array<OneD, int> ElmtID,EdgeID;
676  GetBoundaryToElmtMap(ElmtID,EdgeID);
677 
678  // Initialise result
679  normals = Array<OneD, Array<OneD, NekDouble> > (coordim);
680  for (int j = 0; j < coordim; ++j)
681  {
682  normals[j] = Array<OneD, NekDouble> ( GetBndCondExpansions()[i]->GetTotPoints(), 0.0 );
683  }
684 
685  // Skip other boundary regions
686  int cnt = 0;
687  for( int n = 0; n < i; ++n )
688  {
689  cnt += GetBndCondExpansions()[n]->GetExpSize();
690  }
691 
692  int offset;
693  for( int n = 0; n < GetBndCondExpansions()[i]->GetExpSize(); ++n )
694  {
695  offset = GetBndCondExpansions()[i]->GetPhys_Offset(n);
696  int nq = GetBndCondExpansions()[i]->GetExp(n)->GetTotPoints();
697 
698  elmt = GetExp(ElmtID[cnt+n]);
699  const Array<OneD, const Array<OneD, NekDouble> > normalsElmt
700  = elmt->GetTraceNormal(EdgeID[cnt+n]);
701  // Copy to result
702  for (int j = 0; j < expdim; ++j)
703  {
704  Vmath::Vcopy(nq, normalsElmt[j], 1,
705  tmp = normals[j] + offset, 1);
706  }
707  }
708  }
709 
710  /**
711  * @brief Set up all DG member variables and maps.
712  */
714  {
715  const int nPlanes = m_planes.size();
716  const int nTracePlane = m_planes[0]->GetTrace()->GetExpSize();
717 
718  // Get trace map from first plane.
719  AssemblyMapDGSharedPtr traceMap = m_planes[0]->GetTraceMap();
720  const Array<OneD, const int> &traceBndMap
721  = traceMap->GetBndCondIDToGlobalTraceID();
722  int mapSize = traceBndMap.size();
723 
724  // Set up trace boundary map
725  m_traceBndMap = Array<OneD, int>(nPlanes * mapSize);
726 
727  int i, n, e, cnt = 0, cnt1 = 0;
728 
729  for (i = 0; i < m_bndCondExpansions.size(); ++i)
730  {
731  int nExp = m_bndCondExpansions[i]->GetExpSize();
732  int nPlaneExp = nExp / nPlanes;
733 
734  if (m_bndConditions[i]->GetBoundaryConditionType() ==
736  {
737  continue;
738  }
739 
740  for (n = 0; n < nPlanes; ++n)
741  {
742  const int offset = n * nTracePlane;
743  for (e = 0; e < nPlaneExp; ++e)
744  {
745  m_traceBndMap[cnt++] = offset + traceBndMap[cnt1+e];
746  }
747  }
748 
749  cnt1 += nPlaneExp;
750  }
751  }
752  } // end of namespace
753 } //end of namespace
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
Definition: ErrorUtil.hpp:250
Describes the specification for a Basis.
Definition: Basis.h:50
NekDouble Evaluate() const
Definition: Equation.cpp:95
void GetTracePhysVals(const int trace, const StdRegions::StdExpansionSharedPtr &TraceExp, const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, StdRegions::Orientation orient=StdRegions::eNoOrientation)
Definition: Expansion.h:197
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...
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...
virtual void v_GetBoundaryNormals(int i, Array< OneD, Array< OneD, NekDouble > > &normals)
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...
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)
Array< OneD, SpatialDomains::BoundaryConditionShPtr > & UpdateBndConditions()
virtual Array< OneD, SpatialDomains::BoundaryConditionShPtr > & v_UpdateBndConditions()
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)
Array< OneD, SpatialDomains::BoundaryConditionShPtr > m_bndConditions
An array which contains the information about the boundary condition on the different boundary region...
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.
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
void HomogeneousFwdTrans(const Array< OneD, const NekDouble > &inarray, Array< OneD, NekDouble > &outarray, bool Shuff=true, bool UnShuff=true)
static SpatialDomains::BoundaryConditionShPtr GetBoundaryCondition(const SpatialDomains::BoundaryConditionCollection &collection, unsigned int index, const std::string &variable)
Definition: ExpList.cpp:4983
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:2293
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:2392
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:2431
int GetExpSize(void)
This function returns the number of elements in the expansion.
Definition: ExpList.h:2401
void ExtractFileBCs(const std::string &fileName, LibUtilities::CommSharedPtr comm, const std::string &varName, const std::shared_ptr< ExpList > locExpList)
Definition: ExpList.cpp:3207
bool m_physState
The state of the array m_phys.
Definition: ExpList.h:1278
std::shared_ptr< LocalRegions::ExpansionVector > m_exp
The list of local expansions.
Definition: ExpList.h:1290
const std::shared_ptr< LocalRegions::ExpansionVector > GetExp() const
This function returns the vector of elements in the expansion.
Definition: ExpList.h:2422
LibUtilities::SessionReaderSharedPtr m_session
Session.
Definition: ExpList.h:1223
bool GetWaveSpace(void) const
This function returns the third direction expansion condition, which can be in wave space (coefficien...
Definition: ExpList.h:1899
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:2439
Array< OneD, NekDouble > m_phys
The global expansion evaluated at the quadrature points.
Definition: ExpList.h:1269
int GetTotPoints(void) const
Returns the total number of quadrature points m_npoints .
Definition: ExpList.h:1850
int GetCoordim(int eid)
This function returns the dimension of the coordinates of the element eid.
Definition: ExpList.h:2244
const BoundaryConditionCollection & GetBoundaryConditions(void) const
Definition: Conditions.h:248
const BoundaryRegionCollection & GetBoundaryRegions(void) const
Definition: Conditions.h:238
void NormVectorIProductWRTBase(const Array< OneD, const NekDouble > &Fx, Array< OneD, NekDouble > &outarray)
Definition: StdExpansion.h:628
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Expansion > ExpansionSharedPtr
Definition: Expansion.h:68
std::shared_ptr< Expansion1D > Expansion1DSharedPtr
Definition: Expansion1D.h:51
std::shared_ptr< AssemblyMapDG > AssemblyMapDGSharedPtr
Definition: AssemblyMapDG.h:47
std::shared_ptr< DisContField > DisContFieldSharedPtr
Definition: DisContField.h:385
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< StdRegions::ConstFactorType, Array< OneD, NekDouble > > VarFactorsMap
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:217
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:219
std::shared_ptr< DirichletBoundaryCondition > DirichletBCShPtr
Definition: Conditions.h:220
std::map< int, BoundaryConditionMapShPtr > BoundaryConditionCollection
Definition: Conditions.h:226
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::shared_ptr< NeumannBoundaryCondition > NeumannBCShPtr
Definition: Conditions.h:221
std::shared_ptr< RobinBoundaryCondition > RobinBCShPtr
Definition: Conditions.h:222
std::map< StdRegions::VarCoeffType, Array< OneD, NekDouble > > VarCoeffMap
Definition: StdRegions.hpp:272
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:314
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble
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:192
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1199