Nektar++
Conditions.cpp
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: Conditions.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:
32 //
33 //
34 ////////////////////////////////////////////////////////////////////////////////
35 
38 #include <boost/algorithm/string/predicate.hpp>
39 #include <tinyxml.h>
40 
41 using namespace std;
42 
43 namespace Nektar
44 {
45 namespace SpatialDomains
46 {
47 /**
48  * Constructor - collective on the session's communicator.
49  */
50 BoundaryConditions::BoundaryConditions(
52  const MeshGraphSharedPtr &meshGraph)
53  : m_meshGraph(meshGraph), m_session(pSession)
54 
55 {
56  Read(m_session->GetElement("Nektar/Conditions"));
57 }
58 
60 {
61 }
62 
64 {
65 }
66 
67 /**
68  * Helper that turns a set into an array.
69  */
70 Array<OneD, int> ToArray(const std::set<int> &set)
71 {
72  Array<OneD, int> ans(set.size());
73  auto it = set.begin(), end = set.end();
74  for (int i = 0; it != end; ++it, ++i)
75  {
76  ans[i] = *it;
77  }
78  return ans;
79 }
80 
81 /*
82  * Helper function that effectively does an MPI_Allreduce for the
83  * sets of boundary region IDs.
84  *
85  * Can't actually use an MPI_Allreduce because the sizes of the input
86  * sets and output set are (in general) different.
87  *
88  * Instead, use a simple binary tree reduction and two MPI_Bcast calls.
89  */
90 std::set<int> ShareAllBoundaryIDs(
91  const BoundaryRegionCollection &boundaryRegions,
93 {
94  // Turn the keys of boundaryRegions into set.
95  std::set<int> ids;
96  auto it = boundaryRegions.begin(), end = boundaryRegions.end();
97  int i = 0;
98  for (; it != end; ++it, ++i)
99  ids.insert(it->first);
100 
101  int np = comm->GetSize();
102  int ip = comm->GetRank();
103 
104  int half_size = 1;
105  bool involved = true;
106  while (involved && half_size < np)
107  {
108  if (ip & half_size)
109  {
110  // I'm sender
111 
112  // The receiver rank
113  int receiver = ip - half_size;
114 
115  Array<OneD, int> idsArray = ToArray(ids);
116  // Send my size (to alloc the reciever array)
117  Array<OneD, int> sender_size(1);
118  sender_size[0] = idsArray.size();
119  comm->Send(receiver, sender_size);
120 
121  // Send my data
122  comm->Send(receiver, idsArray);
123 
124  // Once we've sent, we're no longer involved.
125  involved = false;
126  }
127  else
128  {
129  // I'm receiver
130 
131  // The sender rank
132  int sender = ip + half_size;
133 
134  if (sender < np)
135  {
136  // Receive the size
137  Array<OneD, int> sender_size(1);
138  comm->Recv(sender, sender_size);
139 
140  // Receive the data
141  Array<OneD, int> other_ids(sender_size[0]);
142  comm->Recv(sender, other_ids);
143 
144  // Merge
145  ids.insert(other_ids.begin(), other_ids.end());
146  }
147  }
148  half_size *= 2;
149  }
150 
151  // Bcast the size
152  int nIds;
153  if (ip == 0)
154  nIds = ids.size();
155 
156  comm->Bcast(nIds, 0);
157 
158  // Bcast the data
159  Array<OneD, int> idsArray;
160  if (ip == 0)
161  idsArray = ToArray(ids);
162  else
163  idsArray = Array<OneD, int>(nIds);
164 
165  comm->Bcast(idsArray, 0);
166 
167  return std::set<int>(idsArray.begin(), idsArray.end());
168 }
169 
170 /**
171  * Create a new communicator for each boundary region.
172  * Collective on the session's communicator.
173  */
175 {
176  LibUtilities::CommSharedPtr comm = m_session->GetComm();
177 
178  if (comm->IsSerial())
179  {
180  // Do not try and generate a communicator if we have a serial
181  // communicator. Arises with a FieldConvert communicator when
182  // using --nparts in FieldConvert. Just set communicator to comm
183  // in this case.
184  for (auto &it : m_boundaryRegions)
185  {
186  m_boundaryCommunicators[it.first] = comm;
187  }
188  return;
189  }
190 
191  std::set<int> allids = ShareAllBoundaryIDs(m_boundaryRegions, comm);
192 
193  for (auto &it : allids)
194  {
195  auto reg_it = m_boundaryRegions.find(it);
196  int this_rank_participates = (reg_it != m_boundaryRegions.end());
197  LibUtilities::CommSharedPtr comm_region =
198  comm->CommCreateIf(this_rank_participates);
199 
200  ASSERTL0(bool(comm_region) == bool(this_rank_participates),
201  "Rank should be in communicator but wasn't or is in "
202  "communicator but shouldn't be.");
203 
204  if (this_rank_participates)
205  {
206  m_boundaryCommunicators[reg_it->first] = comm_region;
207  }
208  }
209 }
210 
211 /**
212  * Collective on the session's communicator.
213  */
214 void BoundaryConditions::Read(TiXmlElement *conditions)
215 {
216  ASSERTL0(conditions, "Unable to find CONDITIONS tag in file.");
217 
218  TiXmlElement *boundaryRegions =
219  conditions->FirstChildElement("BOUNDARYREGIONS");
220 
221  if (boundaryRegions)
222  {
223  ReadBoundaryRegions(conditions);
225  ReadBoundaryConditions(conditions);
226  }
227 }
228 
229 /**
230  *
231  */
232 void BoundaryConditions::ReadBoundaryRegions(TiXmlElement *conditions)
233 {
234  // ensure boundary regions only read once per class definition
235  if (m_boundaryRegions.size() != 0)
236  {
237  return;
238  }
239 
240  TiXmlElement *boundaryRegions =
241  conditions->FirstChildElement("BOUNDARYREGIONS");
242  ASSERTL0(boundaryRegions, "Unable to find BOUNDARYREGIONS block.");
243 
244  // See if we have boundary regions defined.
245  TiXmlElement *boundaryRegionsElement =
246  boundaryRegions->FirstChildElement("B");
247 
248  while (boundaryRegionsElement)
249  {
250  /// All elements are of the form: "<B ID="#"> ... </B>", with
251  /// ? being the element type.
252  int indx;
253  int err = boundaryRegionsElement->QueryIntAttribute("ID", &indx);
254  ASSERTL0(err == TIXML_SUCCESS, "Unable to read attribute ID.");
255 
256  TiXmlNode *boundaryRegionChild = boundaryRegionsElement->FirstChild();
257  // This is primarily to skip comments that may be present.
258  // Comments appear as nodes just like elements.
259  // We are specifically looking for text in the body
260  // of the definition.
261  while (boundaryRegionChild &&
262  boundaryRegionChild->Type() != TiXmlNode::TINYXML_TEXT)
263  {
264  boundaryRegionChild = boundaryRegionChild->NextSibling();
265  }
266 
267  ASSERTL0(boundaryRegionChild,
268  "Unable to read variable definition body.");
269  std::string boundaryRegionStr =
270  boundaryRegionChild->ToText()->ValueStr();
271 
272  std::string::size_type indxBeg =
273  boundaryRegionStr.find_first_of('[') + 1;
274  std::string::size_type indxEnd =
275  boundaryRegionStr.find_last_of(']') - 1;
276 
277  ASSERTL0(indxBeg <= indxEnd,
278  (std::string("Error reading boundary region definition:") +
279  boundaryRegionStr)
280  .c_str());
281 
282  std::string indxStr =
283  boundaryRegionStr.substr(indxBeg, indxEnd - indxBeg + 1);
284 
285  if (!indxStr.empty())
286  {
287  // Extract the composites from the string and return them in a list.
288  BoundaryRegionShPtr boundaryRegion(
290 
291  ASSERTL0(m_boundaryRegions.count(indx) == 0,
292  "Boundary region " + indxStr +
293  " defined more than "
294  "once!");
295 
296  m_meshGraph->GetCompositeList(indxStr, *boundaryRegion);
297  if (boundaryRegion->size() > 0)
298  {
299  m_boundaryRegions[indx] = boundaryRegion;
300  }
301 
302  // Read optional name as string and save to m_boundaryLabels if
303  // exists
304  std::string name;
305  err = boundaryRegionsElement->QueryStringAttribute("NAME", &name);
306  if (err == TIXML_SUCCESS)
307  {
308  m_boundaryLabels[indx] = name;
309  }
310  }
311 
312  boundaryRegionsElement =
313  boundaryRegionsElement->NextSiblingElement("B");
314  }
315 }
316 
317 /**
318  *
319  */
320 void BoundaryConditions::ReadBoundaryConditions(TiXmlElement *conditions)
321 {
322  // Protect against multiple reads.
323  if (m_boundaryConditions.size() != 0)
324  {
325  return;
326  }
327 
328  // Read REGION tags
329  TiXmlElement *boundaryConditionsElement =
330  conditions->FirstChildElement("BOUNDARYCONDITIONS");
331  ASSERTL0(boundaryConditionsElement,
332  "Boundary conditions must be specified.");
333 
334  TiXmlElement *regionElement =
335  boundaryConditionsElement->FirstChildElement("REGION");
336 
337  // Read R (Robin), D (Dirichlet), N (Neumann), P (Periodic) C(Cauchy) tags
338  while (regionElement)
339  {
340  BoundaryConditionMapShPtr boundaryConditions =
342 
343  int boundaryRegionID;
344  int err = regionElement->QueryIntAttribute("REF", &boundaryRegionID);
345  ASSERTL0(err == TIXML_SUCCESS,
346  "Error reading boundary region reference.");
347 
348  ASSERTL0(m_boundaryConditions.count(boundaryRegionID) == 0,
349  "Boundary region '" +
350  boost::lexical_cast<std::string>(boundaryRegionID) +
351  "' appears multiple times.");
352 
353  // Find the boundary region corresponding to this ID.
354  std::string boundaryRegionIDStr;
355  std::ostringstream boundaryRegionIDStrm(boundaryRegionIDStr);
356  boundaryRegionIDStrm << boundaryRegionID;
357 
358  if (m_boundaryRegions.count(boundaryRegionID) == 0)
359  {
360  regionElement = regionElement->NextSiblingElement("REGION");
361  continue;
362  }
363 
364  ASSERTL0(m_boundaryRegions.count(boundaryRegionID) == 1,
365  "Boundary region " +
366  boost::lexical_cast<string>(boundaryRegionID) +
367  " not found");
368 
369  // Find the communicator that belongs to this ID
370  LibUtilities::CommSharedPtr boundaryRegionComm =
371  m_boundaryCommunicators[boundaryRegionID];
372 
373  TiXmlElement *conditionElement = regionElement->FirstChildElement();
374  std::vector<std::string> vars = m_session->GetVariables();
375 
376  while (conditionElement)
377  {
378  // Check type.
379  std::string conditionType = conditionElement->Value();
380  std::string attrData;
381  bool isTimeDependent = false;
382 
383  // All have var specified, or else all variables are zero.
384  TiXmlAttribute *attr = conditionElement->FirstAttribute();
385 
386  std::vector<std::string>::iterator iter;
387  std::string attrName;
388 
389  attrData = conditionElement->Attribute("VAR");
390 
391  if (!attrData.empty())
392  {
393  iter = std::find(vars.begin(), vars.end(), attrData);
394  ASSERTL0(
395  iter != vars.end(),
396  (std::string("Cannot find variable: ") + attrData).c_str());
397  }
398 
399  if (conditionType == "N")
400  {
401  if (attrData.empty())
402  {
403  // All variables are Neumann and are set to zero.
404  for (auto &varIter : vars)
405  {
406  BoundaryConditionShPtr neumannCondition(
408  AllocateSharedPtr(m_session, "00.0"));
409  (*boundaryConditions)[varIter] = neumannCondition;
410  }
411  }
412  else
413  {
414  if (attr)
415  {
416  std::string equation, userDefined, filename;
417 
418  while (attr)
419  {
420 
421  attrName = attr->Name();
422 
423  if (attrName == "VAR")
424  {
425  // if VAR do nothing
426  }
427  else if (attrName == "USERDEFINEDTYPE")
428  {
429  // Do stuff for the user defined attribute
430  attrData = attr->Value();
431  ASSERTL0(!attrData.empty(),
432  "USERDEFINEDTYPE attribute must have "
433  "associated value.");
434 
435  // Suppose to go here?
436  m_session->SubstituteExpressions(attrData);
437 
438  userDefined = attrData;
439  isTimeDependent =
440  boost::iequals(attrData, "TimeDependent");
441  }
442  else if (attrName == "VALUE")
443  {
444  ASSERTL0(attrName == "VALUE",
445  (std::string("Unknown attribute: ") +
446  attrName)
447  .c_str());
448 
449  attrData = attr->Value();
450  ASSERTL0(!attrData.empty(),
451  "VALUE attribute must be specified.");
452 
453  m_session->SubstituteExpressions(attrData);
454 
455  equation = attrData;
456  }
457  else if (attrName == "FILE")
458  {
459  ASSERTL0(attrName == "FILE",
460  (std::string("Unknown attribute: ") +
461  attrName)
462  .c_str());
463 
464  attrData = attr->Value();
465  ASSERTL0(!attrData.empty(),
466  "FILE attribute must be specified.");
467 
468  m_session->SubstituteExpressions(attrData);
469 
470  filename = attrData;
471  }
472  else
473  {
474  ASSERTL0(false,
475  (std::string("Unknown boundary "
476  "condition attribute: ") +
477  attrName)
478  .c_str());
479  }
480  attr = attr->Next();
481  }
482 
483  BoundaryConditionShPtr neumannCondition(
485  AllocateSharedPtr(m_session, equation,
486  userDefined, filename,
487  boundaryRegionComm));
488  neumannCondition->SetIsTimeDependent(isTimeDependent);
489  (*boundaryConditions)[*iter] = neumannCondition;
490  }
491  else
492  {
493  // This variable's condition is zero.
494  BoundaryConditionShPtr neumannCondition(
496  AllocateSharedPtr(m_session, "0"));
497  (*boundaryConditions)[*iter] = neumannCondition;
498  }
499  }
500  }
501  else if (conditionType == "D")
502  {
503  if (attrData.empty())
504  {
505  // All variables are Dirichlet and are set to zero.
506  for (auto &varIter : vars)
507  {
508  BoundaryConditionShPtr dirichletCondition(
510  AllocateSharedPtr(m_session, "0"));
511  (*boundaryConditions)[varIter] = dirichletCondition;
512  }
513  }
514  else
515  {
516  if (attr)
517  {
518  std::string equation, userDefined, filename;
519 
520  while (attr)
521  {
522 
523  attrName = attr->Name();
524 
525  if (attrName == "VAR")
526  {
527  // if VAR do nothing
528  }
529  else if (attrName == "USERDEFINEDTYPE")
530  {
531 
532  // Do stuff for the user defined attribute
533  attrData = attr->Value();
534  ASSERTL0(!attrData.empty(),
535  "USERDEFINEDTYPE attribute must have "
536  "associated value.");
537 
538  m_session->SubstituteExpressions(attrData);
539 
540  userDefined = attrData;
541  isTimeDependent =
542  boost::iequals(attrData, "TimeDependent");
543  }
544  else if (attrName == "VALUE")
545  {
546  ASSERTL0(attrName == "VALUE",
547  (std::string("Unknown attribute: ") +
548  attrName)
549  .c_str());
550 
551  attrData = attr->Value();
552  ASSERTL0(!attrData.empty(),
553  "VALUE attribute must have associated "
554  "value.");
555 
556  m_session->SubstituteExpressions(attrData);
557 
558  equation = attrData;
559 
560  if (!boost::iequals(attrData, "0") &&
561  (boost::iequals(userDefined,
562  "WallAdiabatic") ||
563  boost::iequals(userDefined,
564  "WallViscous")))
565  {
566  isTimeDependent = true;
567  }
568  }
569  else if (attrName == "FILE")
570  {
571  ASSERTL0(attrName == "FILE",
572  (std::string("Unknown attribute: ") +
573  attrName)
574  .c_str());
575 
576  attrData = attr->Value();
577  ASSERTL0(!attrData.empty(),
578  "FILE attribute must be specified.");
579 
580  m_session->SubstituteExpressions(attrData);
581 
582  filename = attrData;
583  }
584  else
585  {
586  ASSERTL0(false,
587  (std::string("Unknown boundary "
588  "condition attribute: ") +
589  attrName)
590  .c_str());
591  }
592  attr = attr->Next();
593  }
594 
595  BoundaryConditionShPtr dirichletCondition(
597  AllocateSharedPtr(m_session, equation,
598  userDefined, filename,
599  boundaryRegionComm));
600  dirichletCondition->SetIsTimeDependent(isTimeDependent);
601  (*boundaryConditions)[*iter] = dirichletCondition;
602  }
603  else
604  {
605  // This variable's condition is zero.
606  BoundaryConditionShPtr dirichletCondition(
608  AllocateSharedPtr(m_session, "0"));
609  (*boundaryConditions)[*iter] = dirichletCondition;
610  }
611  }
612  }
613  else if (conditionType == "R") // Read du/dn + PRIMCOEFF u = VALUE
614  {
615  if (attrData.empty())
616  {
617  // All variables are Robin and are set to zero.
618  for (auto &varIter : vars)
619  {
620  BoundaryConditionShPtr robinCondition(
622  AllocateSharedPtr(m_session, "0", "0"));
623  (*boundaryConditions)[varIter] = robinCondition;
624  }
625  }
626  else
627  {
628 
629  if (attr)
630  {
631  std::string equation1, equation2, userDefined;
632  std::string filename;
633 
634  bool primcoeffset = false;
635 
636  while (attr)
637  {
638 
639  attrName = attr->Name();
640 
641  if (attrName == "VAR")
642  {
643  // if VAR do nothing
644  }
645  else if (attrName == "USERDEFINEDTYPE")
646  {
647 
648  // Do stuff for the user defined attribute
649  attrData = attr->Value();
650  ASSERTL0(!attrData.empty(),
651  "USERDEFINEDTYPE attribute must have "
652  "associated value.");
653 
654  m_session->SubstituteExpressions(attrData);
655  userDefined = attrData;
656  isTimeDependent =
657  boost::iequals(attrData, "TimeDependent");
658  }
659  else if (attrName == "VALUE")
660  {
661 
662  attrData = attr->Value();
663  ASSERTL0(!attrData.empty(),
664  "VALUE attributes must have "
665  "associated values.");
666 
667  m_session->SubstituteExpressions(attrData);
668 
669  equation1 = attrData;
670  }
671  else if (attrName == "PRIMCOEFF")
672  {
673 
674  attrData = attr->Value();
675  ASSERTL0(!attrData.empty(),
676  "PRIMCOEFF attributes must have "
677  "associated values.");
678 
679  m_session->SubstituteExpressions(attrData);
680 
681  equation2 = attrData;
682 
683  primcoeffset = true;
684  }
685  else if (attrName == "FILE")
686  {
687  attrData = attr->Value();
688  ASSERTL0(!attrData.empty(),
689  "FILE attribute must be specified.");
690 
691  m_session->SubstituteExpressions(attrData);
692 
693  filename = attrData;
694  }
695  else
696  {
697  ASSERTL0(false,
698  (std::string("Unknown boundary "
699  "condition attribute: ") +
700  attrName)
701  .c_str());
702  }
703  attr = attr->Next();
704  }
705 
706  if (primcoeffset == false)
707  {
708  ASSERTL0(false, "PRIMCOEFF must be specified in a "
709  "Robin boundary condition");
710  }
711  BoundaryConditionShPtr robinCondition(
713  AllocateSharedPtr(
714  m_session, equation1, equation2,
715  userDefined, filename, boundaryRegionComm));
716  (*boundaryConditions)[*iter] = robinCondition;
717  }
718  else
719  {
720  // This variable's condition is zero.
721  BoundaryConditionShPtr robinCondition(
723  AllocateSharedPtr(m_session, "0", "0"));
724  robinCondition->SetIsTimeDependent(isTimeDependent);
725  (*boundaryConditions)[*iter] = robinCondition;
726  }
727  }
728  }
729  else if (conditionType == "P")
730  {
731  if (attrData.empty())
732  {
733  ASSERTL0(false, "Periodic boundary conditions should "
734  "be explicitely defined");
735  }
736  else
737  {
738 
739  if (attr)
740  {
741  std::string userDefined;
742  vector<unsigned int> periodicBndRegionIndex;
743  while (attr)
744  {
745  attrName = attr->Name();
746 
747  if (attrName == "VAR")
748  {
749  // if VAR do nothing
750  }
751  else if (attrName == "USERDEFINEDTYPE")
752  {
753  // Do stuff for the user defined attribute
754  attrData = attr->Value();
755  ASSERTL0(!attrData.empty(),
756  "USERDEFINEDTYPE attribute must have "
757  "associated value.");
758 
759  m_session->SubstituteExpressions(attrData);
760  userDefined = attrData;
761  isTimeDependent =
762  boost::iequals(attrData, "TimeDependent");
763  }
764  else if (attrName == "VALUE")
765  {
766  attrData = attr->Value();
767  ASSERTL0(!attrData.empty(),
768  "VALUE attribute must have associated "
769  "value.");
770 
771  int beg = attrData.find_first_of("[");
772  int end = attrData.find_first_of("]");
773  std::string periodicBndRegionIndexStr =
774  attrData.substr(beg + 1, end - beg - 1);
775  ASSERTL0(
776  beg < end,
777  (std::string("Error reading periodic "
778  "boundary region definition "
779  "for boundary region: ") +
780  boundaryRegionIDStrm.str())
781  .c_str());
782 
783  bool parseGood = ParseUtils::GenerateSeqVector(
784  periodicBndRegionIndexStr.c_str(),
785  periodicBndRegionIndex);
786 
787  ASSERTL0(
788  parseGood &&
789  (periodicBndRegionIndex.size() == 1),
790  (std::string(
791  "Unable to read periodic boundary "
792  "condition for boundary region: ") +
793  boundaryRegionIDStrm.str())
794  .c_str());
795  }
796  attr = attr->Next();
797  }
798  BoundaryConditionShPtr periodicCondition(
800  AllocateSharedPtr(periodicBndRegionIndex[0],
801  userDefined,
802  boundaryRegionComm));
803  (*boundaryConditions)[*iter] = periodicCondition;
804  }
805  else
806  {
807  ASSERTL0(false, "Periodic boundary conditions should "
808  "be explicitely defined");
809  }
810  }
811  }
812  else if (conditionType == "C")
813  {
814  ASSERTL0(false, "Cauchy type boundary conditions not "
815  "implemented.");
816  }
817 
818  conditionElement = conditionElement->NextSiblingElement();
819  }
820 
821  m_boundaryConditions[boundaryRegionID] = boundaryConditions;
822  regionElement = regionElement->NextSiblingElement("REGION");
823  }
824 }
825 } // namespace SpatialDomains
826 } // namespace Nektar
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:215
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static bool GenerateSeqVector(const std::string &str, std::vector< unsigned int > &out)
Takes a comma-separated compressed string and converts it to entries in a vector.
Definition: ParseUtils.cpp:105
std::map< int, LibUtilities::CommSharedPtr > m_boundaryCommunicators
Definition: Conditions.h:278
BoundaryRegionCollection m_boundaryRegions
Definition: Conditions.h:275
void ReadBoundaryConditions(TiXmlElement *conditions)
Definition: Conditions.cpp:320
void Read(TiXmlElement *conditions)
Read segments (and general MeshGraph) given TiXmlDocument.
Definition: Conditions.cpp:214
LibUtilities::SessionReaderSharedPtr m_session
Definition: Conditions.h:273
BoundaryConditionCollection m_boundaryConditions
Definition: Conditions.h:277
std::map< int, std::string > m_boundaryLabels
Definition: Conditions.h:276
MeshGraphSharedPtr m_meshGraph
The mesh graph to use for referencing geometry info.
Definition: Conditions.h:272
void ReadBoundaryRegions(TiXmlElement *regions)
Definition: Conditions.cpp:232
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:54
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
Definition: Conditions.h:210
std::shared_ptr< BoundaryRegion > BoundaryRegionShPtr
Definition: Conditions.h:208
std::shared_ptr< BoundaryConditionBase > BoundaryConditionShPtr
Definition: Conditions.h:212
Array< OneD, int > ToArray(const std::set< int > &set)
Definition: Conditions.cpp:70
std::set< int > ShareAllBoundaryIDs(const BoundaryRegionCollection &boundaryRegions, LibUtilities::CommSharedPtr comm)
Definition: Conditions.cpp:90
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:172
std::shared_ptr< BoundaryConditionMap > BoundaryConditionMapShPtr
Definition: Conditions.h:218
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
Definition: StdRegions.hpp:444
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:2