oomph::Domain Class Referenceabstract

#include <domain.h>

+ Inheritance diagram for oomph::Domain:

Public Member Functions

 Domain ()
 Constructor. More...
 
 Domain (const Domain &)=delete
 Broken copy constructor. More...
 
void operator= (const Domain &)=delete
 Broken assignment operator. More...
 
virtual ~Domain ()
 
MacroElementmacro_element_pt (const unsigned &i)
 Access to i-th macro element. More...
 
unsigned nmacro_element ()
 Number of macro elements in domain. More...
 
void output (const std::string &filename, const unsigned &nplot)
 Output macro elements. More...
 
void output (std::ostream &outfile, const unsigned &nplot)
 Output macro elements. More...
 
virtual void macro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)=0
 
virtual void macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void output_macro_element_boundaries (const std::string &filename, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
void output_macro_element_boundaries (std::ostream &outfile, const unsigned &nplot)
 Output all macro element boundaries as tecplot zones. More...
 
virtual void dmacro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void dmacro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void dmacro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void d2macro_element_boundary (const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
virtual void d2macro_element_boundary (const double &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 
void d2macro_element_boundary (const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
 

Protected Attributes

Vector< MacroElement * > Macro_element_pt
 Vector of pointers to macro elements. More...
 

Detailed Description

Base class for Domains with curvilinear and/or time-dependent boundaries. Domain boundaries are typically represented by GeomObject s and the Domain itself is decomposed into a number of MacroElement s as shown in this 2D example:

Any instantiation of a specific Domain needs to implement the pure virtual member function

virtual void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)=0

which returns a Vector representation of each of the MacroElement s' boundaries, parametrised by the coordinate(s) along this boundary. For instance, in the above example, the eastern boundary of MacroElement 1 is given by the appropriate fraction of the curvilinear boundary; its northern boundary (which coincides with the southern boundary of MacroElement 2) is given by the straight line emanating from the curvilinear boundary, etc. The MacroElement s obtain their boundary positions via member function pointers to Domain::macro_element_boundary(...).

Constructor & Destructor Documentation

◆ Domain() [1/2]

oomph::Domain::Domain ( )
inline

Constructor.

71  {
72  // Make sure all containers are empty (a bit paranoid, I know...)
73  Macro_element_pt.resize(0);
74  }
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301

References Macro_element_pt.

◆ Domain() [2/2]

oomph::Domain::Domain ( const Domain )
delete

Broken copy constructor.

◆ ~Domain()

virtual oomph::Domain::~Domain ( )
inlinevirtual

Destructor: Strictly speaking, whoever creates an object dynamically should be responsible for the cleanup of said object but it makes sense here for the Domain to generically kill any MacroElements left over in the MacroElement container (if it hasn't already been done in the derived class) to avoid memory leaks.

88  {
89  // How many macro elements are there?
90  unsigned n_macro_element = Macro_element_pt.size();
91 
92  // Loop over the macro elements
93  for (unsigned i = 0; i < n_macro_element; i++)
94  {
95  // They might have already deleted (some or all of) the macro elements
96  // so skip them if they've already been made null pointers
97  if (Macro_element_pt[i] != 0)
98  {
99  // Delete the i-th macro element
100  delete Macro_element_pt[i];
101 
102  // Make it a null pointer
103  Macro_element_pt[i] = 0;
104  }
105  } // for (unsigned i=0;i<n_macro_element;i++)
106 
107  // Now clear the storage. NOTE: We can't just call this function
108  // as this would only delete the pointers to the macro elements,
109  // not the macro elements themselves!
110  Macro_element_pt.clear();
111 
112  } // End of ~Domain
int i
Definition: BiCGSTAB_step_by_step.cpp:9

References i, and Macro_element_pt.

Member Function Documentation

◆ d2macro_element_boundary() [1/3]

virtual void oomph::Domain::d2macro_element_boundary ( const double t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary seocond derivatives i_direct (e.g. N/S/W/E in 2D) at continuous time level t. Broken virtual.

278  {
279  throw OomphLibError(
280  "Domain::d2macro_element_boundary() is broken virtual.",
283  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ d2macro_element_boundary() [2/3]

void oomph::Domain::d2macro_element_boundary ( const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inline

Vector representation of the i_macro-th macro element boundary second derivatives i_direct (e.g. N/S/W/E in 2D) at current time: f(s).

292  {
293  // Call unsteady version for current time
294  unsigned t = 0;
295  d2macro_element_boundary(t, i_macro, i_direct, s, f);
296  }
virtual void d2macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
Definition: domain.h:258
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
RealScalar s
Definition: level1_cplx_impl.h:130
t
Definition: plotPSD.py:36

References d2macro_element_boundary(), f(), s, and plotPSD::t.

◆ d2macro_element_boundary() [3/3]

virtual void oomph::Domain::d2macro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary second derivatives i_direct (e.g. N/S/W/E in 2D) at time level t (t=0: present; t>0: previous): f(s). Broken virtual.

Reimplemented in oomph::TopologicallyRectangularDomain.

263  {
264  throw OomphLibError(
265  "Domain::d2macro_element_boundary() is broken virtual.",
268  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::QMacroElement< 2 >::assemble_macro_to_eulerian_jacobian2(), and d2macro_element_boundary().

◆ dmacro_element_boundary() [1/3]

virtual void oomph::Domain::dmacro_element_boundary ( const double t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary derivatives i_direct (e.g. N/S/W/E in 2D) at continuous time level t. Broken virtual.

233  {
234  throw OomphLibError(
235  "Domain::dmacro_element_boundary() is broken virtual.",
238  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ dmacro_element_boundary() [2/3]

void oomph::Domain::dmacro_element_boundary ( const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inline

Vector representation of the i_macro-th macro element boundary derivatives i_direct (e.g. N/S/W/E in 2D) at current time: f(s).

248  {
249  // Call unsteady version for current time
250  unsigned t = 0;
251  dmacro_element_boundary(t, i_macro, i_direct, s, f);
252  }
virtual void dmacro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)
Definition: domain.h:212

References dmacro_element_boundary(), f(), s, and plotPSD::t.

◆ dmacro_element_boundary() [3/3]

virtual void oomph::Domain::dmacro_element_boundary ( const unsigned t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary derivatives i_direct (e.g. N/S/W/E in 2D) at time level t (t=0: present; t>0: previous): f(s). Broken virtual.

Reimplemented in oomph::TopologicallyRectangularDomain.

217  {
218  throw OomphLibError(
219  "Domain::dmacro_element_boundary() is broken virtual.",
222  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::QMacroElement< 2 >::assemble_macro_to_eulerian_jacobian(), oomph::QMacroElement< 2 >::assemble_macro_to_eulerian_jacobian2(), and dmacro_element_boundary().

◆ macro_element_boundary() [1/3]

virtual void oomph::Domain::macro_element_boundary ( const double t,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inlinevirtual

Vector representation of the i_macro-th macro element boundary i_direct (e.g. N/S/W/E in 2D) at continuous time, t

Reimplemented in oomph::RectangleWithHoleAndAnnularRegionDomain.

165  {
166  // Throw an error
167  throw OomphLibError("Domain::macro_element_boundary() is broken virtual.",
170  } // End of macro_element_boundary

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ macro_element_boundary() [2/3]

void oomph::Domain::macro_element_boundary ( const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  f 
)
inline

Vector representation of the i_macro-th macro element boundary i_direct (e.g. N/S/W/E in 2D) at current time: f(s).

179  {
180  // Call unsteady version for current time
181  unsigned t = 0;
182  macro_element_boundary(t, i_macro, i_direct, s, f);
183  }

References f(), macro_element_boundary(), s, and plotPSD::t.

◆ macro_element_boundary() [3/3]

◆ macro_element_pt()

MacroElement* oomph::Domain::macro_element_pt ( const unsigned i)
inline

◆ nmacro_element()

◆ operator=()

void oomph::Domain::operator= ( const Domain )
delete

Broken assignment operator.

◆ output() [1/2]

void oomph::Domain::output ( const std::string &  filename,
const unsigned nplot 
)
inline

Output macro elements.

130  {
131  std::ofstream outfile;
132  outfile.open(filename.c_str());
133  output(outfile, nplot);
134  outfile.close();
135  }
void output(const std::string &filename, const unsigned &nplot)
Output macro elements.
Definition: domain.h:129
string filename
Definition: MergeRestartFiles.py:39

References MergeRestartFiles::filename.

Referenced by main().

◆ output() [2/2]

void oomph::Domain::output ( std::ostream &  outfile,
const unsigned nplot 
)
inline

Output macro elements.

139  {
140  unsigned nmacro = Macro_element_pt.size();
141  for (unsigned i_macro = 0; i_macro < nmacro; i_macro++)
142  {
143  Macro_element_pt[i_macro]->output(outfile, nplot);
144  }
145  }

References Macro_element_pt.

◆ output_macro_element_boundaries() [1/2]

void oomph::Domain::output_macro_element_boundaries ( const std::string &  filename,
const unsigned nplot 
)
inline

Output all macro element boundaries as tecplot zones.

189  {
190  std::ofstream outfile;
191  outfile.open(filename.c_str());
192  output_macro_element_boundaries(outfile, nplot);
193  outfile.close();
194  }
void output_macro_element_boundaries(const std::string &filename, const unsigned &nplot)
Output all macro element boundaries as tecplot zones.
Definition: domain.h:187

References MergeRestartFiles::filename.

Referenced by main().

◆ output_macro_element_boundaries() [2/2]

void oomph::Domain::output_macro_element_boundaries ( std::ostream &  outfile,
const unsigned nplot 
)
inline

Output all macro element boundaries as tecplot zones.

199  {
200  // Loop over macro elements
201  unsigned nmacro = nmacro_element();
202  for (unsigned i = 0; i < nmacro; i++)
203  {
205  }
206  }
unsigned nmacro_element()
Number of macro elements in domain.
Definition: domain.h:123
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
Definition: domain.h:116
virtual void output_macro_element_boundaries(std::ostream &outfile, const unsigned &nplot)=0
Output all macro element boundaries as tecplot zones.

References i, macro_element_pt(), nmacro_element(), and oomph::MacroElement::output_macro_element_boundaries().

Member Data Documentation

◆ Macro_element_pt


The documentation for this class was generated from the following file: