oomph::ExtrudedDomain Class Reference

#include <extruded_domain.h>

+ Inheritance diagram for oomph::ExtrudedDomain:

Public Member Functions

 ExtrudedDomain (Domain *domain_pt, const unsigned &n_extruded_element, const double &extrusion_length)
 Constructor. More...
 
 ExtrudedDomain (Domain *domain_pt, const unsigned &n_extruded_element, const double &t_min, const double &t_max)
 Constructor. More...
 
 ~ExtrudedDomain ()
 Destructor: Empty; the extruded macro elements will be deleted in Domain. More...
 
 ExtrudedDomain (const ExtrudedDomain &)=delete
 Broken copy constructor. More...
 
void operator= (const ExtrudedDomain &)=delete
 Broken assignment operator. More...
 
ExtrudedMacroElementmacro_element_pt (const unsigned &i)
 Access to i-th extruded macro element. More...
 
unsigned nmacro_element ()
 Number of macro elements in domain. More...
 
void macro_element_boundary (const unsigned &time, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &x)
 
- Public Member Functions inherited from oomph::Domain
 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 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)
 

Private Attributes

DomainDomain_pt
 Pointer to the Domain. More...
 
unsigned N_extruded_element
 
double T_min
 The minimum t-value (defaults to 0.0 if not specified) More...
 
double T_max
 The maximum t-value. More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::Domain
Vector< MacroElement * > Macro_element_pt
 Vector of pointers to macro elements. More...
 

Detailed Description

Base class for ExtrudedDomains with curvilinear and/or time-dependent boundaries. ExtrudedDomain boundaries are typically represented by GeomObjects and the ExtrudedDomain itself is decomposed into a number of ExtrudedMacroElements. Any instantiation of a specific ExtrudedDomain needs to implement the pure virtual member function

void macro_element_boundary(const unsigned &time, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &x)
Definition: extruded_domain.cc:148

which returns a Vector representation of each of the ExtrudedMacroElements' boundaries, parametrised by the coordinate(s) along this boundary. The ExtrudedMacroElements obtain their boundary positions via member function pointers to ExtrudedDomain::macro_element_boundary(...).

Constructor & Destructor Documentation

◆ ExtrudedDomain() [1/3]

oomph::ExtrudedDomain::ExtrudedDomain ( Domain domain_pt,
const unsigned n_extruded_element,
const double extrusion_length 
)

Constructor.

38  : Domain(),
39  Domain_pt(domain_pt),
40  N_extruded_element(n_extruded_element),
41  T_min(0.0),
42  T_max(extrusion_length)
43  {
44  // The number of macro elements to create in the extruded domain
45  unsigned n_macro_element =
47 
48  // There are four macro elements
49  Macro_element_pt.resize(n_macro_element);
50 
51  // Build the 3D extruded macro elements
52  for (unsigned i = 0; i < n_macro_element; i++)
53  {
54  // Create the i-th macro element
55  Macro_element_pt[i] = new QExtrudedMacroElement<3>(this, i);
56  }
57  } // End of ExtrudedDomain
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Domain()
Constructor.
Definition: domain.h:70
Vector< MacroElement * > Macro_element_pt
Vector of pointers to macro elements.
Definition: domain.h:301
unsigned nmacro_element()
Number of macro elements in domain.
Definition: domain.h:123
double T_max
The maximum t-value.
Definition: extruded_domain.h:110
unsigned N_extruded_element
Definition: extruded_domain.h:104
Domain * Domain_pt
Pointer to the Domain.
Definition: extruded_domain.h:101
double T_min
The minimum t-value (defaults to 0.0 if not specified)
Definition: extruded_domain.h:107

References Domain_pt, i, oomph::Domain::Macro_element_pt, N_extruded_element, and oomph::Domain::nmacro_element().

◆ ExtrudedDomain() [2/3]

oomph::ExtrudedDomain::ExtrudedDomain ( Domain domain_pt,
const unsigned n_extruded_element,
const double t_min,
const double t_max 
)

Constructor.

67  : Domain(),
68  Domain_pt(domain_pt),
69  N_extruded_element(n_extruded_element),
70  T_min(t_min),
71  T_max(t_max)
72  {
73  // The number of macro elements to create in the extruded domain
74  unsigned n_macro_element =
76 
77  // There are four macro elements
78  Macro_element_pt.resize(n_macro_element);
79 
80  // Build the 3D extruded macro elements
81  for (unsigned i = 0; i < n_macro_element; i++)
82  {
83  // Create the i-th macro element
84  Macro_element_pt[i] = new QExtrudedMacroElement<3>(this, i);
85  }
86 
87  /*
88  // DRAIG: Might be worth having this as an output function if it's not
89  // already in the base class...
90  // Loop over the number of macro elements
91  for (unsigned i=0;i<n_macro_element;i++)
92  {
93  // Create an output stream
94  std::ofstream some_file;
95 
96  // Allocate space for the filename
97  char filename[1000];
98 
99  // Number of plot points
100  unsigned n_pts=20;
101 
102  // Create the file name
103  sprintf(filename,"RESLT/extruded_element%i.dat",i);
104 
105  // Open a file with the created filename
106  some_file.open(filename);
107 
108  // Output macro element
109  macro_element_pt(i)->output(some_file,n_pts);
110 
111  // Close the file
112  some_file.close();
113  }
114  exit(0);
115  */
116  } // End of ExtrudedDomain

References Domain_pt, i, oomph::Domain::Macro_element_pt, N_extruded_element, and oomph::Domain::nmacro_element().

◆ ~ExtrudedDomain()

oomph::ExtrudedDomain::~ExtrudedDomain ( )
inline

Destructor: Empty; the extruded macro elements will be deleted in Domain.

72 {}

◆ ExtrudedDomain() [3/3]

oomph::ExtrudedDomain::ExtrudedDomain ( const ExtrudedDomain )
delete

Broken copy constructor.

Member Function Documentation

◆ macro_element_boundary()

void oomph::ExtrudedDomain::macro_element_boundary ( const unsigned time,
const unsigned i_macro,
const unsigned i_direct,
const Vector< double > &  s,
Vector< double > &  x 
)
virtual

Vector representation of the i_macro-th macro element boundary i_direct (e.g. N/S/W/E in 2D spatial = 3D space-time). NOTE: Some extra care has to be taken here to translate the OcTree enumeration to the QuadTree enumeration (in the appropriate manner) so that the original Domain object can be used to calculate the global coordinate associated with the provided local coordinates.

Implements oomph::Domain.

153  {
154  // Make sure that time=0 otherwise this doesn't make sense
155  if (time != 0)
156  {
157  // Create an output stream
158  std::ostringstream error_message_stream;
159 
160  // Create an error message
161  error_message_stream << "This output function outputs a space-time\n"
162  << "representation of the domain. As such, it\n"
163  << "does not make sense to output the domain\n"
164  << "at a previous time level!" << std::endl;
165 
166  // Throw an error
167  throw OomphLibError(error_message_stream.str(),
170  }
171 
172  // The number of dimensions
173  unsigned n_dim = 3;
174 
175  // The number of macro elements in the original spatial Domain
176  unsigned n_macro = Domain_pt->nmacro_element();
177 
178  // Calculate the shifted macro element number (to correspond to the
179  // correct macro element in the original spatial Domain)
180  unsigned true_macro_id = i_macro % n_macro;
181 
182  // Which layer of the extruded domain are we in? Layer 0 corresponds to
183  // elements closest to t=T_min and the layer N_extruded_element-1
184  // corresponds to elements closest to t=T_max
185  unsigned i_layer = (i_macro - true_macro_id) / n_macro;
186 
187  // Calculate the width of an extrusion layer
188  double layer_width = (T_max - T_min) / double(N_extruded_element);
189 
190  // Storage for the global (spatial) coordinates
191  Vector<double> x_project(n_dim - 1, 0.0);
192 
193  // Calculate the time value associated with the start of the i-layer-th
194  // extrusion layer
195  double t_lower = (T_min + i_layer * layer_width);
196 
197  // Initialise the time value
198  double t = t_lower;
199 
200  // If we're on one of the edges (once projected to 2D in the t-direction)
201  if ((i_direct == OcTreeNames::L) || (i_direct == OcTreeNames::R) ||
202  (i_direct == OcTreeNames::D) || (i_direct == OcTreeNames::U))
203  {
204  // Update the time value to get the time value associated
205  // with the input surface coordinates
206  t += 0.5 * (1.0 + s[1]) * layer_width;
207 
208  // Get the local coordinate associated with the surface coordinate
209  // in the projected Domain. This is the first surface coordinate
210  // on the left, right, down and up faces of the 3D macro element.
211  Vector<double> s_project(1, s[0]);
212 
213  // If we're on the left face (or the West face once projected to 2D)
214  if (i_direct == OcTreeNames::L)
215  {
216  // Call the corresponding function through the provided Domain object
218  t, true_macro_id, QuadTreeNames::W, s_project, x_project);
219  }
220  // If we're on the right face (or the East face once projected to 2D)
221  else if (i_direct == OcTreeNames::R)
222  {
223  // Call the corresponding function through the provided Domain object
225  t, true_macro_id, QuadTreeNames::E, s_project, x_project);
226  }
227  // If we're on the down face (or the South face once projected to 2D)
228  else if (i_direct == OcTreeNames::D)
229  {
230  // Call the corresponding function through the provided Domain object
232  t, true_macro_id, QuadTreeNames::S, s_project, x_project);
233  }
234  // If we're on the up face (or the North face once projected to 2D)
235  else if (i_direct == OcTreeNames::U)
236  {
237  // Call the corresponding function through the provided Domain object
239  t, true_macro_id, QuadTreeNames::N, s_project, x_project);
240  }
241  }
242  else if ((i_direct == OcTreeNames::B) || (i_direct == OcTreeNames::F))
243  {
244  // Grab the i_macro-th macro element from the Domain object
245  MacroElement* macro_element_pt =
246  Domain_pt->macro_element_pt(true_macro_id);
247 
248  // If we're on the back face (or the whole element at t=T_max)
249  if (i_direct == OcTreeNames::B)
250  {
251  // Call the macro_map function to calculate the global (spatial)
252  // coordinates associated with the given surface coordinates
253  macro_element_pt->macro_map(t, s, x_project);
254  }
255  // If we're on the front face (or the whole element at t=T_max)
256  else if (i_direct == OcTreeNames::F)
257  {
258  // Update the time value to get the time value associated
259  // with the input surface coordinates
260  t += layer_width;
261 
262  // Call the macro_map function to calculate the global (spatial)
263  // coordinates associated with the given surface coordinates
264  macro_element_pt->macro_map(t, s, x_project);
265  }
266  }
267  else
268  {
269  // Create an output stream
270  std::ostringstream error_message_stream;
271 
272  // Create an error message
273  error_message_stream << "Incorrect face enumeration input! Should either "
274  << "be L,R,D,U,B or F. You input "
275  << OcTree::Direct_string[i_direct] << "!"
276  << std::endl;
277 
278  // We should never get here so throw an error if we do
279  throw OomphLibError(error_message_stream.str(),
282  } // if ((i_direct==OcTreeNames::L)||(i_direct==OcTreeNames::R)||...
283 
284  // Loop over the global (spatial) coordinates
285  for (unsigned i = 0; i < n_dim - 1; i++)
286  {
287  // Copy the global coordinates over
288  x[i] = x_project[i];
289  }
290 
291  // Finally, add in the final coordinate (the time value)
292  x[n_dim - 1] = t;
293  } // End of macro_element_boundary
virtual void macro_element_boundary(const unsigned &t, const unsigned &i_macro, const unsigned &i_direct, const Vector< double > &s, Vector< double > &f)=0
MacroElement * macro_element_pt(const unsigned &i)
Access to i-th macro element.
Definition: domain.h:116
ExtrudedMacroElement * macro_element_pt(const unsigned &i)
Access to i-th extruded macro element.
Definition: extruded_domain.cc:132
void macro_map(const Vector< double > &s, Vector< double > &r)
The mapping from local to global coordinates at the current time : r(s)
Definition: macro_element.h:126
static Vector< std::string > Direct_string
Translate (enumerated) directions into strings.
Definition: octree.h:329
RealScalar s
Definition: level1_cplx_impl.h:130
@ B
Definition: octree.h:73
@ D
Definition: octree.h:71
@ L
Definition: octree.h:69
@ R
Definition: octree.h:70
@ F
Definition: octree.h:74
@ U
Definition: octree.h:72
@ E
Definition: quadtree.h:61
@ S
Definition: quadtree.h:62
@ W
Definition: quadtree.h:63
@ N
Definition: quadtree.h:60
list x
Definition: plotDoE.py:28
t
Definition: plotPSD.py:36
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References oomph::OcTreeNames::B, oomph::OcTreeNames::D, oomph::OcTree::Direct_string, Domain_pt, oomph::QuadTreeNames::E, oomph::OcTreeNames::F, i, oomph::OcTreeNames::L, oomph::Domain::macro_element_boundary(), oomph::Domain::macro_element_pt(), macro_element_pt(), oomph::MacroElement::macro_map(), oomph::QuadTreeNames::N, N_extruded_element, oomph::Domain::nmacro_element(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, oomph::OcTreeNames::R, s, oomph::QuadTreeNames::S, plotPSD::t, T_max, T_min, oomph::OcTreeNames::U, oomph::QuadTreeNames::W, and plotDoE::x.

Referenced by oomph::QExtrudedMacroElement< 3 >::macro_map(), and oomph::QExtrudedMacroElement< 3 >::output_macro_element_boundaries().

◆ macro_element_pt()

ExtrudedMacroElement * oomph::ExtrudedDomain::macro_element_pt ( const unsigned i)

Access to i-th extruded macro element.

133  {
134  // Return a pointer to the i-th macro element in storage
135  return dynamic_cast<ExtrudedMacroElement*>(Macro_element_pt[i]);
136  } // End of macro_element_pt

References i, and oomph::Domain::Macro_element_pt.

Referenced by oomph::ExtrudedCubeMeshFromQuadMesh< ELEMENT >::build_mesh(), and macro_element_boundary().

◆ nmacro_element()

unsigned oomph::ExtrudedDomain::nmacro_element ( )

Number of macro elements in domain.

123  {
124  // Return the size of the macro element container
125  return Macro_element_pt.size();
126  } // End of nmacro_element

References oomph::Domain::Macro_element_pt.

◆ operator=()

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

Broken assignment operator.

Member Data Documentation

◆ Domain_pt

Domain* oomph::ExtrudedDomain::Domain_pt
private

Pointer to the Domain.

Referenced by ExtrudedDomain(), and macro_element_boundary().

◆ N_extruded_element

unsigned oomph::ExtrudedDomain::N_extruded_element
private

◆ T_max

double oomph::ExtrudedDomain::T_max
private

The maximum t-value.

Referenced by macro_element_boundary().

◆ T_min

double oomph::ExtrudedDomain::T_min
private

The minimum t-value (defaults to 0.0 if not specified)

Referenced by macro_element_boundary().


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