Mercurial > fem-fenics-eugenio
comparison src/boundarycondition.h @ 268:61830a4f9ab9
Improve formatting
author | Eugenio Gianniti <eugenio.gianniti@mail.polimi.it> |
---|---|
date | Thu, 14 Aug 2014 12:26:55 +0200 |
parents | ab35a8b0deef |
children |
comparison
equal
deleted
inserted
replaced
267:53039ac90368 | 268:61830a4f9ab9 |
---|---|
25 #include "dolfin_compat.h" | 25 #include "dolfin_compat.h" |
26 | 26 |
27 class boundarycondition : public octave_base_value | 27 class boundarycondition : public octave_base_value |
28 { | 28 { |
29 | 29 |
30 public: | 30 public: |
31 | 31 |
32 boundarycondition () | 32 boundarycondition () |
33 : octave_base_value () {} | 33 : octave_base_value () {} |
34 | 34 |
35 void | 35 void |
36 print (std::ostream& os, bool pr_as_read_syntax = false) const | 36 print (std::ostream & os, bool pr_as_read_syntax = false) const |
37 { | 37 { |
38 for (std::size_t i = 0; i < bcu.size (); ++i) | 38 for (std::size_t i = 0; i < bcu.size (); ++i) |
39 os << "Boundary condition : " << bcu[i]->str (true) << std::endl; | 39 { os << "Boundary condition : " << bcu[i]->str (true) << std::endl; } |
40 } | 40 } |
41 | 41 |
42 ~boundarycondition (void) {} | 42 ~boundarycondition (void) {} |
43 | 43 |
44 bool | 44 bool |
45 is_defined (void) const | 45 is_defined (void) const |
46 { return true; } | 46 { return true; } |
47 | 47 |
48 const std::vector< SHARED_PTR | 48 const std::vector< SHARED_PTR |
49 <const dolfin::DirichletBC> > & | 49 <const dolfin::DirichletBC> > & |
50 get_bc (void) const | 50 get_bc (void) const |
51 { return bcu; } | 51 { return bcu; } |
52 | 52 |
53 void | 53 void |
54 add_bc (const SHARED_PTR <const dolfin::FunctionSpace> & V, | 54 add_bc (const SHARED_PTR <const dolfin::FunctionSpace> & V, |
55 SHARED_PTR <const dolfin::GenericFunction> f, | 55 SHARED_PTR <const dolfin::GenericFunction> f, |
56 std::size_t n) | 56 std::size_t n) |
57 { | 57 { |
58 SHARED_PTR <const dolfin::DirichletBC> | 58 SHARED_PTR <const dolfin::DirichletBC> |
59 p (new dolfin::DirichletBC (V, f, n)); | 59 p (new dolfin::DirichletBC (V, f, n)); |
60 bcu.push_back(p); | 60 bcu.push_back (p); |
61 } | 61 } |
62 | 62 |
63 void | 63 void |
64 add_bc (SHARED_PTR <dolfin::FunctionSpace const> const & V, | 64 add_bc (SHARED_PTR <dolfin::FunctionSpace const> const & V, |
65 SHARED_PTR <dolfin::GenericFunction const> f, | 65 SHARED_PTR <dolfin::GenericFunction const> f, |
66 SHARED_PTR <dolfin::MeshFunction <std::size_t> const> const & sd, | 66 SHARED_PTR <dolfin::MeshFunction <std::size_t> const> const & sd, |
67 std::size_t n) | 67 std::size_t n) |
68 { | 68 { |
69 SHARED_PTR <dolfin::DirichletBC const> | 69 SHARED_PTR <dolfin::DirichletBC const> |
70 p (new dolfin::DirichletBC (V, f, sd, n)); | 70 p (new dolfin::DirichletBC (V, f, sd, n)); |
71 bcu.push_back(p); | 71 bcu.push_back (p); |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 | 75 |
76 std::vector<SHARED_PTR | 76 std::vector<SHARED_PTR |
77 <const dolfin::DirichletBC> > bcu; | 77 <const dolfin::DirichletBC> > bcu; |
78 | 78 |
79 DECLARE_OCTAVE_ALLOCATOR; | 79 DECLARE_OCTAVE_ALLOCATOR; |
80 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; | 80 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA; |
81 | 81 |
82 }; | 82 }; |
83 | 83 |
84 static bool boundarycondition_type_loaded = false; | 84 static bool boundarycondition_type_loaded = false; |
85 | 85 |
86 DEFINE_OCTAVE_ALLOCATOR (boundarycondition); | 86 DEFINE_OCTAVE_ALLOCATOR (boundarycondition); |
87 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (boundarycondition, | 87 DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA (boundarycondition, |
88 "boundarycondition", | 88 "boundarycondition", |
89 "boundarycondition"); | 89 "boundarycondition"); |
90 #endif | 90 #endif |