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