LifeV
BCBase.cpp
Go to the documentation of this file.
1 //@HEADER
2 /*
3  *******************************************************************************
4 
5  Copyright (C) 2004, 2005, 2007 EPFL, Politecnico di Milano, INRIA
6  Copyright (C) 2010 EPFL, Politecnico di Milano, Emory University
7 
8  This file is part of LifeV.
9 
10  LifeV is free software; you can redistribute it and/or modify
11  it under the terms of the GNU Lesser General Public License as published by
12  the Free Software Foundation, either version 3 of the License, or
13  (at your option) any later version.
14 
15  LifeV is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Lesser General Public License for more details.
19 
20  You should have received a copy of the GNU Lesser General Public License
21  along with LifeV. If not, see <http://www.gnu.org/licenses/>.
22 
23  *******************************************************************************
24  */
25 //@HEADER
26 
27 /*!
28  @file
29  @brief classes to handle boundary conditions
30 
31  @author M.A. Fernandez
32  @contributor Lucia Mirabella <lucia.mirabell@gmail.com>
33  @contributor Mauro Perego <perego.mauro@gmail.com>
34  @maintainer Mauro Perego <perego.mauro@gmail.com>
35 
36  @date 06-2002
37 
38  @date 11-2002
39 
40  This file contains the classes which may be used to store boundary
41  conditions. A boundary condition object will have the following
42  elements:
43 <ol>
44  <li> a name identifying a specific BC,
45 
46  <li> a flag identifying a specific part of the mesh boundary,
47 
48  <li> a type (Essential, Natural, Robin, Flux, Resistance),
49 
50  <li> a mode of implementation (Scalar, Full, Component, Normal,
51  Tangential, Resistance, Directional),
52 
53  <li> a functor holding the data function,
54 
55  <li> a bool vector describing the components involved in this boundary condition
56 
57  <li> a list of pointers to identifiers allowing the user to know to
58  which DOF the boundary condition applies.
59 </ol>
60 
61  */
62 
63 #include <lifev/core/LifeV.hpp>
64 #include <lifev/core/fem/BCBase.hpp>
65 
66 namespace LifeV
67 {
68 
69 // ===================================================
70 // Constructors & Destructor
71 // ===================================================
72 
74 {
75 }
76 
77 BCBase::BCBase ( const bcName_Type& name, const bcFlag_Type& flag,
78  const bcType_Type& type, const bcMode_Type& mode,
79  BCFunctionBase& bcFunction, const bcComponentsVec_Type& components )
80  :
81  M_name ( name ),
82  M_flag ( flag ),
83  M_type ( type ),
84  M_mode ( mode ),
85  M_components ( components ),
88  M_bcVector(),
89  M_isStored_BcVector ( false ),
91  M_offset ( -1 ),
92  M_finalized ( false )
93 {
94  if ( M_mode != Component )
95  {
96  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
97  }
98 }
99 
100 BCBase::BCBase ( const bcName_Type& name,
101  const bcFlag_Type& flag,
102  const bcType_Type& type,
103  const bcMode_Type& mode,
104  BCFunctionBase& bcFunction ) :
105  M_name ( name ),
106  M_flag ( flag ),
107  M_type ( type ),
108  M_mode ( mode ),
109  M_components(),
112  M_bcVector(),
113  M_isStored_BcVector ( false ),
115  M_offset ( -1 ),
116  M_finalized ( false )
117 {
118  UInt numberOfComponents;
119  switch ( M_mode = mode )
120  {
121  case Scalar:
122  numberOfComponents = 1;
123  M_components.reserve ( numberOfComponents );
124  M_components.push_back ( 0 );
125  break;
126  case Tangential:
127  numberOfComponents = nDimensions - 1;
128  M_components.reserve ( numberOfComponents );
129  for ( ID i = 0; i < numberOfComponents; ++i )
130  {
131  M_components.push_back ( i );
132  }
133  break;
134  case Normal:
135  // Normal Essential boundary condition (cf Gwenol Grandperrin Master Thesis)
136  if (type == Essential)
137  {
138  numberOfComponents = 1;
139  M_components.reserve ( numberOfComponents );
140  M_components.push_back ( nDimensions - 1 );
141  }
142  else
143  {
144  numberOfComponents = nDimensions;
145  M_components.reserve ( numberOfComponents );
146  for ( ID i = 0; i < numberOfComponents; ++i )
147  {
148  M_components.push_back ( i );
149  }
150  }
151  break;
152  case Directional:
153  numberOfComponents = 1;
154  M_components.reserve ( numberOfComponents );
155  M_components.push_back ( nDimensions - 1 );
156  break;
157  default:
158  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
159  }
160 }
161 
162 BCBase::BCBase ( const bcName_Type& name,
163  const bcFlag_Type& flag,
164  const bcType_Type& type,
165  const bcMode_Type& mode,
166  BCFunctionBase& bcFunction,
167  const UInt& numberOfComponents )
168  :
169  M_name ( name ),
170  M_flag ( flag ),
171  M_type ( type ),
172  M_mode ( mode ),
173  M_components(),
176  M_bcVector(),
177  M_isStored_BcVector ( false ),
179  M_offset ( -1 ),
180  M_finalized ( false )
181 {
182  if ( M_mode != Full )
183  {
184  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
185  }
186  M_components.reserve ( numberOfComponents );
187  for ( ID i = 0; i < numberOfComponents; ++i )
188  {
189  M_components.push_back ( i );
190  }
191 
192 }
193 
194 
195 BCBase::BCBase ( const bcName_Type& name,
196  const bcFlag_Type& flag,
197  const bcType_Type& type,
198  const bcMode_Type& mode,
199  BCVectorBase& bcVector,
200  const bcComponentsVec_Type& components )
201  :
202  M_name ( name ),
203  M_flag ( flag ),
204  M_type ( type ),
205  M_mode ( mode ),
206  M_components (components),
207  M_bcFunction(),
209  M_bcVector ( bcVector.clone() ),
210  M_isStored_BcVector ( true ),
212  M_offset ( -1 ),
213  M_finalized ( false )
214 {
215  if ( mode != Component )
216  {
217  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
218  }
219 }
220 
221 BCBase::BCBase ( const bcName_Type& name,
222  const bcFlag_Type& flag,
223  const bcType_Type& type,
224  const bcMode_Type& mode,
225  BCVectorBase& bcVector )
226  :
227  M_name ( name ),
228  M_flag ( flag ),
229  M_type ( type ),
230  M_mode ( mode ),
231  M_components(),
232  M_bcFunction(),
234  M_bcVector ( bcVector.clone() ),
235  M_isStored_BcVector ( true ),
237  M_offset ( 0 ), // The others are initialize to -1 we should follow a common convention.
238  M_finalized ( false )
239 {
240  UInt numberOfComponents;
241  switch ( M_mode = mode )
242  {
243  case Scalar:
244  numberOfComponents = 1;
245  M_components.reserve ( numberOfComponents );
246  M_components.push_back ( 0 );
247 
248  break;
249  case Tangential:
250  numberOfComponents = nDimensions - 1;
251  M_components.reserve ( numberOfComponents );
252  for ( ID i = 0; i < numberOfComponents; ++i )
253  {
254  M_components.push_back ( i );
255  }
256 
257  break;
258  case Normal:
259  numberOfComponents = 1;
260  M_components.reserve ( numberOfComponents );
261  M_components.push_back ( nDimensions - 1 );
262 
263  break;
264  case Directional:
265  numberOfComponents = 1;
266  M_components.reserve ( numberOfComponents );
267  M_components.push_back ( nDimensions - 1 );
268  break;
269  default:
270  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
271  }
272 }
273 
274 
275 BCBase::BCBase ( const bcName_Type& name,
276  const bcFlag_Type& flag,
277  const bcType_Type& type,
278  const bcMode_Type& mode,
279  BCVectorBase& bcVector,
280  const UInt& numberOfComponents )
281  :
282  M_name ( name ),
283  M_flag ( flag ),
284  M_type ( type ),
285  M_mode ( mode ),
286  M_components(),
287  M_bcFunction(),
289  M_bcVector ( bcVector.clone() ),
290  M_isStored_BcVector ( true ),
292  M_offset ( -1 ),
293  M_finalized ( false )
294 {
295  if ( mode != Full )
296  {
297  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
298  }
299 
300  M_components.reserve ( numberOfComponents );
301  for ( ID i = 0; i < numberOfComponents; ++i )
302  {
303  M_components.push_back ( i );
304  }
305 
306 }
307 
308 BCBase::BCBase ( const bcName_Type& name,
309  const bcFlag_Type& flag,
310  const bcType_Type& type,
311  const bcMode_Type& mode,
312  BCFunctionUDepBase& bcFunctionFEVectorDependent,
313  const bcComponentsVec_Type& components ) :
314  M_name ( name ),
315  M_flag ( flag ),
316  M_type ( type ),
317  M_mode ( mode ),
318  M_components ( components ),
319  M_bcFunction(),
321  M_bcVector(),
322  M_isStored_BcVector ( false ),
324  M_offset ( 0 ), // The others are initialize to -1 we should follow a common convention.
325  M_finalized ( false )
326 {
327  if ( M_mode != Component )
328  {
329  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
330  }
331 }
332 
333 BCBase::BCBase ( const bcName_Type& name,
334  const bcFlag_Type& flag,
335  const bcType_Type& type,
336  const bcMode_Type& mode,
337  BCFunctionUDepBase& bcFunctionFEVectorDependent) :
338  M_name ( name ),
339  M_flag ( flag ),
340  M_type ( type ),
341  M_mode ( mode ),
342  M_components(),
343  M_bcFunction(),
345  M_bcVector(),
346  M_isStored_BcVector ( false ),
348  M_offset ( -1 ),
349  M_finalized ( false )
350 {
351 
352  UInt numberOfComponents;
353  switch ( M_mode = mode )
354  {
355  case Scalar:
356  numberOfComponents = 1;
357  M_components.reserve ( numberOfComponents );
358  M_components.push_back ( 0 );
359  break;
360  case Tangential:
361  numberOfComponents = nDimensions - 1;
362  M_components.reserve ( numberOfComponents );
363  for ( ID i = 0; i < numberOfComponents; ++i )
364  {
365  M_components.push_back ( i );
366  }
367  break;
368  case Normal:
369  numberOfComponents = 1;
370  M_components.reserve ( numberOfComponents );
371  M_components.push_back ( nDimensions - 1 );
372  break;
373  case Directional:
374  numberOfComponents = 1;
375  M_components.reserve ( numberOfComponents );
376  M_components.push_back ( nDimensions - 1);
377  break;
378  default:
379  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
380  }
381 
382 }
383 
384 BCBase::BCBase ( const bcName_Type& name,
385  const bcFlag_Type& flag,
386  const bcType_Type& type,
387  const bcMode_Type& mode,
388  BCFunctionUDepBase& bcFunctionFEVectorDependent,
389  const UInt& numberOfComponents )
390  :
391  M_name ( name ),
392  M_flag ( flag ),
393  M_type ( type ),
394  M_mode ( mode ),
395  M_components(),
396  M_bcFunction(),
398  M_bcVector(),
399  M_isStored_BcVector ( false ),
401  M_offset ( -1 ),
402  M_finalized ( false )
403 {
404  if ( M_mode != Full )
405  {
406  ERROR_MSG ( "BCBase::BCBase: You should use a more specific constructor for this mode" );
407  }
408 
409  M_components.reserve ( numberOfComponents );
410  for ( ID i = 0; i < numberOfComponents; ++i )
411  {
412  M_components.push_back ( i );
413  }
414 
415 }
416 
417 BCBase::BCBase ( const BCBase& bcBase ) :
418  M_name ( bcBase.M_name ),
419  M_flag ( bcBase.M_flag ),
420  M_type ( bcBase.M_type ),
421  M_mode ( bcBase.M_mode ),
422  M_components ( bcBase.M_components ),
423  M_bcFunction ( ),
425  M_bcVector ( ),
428  M_idSet ( ),
429  M_idVector ( ),
430  M_offset ( bcBase.M_offset ),
431  M_finalized ( bcBase.M_finalized )
432 {
433  // If the shared_ptr is not empty we make a true copy
434  if ( bcBase.M_bcFunction.get() != 0 )
435  {
436  M_bcFunction = bcBase.M_bcFunction->clone();
437  }
438  if ( bcBase.M_bcFunctionFEVectorDependent.get() != 0 )
439  {
440  M_bcFunctionFEVectorDependent = bcBase.M_bcFunctionFEVectorDependent->clone();
441  }
442  if ( bcBase.M_bcVector.get() != 0 )
443  {
444  M_bcVector = bcBase.M_bcVector->clone();
445  }
446 
447  // Important!!: The set member M_idSet is always empty at this point, it is just
448  // an auxiliary container used at the moment of the boundary update (see BCHandler::bcUpdate)
449 
450  // The list of ID's must be empty
451  if ( !M_idVector.empty() || !bcBase.M_idVector.empty() )
452  {
453  ERROR_MSG ( "BCBase::BCBase : The BC copy constructor does not work with list of identifiers which are not empty" );
454  }
455 }
456 
457 
459 {
460 }
461 
462 // ===================================================
463 // Methods
464 // ===================================================
465 
466 ID BCBase::component ( const ID i ) const
467 {
468  ASSERT_BD ( i < M_components.size() );
469  return M_components[ i ];
470 }
471 
473 {
474  if ( M_isStored_BcVector )
475  {
476  return (*M_bcVector).isRobinCoeffAVector();
477  }
478  else
479  {
480  ERROR_MSG ( "BCBase::Robin : A data vector must be specified before calling this method" );
481  return 0.;
482  }
483 }
484 
486 {
487  if ( M_isStored_BcVector )
488  {
489 
490  return (*M_bcVector).isBetaCoeffAVector();
491  }
492  else
493  {
494  ERROR_MSG ( "BCBase::beta: A data vector must be specified before calling this method" );
495  return 0.;
496  }
497 }
498 
499 
500 Real BCBase::robinCoeffVector ( const ID& iDof, const ID& iComponent ) const
501 {
502  if ( M_isStored_BcVector )
503  {
504  return ( *M_bcVector).robinCoeffVector ( iDof, iComponent );
505  }
506  else
507  {
508  ERROR_MSG ( "BCBase::RobinVec : A data vector must be specified before calling this method" );
509  return 0.;
510  }
511 }
512 
513 Real BCBase::betaCoeffVector ( const ID& iDof, const ID& iComponent ) const
514 {
515  if ( M_isStored_BcVector )
516  {
517  return ( *M_bcVector).betaCoeffVector ( iDof, iComponent );
518  }
519  else
520  {
521  ERROR_MSG ( "BCBase::RobinVec : A data vector must be specified before calling this method" );
522  return 0.;
523  }
524 
525 }
526 
527 
529 {
530  return M_bcFunction.get();
531 }
532 
534 {
535  return M_bcFunctionFEVectorDependent.get();
536 }
537 
539 {
540  return M_bcVector.get();
541 }
542 
543 void
544 BCBase::addBCIdentifier ( BCIdentifierBase* identifierToAddPtr )
545 {
546  M_idSet.insert ( std::shared_ptr<BCIdentifierBase> ( identifierToAddPtr ) );
547 }
548 
549 
550 UInt
552 {
553  return M_idVector.size();
554 }
555 
556 std::ostream&
557 BCBase::showMe ( bool verbose, std::ostream& out ) const
558 {
559  out << "********************************" << std::endl;
560  out << "BC Name : " << M_name << std::endl;
561  out << "Flag : " << M_flag << std::endl;
562  out << "Type : " << M_type << std::endl;
563  out << "Mode : " << M_mode << std::endl;
564  out << "Number of components : " << M_components.size() << std::endl;
565  out << "List of components : ";
566  for ( ID i = 0; i < M_components.size(); ++i )
567  {
568  out << M_components[ i ] << " ";
569  }
570  out << std::endl;
571  out << "Offset : " << M_offset << std::endl;
572  out << "Number of stored ID's: " << M_idVector.size() << std::endl;
573 
574  if ( verbose && M_finalized )
575  {
576  unsigned int count ( 0 ), lines ( 10 );
577  out << "IDs in list";
578  for ( std::vector<std::shared_ptr<BCIdentifierBase> >::const_iterator i = M_idVector.begin();
579  i != M_idVector.end(); ++i )
580  {
581  if ( count++ % lines == 0 )
582  {
583  out << std::endl;
584  }
585  out << ( *i ) ->id() << " ";
586  }
587  if ( count % lines != 0 )
588  {
589  out << std::endl;
590  }
591  if ( isDataAVector() )
592  {
593  M_bcVector->showMe ( verbose, out );
594  }
595  }
596 
597  out << "********************************" << std::endl;
598  return out;
599 }
600 
601 
602 // ===================================================
603 // Operators
604 // ===================================================
605 
606 BCBase& BCBase::operator= ( const BCBase& BCb )
607 {
608 
609  M_name = BCb.M_name;
610  M_flag = BCb.M_flag;
611  M_type = BCb.M_type;
612  M_mode = BCb.M_mode;
615  M_bcFunctionFEVectorDependent = BCb.M_bcFunctionFEVectorDependent;
616  M_bcFunction = BCb.M_bcFunction;
617  M_bcVector = BCb.M_bcVector;
620  M_offset = BCb.M_offset;
623 
624  // Important!!: The set member M_idSet is always empty at this
625  // point, it is just an auxiliary container used at the moment of
626  // the boundary update (see BCHandler::bcUpdate)
627 
628  // The list of ID's must be empty
629  if ( !M_idVector.empty() || !BCb.M_idVector.empty() )
630  {
631  ERROR_MSG ( "BCBase::operator= : The BC assigment operator does not work with lists of identifiers which are not empty" );
632  }
633 
634  return *this;
635 }
636 
637 const BCIdentifierBase*
638 BCBase::operator[] ( const ID& i ) const
639 {
640  ASSERT_PRE ( M_finalized, "BC List should be finalized before being accessed" );
641  ASSERT_BD ( i < M_idVector.size() );
642  return M_idVector[ i ].get();
643 }
644 
645 Real BCBase::operator() ( const Real& t, const Real& x, const Real& y,
646  const Real& z, const ID& iComponent ) const
647 {
648  return M_bcFunction->operator() ( t, x, y, z, iComponent );
649 }
650 
651 Real BCBase::operator() ( const Real& t, const Real& x, const Real& y,
652  const Real& z, const ID& iComponent, const Real& u ) const
653 {
654  /* is there a better way ? */
655  debugStream (800) << "debug800 in BCBase::operator(6x)\n";
656  return M_bcFunctionFEVectorDependent->operator() (t, x, y, z, iComponent, u);
657  debugStream (800) << "debug800 out BCBase::operator(6x)\n";
658 }
659 
660 Real BCBase::operator() ( const ID& iDof, const ID& iComponent ) const
661 {
662  if ( M_isStored_BcVector )
663  {
664  return ( *M_bcVector ) ( iDof, iComponent );
665  }
666  else
667  {
668  ERROR_MSG ( "BCBase::operator() : A data vector must be specified before calling this method" );
669  return 0.;
670  }
671 }
672 
673 
674 // ===================================================
675 // Set Methods
676 // ===================================================
677 
678 void
679 BCBase::setBCVector ( const BCVectorBase& bcVector )
680 {
681  M_bcVector = std::shared_ptr<BCVectorBase > ( bcVector.clone() );
682  M_isStored_BcVector = true;
684 }
685 
686 void
687 BCBase::setBCFunction ( const BCFunctionBase& bcFunction )
688 {
689  M_bcFunction = bcFunction.clone();
690  M_isStored_BcVector = false;
692 }
693 
694 void
695 BCBase::setBCFunction ( const BCFunctionUDepBase& bcFunctionFEVectorDependent )
696 {
697  M_bcFunctionFEVectorDependent = bcFunctionFEVectorDependent.clone();
698  M_isStored_BcVector = false;
700 }
701 
702 
703 // ===================================================
704 // Get Methods
705 // ===================================================
706 
707 std::string BCBase::name() const
708 {
709  return M_name;
710 }
711 
713 {
714  return M_flag;
715 }
716 
718 {
719  return M_type;
720 }
721 
723 {
724  return M_mode;
725 }
726 
728 {
729  return M_components.size();
730 }
731 
733 {
734  if ( M_isStored_BcVector )
735  {
736  return ( *M_bcVector ).robinCoeff();
737  }
738  else
739  {
740  ERROR_MSG ( "BCBase::robinCoef : A data vector must be specified before calling this method" );
741  return 0.;
742  }
743 
744 }
745 
747 {
748  if ( M_isStored_BcVector )
749  {
750  return ( *M_bcVector ).resistanceCoeff();
751  }
752  else
753  {
754  ERROR_MSG ( "BCBase::resistanceCoef : A data vector must be specified before calling this method" );
755  return 0.;
756  }
757 
758 }
759 
761 {
762  if ( M_isStored_BcVector )
763  {
764  return ( *M_bcVector ).betaCoeff();
765  }
766  else
767  {
768  ERROR_MSG ( "BCBase::robinCoef : A data vector must be specified before calling this method" );
769  return 0.;
770  }
771 
772 }
773 
774 bool BCBase::isDataAVector() const
775 {
776  return M_isStored_BcVector;
777 }
778 
779 bool BCBase::finalized() const
780 {
781  return M_finalized;
782 }
783 
784 bool BCBase::isUDep() const
785 {
787 }
788 
789 
790 // ===================================================
791 // Private Methods
792 // ===================================================
793 
794 void
796 {
797  if ( ! M_idSet.empty() )
798  {
799  M_idVector.clear();
800  M_idVector.reserve ( M_idSet.size() );
801  std::copy ( M_idSet.begin(), M_idSet.end(), std::inserter ( M_idVector, M_idVector.end() ) );
802  M_idSet.clear();
803  }
804  M_finalized = true;
805 }
806 
807 
808 }
BCBase & operator=(const BCBase &bcBase)
The assignment operator for BCBase.
Definition: BCBase.cpp:606
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCVectorBase &vector, const bcComponentsVec_Type &components)
Constructor for BCBase to prescribe a boundary condition from a vector of dof values.
Definition: BCBase.cpp:195
bool isBetaCoeffAVector() const
Returns true if beta coefficient (in BC Vector ) is a VectorEpetra (betaVec) (default betaCoef=1) ...
Definition: BCBase.cpp:485
bool isRobinCoeffAVector() const
Returns true if robin coefficient (in BC Vector ) is a VectorEpetra, false if it is scalar (default a...
Definition: BCBase.cpp:472
bcMode_Type M_mode
the boundary condition mode of application
Definition: BCBase.hpp:631
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCVectorBase &bcVector, const UInt &numberOfComponents)
Constructor for BCBase to prescribe a boundary condition from a vector of dof values without specifyi...
Definition: BCBase.cpp:275
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionUDepBase &bcFunctionFEVectorDependent, const UInt &numberOfComponents)
Constructor for BCBase without specifying components for Full mode problems. The BC function depends ...
Definition: BCBase.cpp:384
bcType_Type type() const
Returns the boundary condition type.
Definition: BCBase.cpp:717
BCFunctionUDepBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:380
markerID_Type bcFlag_Type
Definition: BCBase.hpp:118
Real betaCoeffVector(const ID &iDof, const ID &iComponent) const
Returns the value of the beta coefficient vector (in BC Vector)
Definition: BCBase.cpp:513
#define ASSERT_BD(X)
Definition: LifeAssert.hpp:114
Real robinCoeffVector(const ID &iDof, const ID &iComponent) const
Returns the value of the robin coefficient vector (in BC Vector)
Definition: BCBase.cpp:500
bcComponentsVec_Type M_components
Definition: BCBase.hpp:633
#define debugStream
Definition: LifeDebug.hpp:182
void addBCIdentifier(BCIdentifierBase *identifierToAddPtr)
Adds a new identifier to the list.
Definition: BCBase.cpp:544
Real betaCoeff() const
Returns the value of the beta coefficient (in BC Vector)
Definition: BCBase.cpp:760
std::string M_name
name of the boundary condition
Definition: BCBase.hpp:625
bcMode_Type
Definition: BCBase.hpp:102
bcFlag_Type flag() const
Returns the flag associated to the boundary condition name.
Definition: BCBase.cpp:712
bool M_isStored_BcVector
Definition: BCBase.hpp:641
bcType_Type M_type
the boundary condition type
Definition: BCBase.hpp:629
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionBase &bcFunction, const UInt &numberOfComponents)
Constructor for BCBase without specifying components for without list of components for Full mode pro...
Definition: BCBase.cpp:162
bool isDataAVector() const
Returns True if a FE BCVector has been provided to the class, False otherwise.
Definition: BCBase.cpp:774
void updateInverseJacobian(const UInt &iQuadPt)
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionBase &bcFunction, const bcComponentsVec_Type &components)
Constructor for BCBase.
Definition: BCBase.cpp:77
Real operator()(const Real &t, const Real &x, const Real &y, const Real &z, const ID &iComponent) const
Overloading function operator by calling the BCFunctionBase user specified function.
Definition: BCBase.cpp:645
BCFunctionBase - class that holds the function used for prescribing boundary conditions.
Definition: BCFunction.hpp:77
UInt numberOfComponents() const
Returns the number of components involved in this boundary condition.
Definition: BCBase.cpp:727
#define ERROR_MSG(A)
Definition: LifeAssert.hpp:69
std::vector< ID > bcComponentsVec_Type
Definition: BCBase.hpp:120
bool M_finalized
True, when M_idVector is finalized.
Definition: BCBase.hpp:651
BCVectorBase - class that holds the FE vectors used for prescribing boundary conditions.
Definition: BCVector.hpp:74
#define ASSERT_PRE(X, A)
Definition: LifeAssert.hpp:96
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionUDepBase &bcFunctionFEVectorDependent)
Constructor for BCBase without specifying components for Scalar, Tangential or Normal mode problems...
Definition: BCBase.cpp:333
uint32_type ID
IDs.
Definition: LifeV.hpp:194
void setBCFunction(const BCFunctionBase &bcFunction)
set BCFunctionBase boundary condition
Definition: BCBase.cpp:687
bcMode_Type mode() const
Returns the boundary condition mode.
Definition: BCBase.cpp:722
void setBCVector(const BCVectorBase &bcVector)
set BCVectorBase boundary condition
Definition: BCBase.cpp:679
bool M_isStored_BcFunctionVectorDependent
True if a FE BCVector has been provided.
Definition: BCBase.hpp:643
BCBase()
Empty constructor.
Definition: BCBase.cpp:73
bool finalized() const
Returns whether the list is finalized and the vector of ID&#39;s is then accessible.
Definition: BCBase.cpp:779
Real operator()(const ID &iDof, const ID &iComponent) const
Overloading function operator by querying the BCVector in DOF iDof and component iComponent.
Definition: BCBase.cpp:660
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCVectorBase &bcVector)
Constructor for BCBase to prescribe a boundary condition from a vector of dof values without specifyi...
Definition: BCBase.cpp:221
std::string bcName_Type
Definition: BCBase.hpp:116
bool isUDep() const
Returns True if the BCBase is based on a BCFunctionUDepBase function, False otherwise.
Definition: BCBase.cpp:784
BCIdentifierBase - Base class holding DOF identifiers for implementing BC.
int M_offset
boundary condition offset
Definition: BCBase.hpp:649
Real resistanceCoeff() const
Returns the value of the resistance coefficient (in BC Vector)
Definition: BCBase.cpp:746
std::ostream & showMe(bool verbose=false, std::ostream &outStream=std::cout) const
Method that writes info in output.
Definition: BCBase.cpp:557
double Real
Generic real data.
Definition: LifeV.hpp:175
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionBase &bcFunction)
Constructor for BCBase without specifying components for Scalar, Tangential or Normal mode problems...
Definition: BCBase.cpp:100
const BCIdentifierBase * operator[](const ID &i) const
Returns a pointer to the (i)-th element of the list of identifiers.
Definition: BCBase.cpp:638
bcType_Type
Definition: BCBase.hpp:88
NdebugStream noDebugStream(int=0, NdebugStream::stprintf=&printf)
Definition: LifeDebug.hpp:183
const UInt nDimensions(NDIM)
void setBCFunction(const BCFunctionUDepBase &bcFunctionFEVectorDependent)
set BCFunctionUDepBase boundary condition
Definition: BCBase.cpp:695
ID component(const ID i) const
Returns the index of the component of the solution associated to the iComponent-th component prescrib...
Definition: BCBase.cpp:466
const BCFunctionBase * pointerToFunctor() const
Returns a pointer to the BCFunctionBase object.
Definition: BCBase.cpp:528
Real operator()(const Real &t, const Real &x, const Real &y, const Real &z, const ID &iComponent, const Real &u) const
Overloading function operator by calling the BCFunctionUDepBase user specified function.
Definition: BCBase.cpp:651
UInt list_size() const
Returns the size of the identifiers list.
Definition: BCBase.cpp:551
~BCBase()
Destructor.
Definition: BCBase.cpp:458
void copyIdSetIntoIdVector()
Definition: BCBase.cpp:795
bcFlag_Type M_flag
flag identifying a specific part of the mesh boundary
Definition: BCBase.hpp:627
std::vector< std::shared_ptr< BCIdentifierBase > > M_idVector
container for id&#39;s when the list is finalized
Definition: BCBase.hpp:647
std::string name() const
Returns the boundary condition name.
Definition: BCBase.cpp:707
Real robinCoeff() const
Returns the value of the robin coefficient (in BC Vector)
Definition: BCBase.cpp:732
const BCFunctionUDepBase * pointerToFunctorUDep() const
Returns a pointer to the BCFunctionUDepBase object.
Definition: BCBase.cpp:533
BCBase(const bcName_Type &name, const bcFlag_Type &flag, const bcType_Type &type, const bcMode_Type &mode, BCFunctionUDepBase &bcFunctionFEVectorDependent, const bcComponentsVec_Type &components)
Constructor for BCBase. The BC function depends on a generic FE vector (e.g. the solution at the prev...
Definition: BCBase.cpp:308
uint32_type UInt
generic unsigned integer (used mainly for addressing)
Definition: LifeV.hpp:191
const BCVectorBase * pointerToBCVector() const
Returns a pointer to the BCVector object.
Definition: BCBase.cpp:538
BCBase(const BCBase &bcBase)
Copy constructor for BCBase.
Definition: BCBase.cpp:417