Chaste  Build::
DiscreteContinuumBoundaryCondition.hpp
1 /*
2 
3 Copyright (c) 2005-2016, University of Oxford.
4  All rights reserved.
5 
6  University of Oxford means the Chancellor, Masters and Scholars of the
7  University of Oxford, having an administrative office at Wellington
8  Square, Oxford OX1 2JD, UK.
9 
10  This file is part of Chaste.
11 
12  Redistribution and use in source and binary forms, with or without
13  modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34  */
35 
36 #ifndef DISCRETECONTINUUMBOUNDARYCONDITION_HPP_
37 #define DISCRETECONTINUUMBOUNDARYCONDITION_HPP_
38 
39 #include <vector>
40 #include <string>
41 #include "UblasIncludes.hpp"
42 #include "Part.hpp"
43 #include "BoundaryConditionsContainer.hpp"
44 #include "RegularGrid.hpp"
45 #include "DiscreteContinuumMesh.hpp"
46 #include "DimensionalChastePoint.hpp"
47 
52 {
56  enum Value
57  {
58  POINT, FACET, OUTER, VESSEL_LINE, VESSEL_VOLUME, CELL, IN_PART
59  };
60 };
61 
62 /*
63  * Helper struct for defining the source of the boundary condition value.
64  * It can be from a data array or a single prescribed value.
65  */
67 {
68  enum Value
69  {
70  LABEL_BASED, PRESCRIBED
71  };
72 };
73 
74 /*
75  * A class for describing boundary conditions for use with some DiscreteContinuum solvers.
76  */
77 template<unsigned DIM>
79 {
80 
81 protected:
82 
86  boost::shared_ptr<Part<DIM> > mpDomain;
87 
91  std::vector<DimensionalChastePoint<DIM> > mPoints;
92 
97 
101  BoundaryConditionSource::Value mSource;
102 
107  std::string mLabel;
108 
112  units::quantity<unit::concentration> mValue;
113 
117  boost::shared_ptr<RegularGrid<DIM> > mpRegularGrid;
118 
122  boost::shared_ptr<DiscreteContinuumMesh<DIM, DIM> > mpMesh;
123 
124  boost::shared_ptr<VesselNetwork <DIM> > mpNetwork;
125 
126  units::quantity<unit::concentration> mReferenceConcentration;
127 
128 public:
129 
134 
139 
143  static boost::shared_ptr<DiscreteContinuumBoundaryCondition<DIM> > Create();
144 
150 
155  units::quantity<unit::concentration> GetValue();
156 
157  void SetNetwork(boost::shared_ptr<VesselNetwork <DIM> > pNetwork);
158 
165  std::pair<bool, units::quantity<unit::concentration> > GetValue(DimensionalChastePoint<DIM> location, double tolerance);
166 
171  void UpdateBoundaryConditionContainer(boost::shared_ptr<BoundaryConditionsContainer<DIM, DIM, 1> > pContainer);
172 
173  void UpdateRegularGridPointBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > >pBoundaryConditions);
174 
175  void UpdateRegularGridFacetBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > >pBoundaryConditions);
176 
177  void UpdateRegularGridSegmentBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > >pBoundaryConditions);
178 
179  void UpdateRegularGridPartBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > >pBoundaryConditions);
180 
181  void UpdateRegularGridCellBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > >pBoundaryConditions);
182 
188  void UpdateRegularGridBoundaryConditions(boost::shared_ptr<std::vector<std::pair<bool, units::quantity<unit::concentration> > > > pBoundaryConditions);
189 
194  void SetDomain(boost::shared_ptr<Part<DIM> > pDomain);
195 
200  void SetLabelName(const std::string& label);
201 
206  void SetMesh(boost::shared_ptr<DiscreteContinuumMesh<DIM, DIM> > pMesh);
207 
212  void SetPoints(std::vector<DimensionalChastePoint<DIM> > points);
213 
218  void SetRegularGrid(boost::shared_ptr<RegularGrid<DIM> > pRegularGrid);
219 
224  void SetSource(BoundaryConditionSource::Value boundarySource);
225 
230  void SetType(BoundaryConditionType::Value boundaryType);
231 
236  void SetValue(units::quantity<unit::concentration> value);
237 };
238 
239 #endif /* DISCRETECONTINUUMBOUNDARYCONDITION_HPP_ */
boost::shared_ptr< RegularGrid< DIM > > mpRegularGrid
std::vector< DimensionalChastePoint< DIM > > mPoints
Definition: Part.hpp:60
units::quantity< unit::concentration > mValue
boost::shared_ptr< DiscreteContinuumMesh< DIM, DIM > > mpMesh