Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
oomph::MeshAsGeomObject Class Reference

#include <mesh_as_geometric_object.h>

+ Inheritance diagram for oomph::MeshAsGeomObject:

Public Member Functions

 MeshAsGeomObject (Mesh *const &mesh_pt, const unsigned &suppress_synchronisation_of_bins_flag=0)
 Constructor, pass the pointer to the mesh. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems. More...
 
 MeshAsGeomObject (Mesh *const &mesh_pt, OomphCommunicator *comm_pt, const unsigned &suppress_synchronisation_of_bins_flag=0)
 Constructor, pass the pointer to the mesh and communicator. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems. More...
 
 MeshAsGeomObject (Mesh *const &mesh_pt, const bool &compute_extreme_bin_coords, const unsigned &suppress_synchronisation_of_bins_flag=0)
 Constructor, pass the pointer to the mesh and boolean to bypass the computation of the extreme coordinates of the bin used in the locate_zeta method. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems. More...
 
 MeshAsGeomObject (Mesh *const &mesh_pt, OomphCommunicator *comm_pt, const bool &compute_extreme_bin_coords, const unsigned &suppress_synchronisation_of_bins_flag=0)
 Constructor, pass the pointer to the mesh, communicator, and boolean to bypass the computation of the extreme coordinates of the bin used in the locate_zeta method. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems. More...
 
 MeshAsGeomObject ()
 Empty Constructor. More...
 
 ~MeshAsGeomObject ()
 Destructor. More...
 
 MeshAsGeomObject (const MeshAsGeomObject &)
 Broken copy constructor. More...
 
void operator= (const MeshAsGeomObject &)
 Broken assignment operator. More...
 
unsigned total_nbin () const
 Total number of bins (empty or not) More...
 
unsigned ngeom_data () const
 How many items of Data does the shape of the object depend on? More...
 
Datageom_data_pt (const unsigned &j)
 Return pointer to the j-th Data item that the object's shape depends on. More...
 
void locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &use_coordinate_as_initial_guess=false)
 Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Following from the general interface to this function in GeomObjects, setting the optional bool argument to true means that each time the sub-object's locate_zeta function is called, the coordinate argument "s" is used as the initial guess. However, this doesn't make sense here and the argument is ignored (though a warning is issued when the code is compiled in PARANOID setting) More...
 
void spiraling_locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &called_within_spiral)
 Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Setting the final bool argument to true means that we only search for matching element within a a certain number of "spirals" within the bin structure. More...
 
void my_spiraling_locate_zeta (const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s, const bool &called_within_spiral)
 Version of spiraling locate zeta used for the projection during the unstructured mesh adaptation. More...
 
void position (const Vector< double > &zeta, Vector< double > &r) const
 Return the position as a function of the intrinsic coordinate zeta. This provides an (expensive!) default implementation in which we loop over all the constituent sub-objects and check if they contain zeta and then evaluate their position() function. More...
 
void position (const unsigned &t, const Vector< double > &zeta, Vector< double > &r) const
 Parametrised position on object: r(zeta). Evaluated at previous timestep. t=0: current time; t>0: previous timestep. This provides an (expensive!) default implementation in which we loop over all the constituent sub-objects and check if they contain zeta and then evaluate their position() function. More...
 
void dposition (const Vector< double > &xi, DenseMatrix< double > &drdxi) const
 Return the derivative of the position. More...
 
double & max_search_radius ()
 Set maximum search radius for locate zeta. This is initialised do DBL_MAX so we brutally search through the entire bin structure, no matter how big it is until we've found the required point (or failed to do so. This can be VERY costly with fine meshes. Here the user takes full responsibility and states that we have no chance in hell to find the required point in a bin whose closest vertex is further than the specified max search radius. More...
 
unsigned & max_spiral_level ()
 Access function to max. spiral level during straight locate_zeta search (for efficiency; similar to max_search_radius()) More...
 
unsigned & current_min_spiral_level ()
 Access function to current min. spiral level. More...
 
unsigned & current_max_spiral_level ()
 Access function to current max. spiral level. More...
 
double & x_min ()
 Access function for min coordinate in x direction. More...
 
double & x_max ()
 Access function for max coordinate in x direction. More...
 
double & y_min ()
 Access function for min coordinate in y direction. More...
 
double & y_max ()
 Access function for max coordinate in y direction. More...
 
double & z_min ()
 Access function for min coordinate in z direction. More...
 
double & z_max ()
 Access function for max coordinate in z direction. More...
 
void get_min_and_max_coordinates (Mesh *const &mesh_pt)
 Get the min and max coordinates for the mesh, in each dimension. More...
 
unsigned nbin_x ()
 Number of bins in x direction. More...
 
unsigned nbin_y ()
 Number of bins in y direction. More...
 
unsigned nbin_z ()
 Number of bins in z direction. More...
 
void get_fill_stats (unsigned &n_bin, unsigned &max_n_entry, unsigned &min_n_entry, unsigned &tot_n_entry, unsigned &n_empty) const
 Provide some stats on the fill level of the associated bin. More...
 
double min_distance (const unsigned &i_bin, const Vector< double > &zeta)
 Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordinate zeta. More...
 
void output_bin_vertices (std::ostream &outfile, const Vector< double > &zeta)
 Output bin vertices (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point. More...
 
void output_bin_vertices (std::ostream &outfile)
 Output bin vertices (allowing display of bins as zones). More...
 
void output_bin_vertices (std::ostream &outfile, const unsigned &i_bin, const Vector< double > &zeta)
 Output bin vertices of specified bin (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point. More...
 
void output_bin_vertices (std::ostream &outfile, const unsigned &i_bin)
 Output bin vertices of specified bin (allowing display of bins as zones). More...
 
void get_bin_vertices (const unsigned &i_bin, Vector< Vector< double > > &bin_vertex)
 Get vector of vectors containing the coordinates of the vertices of the i_bin-th bin: bin_vertex[j][i] contains the i-th coordinate of the j-th vertex. More...
 
void create_bins_of_objects (const unsigned long &n_mesh_element)
 
void flush_bins_of_objects ()
 Flush the storage for the binning method (and decrement counter for total number of bins in active use by any MeshAsGeomObject) More...
 
void get_bin (const Vector< double > &zeta, int &bin_number)
 Get the number of the bin containing the specified coordinate. Bin number is negative if the coordinate is outside the bin structure. More...
 
void get_bin (const Vector< double > &zeta, int &bin_number, Vector< std::pair< FiniteElement *, Vector< double > > > &sample_point_pairs)
 Get the number of the bin containing the specified coordinate; also return the contents of that bin. Bin number is negative if the coordinate is outside the bin structure. More...
 
Vector< Vector< std::pair
< FiniteElement *, Vector
< double > > > > 
bin_content () const
 Get the contents of all bins in vector. More...
 
const std::map< unsigned,
Vector< std::pair
< FiniteElement *, Vector
< double > > > > * 
get_all_bins_content () const
 Get the contents of all bins in vector. More...
 
void get_neighbouring_bins_helper (const unsigned &bin_number, const unsigned &level, Vector< unsigned > &neighbour_bin, const bool &only_use_filled_bins=false)
 Calculate the bin numbers of all the neighbours to "bin" given the level. More...
 
void fill_bin_by_diffusion (const unsigned &bin_diffusion_radius=1)
 Fill bin by diffusion, populating each empty bin with the same content as the first non-empty bin found during a spiral-based search up to the specified "radius" (default 1) More...
 
void output_bins (std::ofstream &outfile)
 Output bins. More...
 
void output_bins (std::string &filename)
 Output bins. More...
 
- Public Member Functions inherited from oomph::GeomObject
 GeomObject ()
 Default constructor. More...
 
 GeomObject (const unsigned &ndim)
 Constructor: Pass dimension of geometric object (# of Eulerian coords = # of Lagrangian coords; no time history available/needed) More...
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim)
 Constructor: pass # of Eulerian and Lagrangian coordinates. No time history available/needed. More...
 
 GeomObject (const unsigned &nlagrangian, const unsigned &ndim, TimeStepper *time_stepper_pt)
 Constructor: pass # of Eulerian and Lagrangian coordinates and pointer to time-stepper which is used to handle the position at previous timesteps and allows the evaluation of veloc/acceleration etc. in cases where the GeomData varies with time. More...
 
 GeomObject (const GeomObject &dummy)
 Broken copy constructor. More...
 
void operator= (const GeomObject &)
 Broken assignment operator. More...
 
virtual ~GeomObject ()
 (Empty) destructor More...
 
unsigned nlagrangian () const
 Access function to # of Lagrangian coordinates. More...
 
unsigned ndim () const
 Access function to # of Eulerian coordinates. More...
 
void set_nlagrangian_and_ndim (const unsigned &n_lagrangian, const unsigned &n_dim)
 Set # of Lagrangian and Eulerian coordinates. More...
 
TimeStepper *& time_stepper_pt ()
 Access function for pointer to time stepper: Null if object is not time-dependent. More...
 
TimeSteppertime_stepper_pt () const
 Access function for pointer to time stepper: Null if object is not time-dependent. Const version. More...
 
virtual void dposition_dt (const Vector< double > &zeta, const unsigned &j, Vector< double > &drdt)
 j-th time-derivative on object at current time: $ \frac{d^{j} r(\zeta)}{dt^j} $. More...
 
virtual void d2position (const Vector< double > &zeta, RankThreeTensor< double > &ddrdzeta) const
 2nd derivative of position Vector w.r.t. to coordinates: $ \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}$ = ddrdzeta(alpha,beta,i). Evaluated at current time. More...
 
virtual void d2position (const Vector< double > &zeta, Vector< double > &r, DenseMatrix< double > &drdzeta, RankThreeTensor< double > &ddrdzeta) const
 Posn Vector and its 1st & 2nd derivatives w.r.t. to coordinates: $ \frac{dR_i}{d \zeta_\alpha}$ = drdzeta(alpha,i). $ \frac{d^2R_i}{d \zeta_\alpha d \zeta_\beta}$ = ddrdzeta(alpha,beta,i). Evaluated at current time. More...
 
virtual void interpolated_zeta (const Vector< double > &s, Vector< double > &zeta) const
 A geometric object may be composed of many sub-objects each with their own local coordinate. This function returns the "global" intrinsic coordinate zeta (within the compound object), at a given local coordinate s (i.e. the intrinsic coordinate of the sub-GeomObject. In simple (non-compound) GeomObjects, the local intrinsic coordinate is the global intrinsic coordinate and so the function merely returns s. To make it less likely that the default implementation is called in error (because it is not overloaded in a derived GeomObject where the default is not appropriate, we do at least check that s and zeta have the same size if called in PARANOID mode. More...
 

Static Public Attributes

static bool Use_eulerian_coordinates_during_setup =false
 Globally set-able (sorry!) flag to indicate that MeshAsGeomObject is to use Eulerian coordinates when setting up bin. More...
 
static unsigned long Total_nbin_cells_counter =0
 Counter for overall number of bins allocated – used to issue warning if this exceeds a threshhold. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI). More...
 
static unsigned long Threshold_for_total_bin_cell_number_warning
 Total number of bins above which warning is issued. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI). More...
 
static bool Suppress_warning_about_large_total_number_of_bins =false
 Boolean to supppress warnings about large number of bins. More...
 
static bool Already_warned_about_large_number_of_bin_cells =false
 Boolean flag to make sure that warning about large number of bin cells only gets triggered once. More...
 
static unsigned Threshold_for_elements_per_bin_warning = 100
 Fraction of elements/bin that triggers warning. Too many elements per bin can lead to very slow computations. More...
 
static bool Suppress_warning_about_small_number_of_bins =false
 Boolean to supppress warnings about small number of bins. More...
 
static bool Already_warned_about_small_number_of_bin_cells =false
 Boolean flag to make sure that warning about small number of bin cells only gets triggered once. More...
 

Private Member Functions

void construct_it (Mesh *const &mesh_pt, const bool &compute_extreme_bin_coords)
 Helper function for constructor: pass the pointer to the mesh, and boolean to specify whether to calculate coordinate extrema or not. More...
 
void sort_the_bin (const Vector< double > &zeta, Vector< std::pair< FiniteElement *, Vector< double > > > &sample_point_pairs)
 Sort the sampling points in the specified bin by distance from sampling point. More...
 

Private Attributes

Vector< Data * > Geom_data_pt
 Vector of pointers to Data items that affects the object's shape. More...
 
Vector< FiniteElement * > Sub_geom_object_pt
 Internal storage for the elements that constitute the object. More...
 
SparseVector< Vector
< std::pair< FiniteElement
*, Vector< double > > > > 
Bin_object_coord_pairs
 Storage for paired objects and coords in each bin. More...
 
bool Suppress_synchronisation_of_bins
 In parallel computation, suppress synchronisation of bins Default is false. If set to true, each processor will create its own bin structure, spanning only its own elements. More...
 
double Max_search_radius
 Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the point is found or until we've searched every single bin. Overwriting this means we won't search in bins whose closest vertex is at a distance greater than Max_search_radius from the point to be located. More...
 
unsigned Max_spiral_level
 Max. spiralling level (for efficiency; effect similar to max_search_radius) More...
 
Vector< double > Min_coords
 Storage for min coordinates in the mesh. More...
 
Vector< double > Max_coords
 Storage for max coordinates in the mesh. More...
 
unsigned Nbin_x
 Number of bins in x direction. More...
 
unsigned Nbin_y
 Number of bins in y direction. More...
 
unsigned Nbin_z
 Number of bins in z direction. More...
 
unsigned Current_min_spiral_level
 Current min. spiralling level. More...
 
unsigned Current_max_spiral_level
 Current max. spiralling level. More...
 
OomphCommunicatorCommunicator_pt
 Communicator. More...
 
bool Have_used_eulerian_coordinates_during_setup
 Flag to indicate that MeshAsGeomObject has used Eulerian coordinates when setting up bin. More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::GeomObject
unsigned NLagrangian
 Number of Lagrangian (intrinsic) coordinates. More...
 
unsigned Ndim
 Number of Eulerian coordinates. More...
 
TimeStepperGeom_object_time_stepper_pt
 Timestepper (used to handle access to geometry at previous timesteps) More...
 

Detailed Description

This class provides a GeomObject representation of a given finite element mesh. The Lagrangian coordinate is taken to be the dimension of the (first) element in the mesh and the Eulerian coordinate is taken to be the dimension of the (first) node in the mesh. If there are no elements or nodes the appropriate dimensions will be set to zero. The consitituent elements of the mesh must have their own GeomObject representations, so they must be FiniteElements, and they become sub-objects in this compound GeomObject.

Definition at line 201 of file mesh_as_geometric_object.h.

Constructor & Destructor Documentation

oomph::MeshAsGeomObject::MeshAsGeomObject ( Mesh *const &  mesh_pt,
const unsigned &  suppress_synchronisation_of_bins_flag = 0 
)
inline

Constructor, pass the pointer to the mesh. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems.

Definition at line 284 of file mesh_as_geometric_object.h.

References construct_it(), Max_search_radius, Max_spiral_level, and Suppress_synchronisation_of_bins.

oomph::MeshAsGeomObject::MeshAsGeomObject ( Mesh *const &  mesh_pt,
OomphCommunicator comm_pt,
const unsigned &  suppress_synchronisation_of_bins_flag = 0 
)
inline

Constructor, pass the pointer to the mesh and communicator. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems.

Definition at line 306 of file mesh_as_geometric_object.h.

References construct_it(), Max_search_radius, Max_spiral_level, and Suppress_synchronisation_of_bins.

oomph::MeshAsGeomObject::MeshAsGeomObject ( Mesh *const &  mesh_pt,
const bool &  compute_extreme_bin_coords,
const unsigned &  suppress_synchronisation_of_bins_flag = 0 
)
inline

Constructor, pass the pointer to the mesh and boolean to bypass the computation of the extreme coordinates of the bin used in the locate_zeta method. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems.

Definition at line 330 of file mesh_as_geometric_object.h.

References construct_it(), Max_search_radius, Max_spiral_level, and Suppress_synchronisation_of_bins.

oomph::MeshAsGeomObject::MeshAsGeomObject ( Mesh *const &  mesh_pt,
OomphCommunicator comm_pt,
const bool &  compute_extreme_bin_coords,
const unsigned &  suppress_synchronisation_of_bins_flag = 0 
)
inline

Constructor, pass the pointer to the mesh, communicator, and boolean to bypass the computation of the extreme coordinates of the bin used in the locate_zeta method. Final flag (default 0) allows the suppression of synchronisation of bin boundaries on multiple processors so if set to 1 each processor only creates a bin structure that contains its own elements, rather than a bin bin structure that is identical for each processor. Obviously only relevant for distributed problems.

Definition at line 354 of file mesh_as_geometric_object.h.

References construct_it(), Max_search_radius, Max_spiral_level, and Suppress_synchronisation_of_bins.

oomph::MeshAsGeomObject::MeshAsGeomObject ( )
inline

Empty Constructor.

Definition at line 371 of file mesh_as_geometric_object.h.

oomph::MeshAsGeomObject::~MeshAsGeomObject ( )
inline

Destructor.

Definition at line 374 of file mesh_as_geometric_object.h.

References flush_bins_of_objects().

oomph::MeshAsGeomObject::MeshAsGeomObject ( const MeshAsGeomObject )
inline

Broken copy constructor.

Definition at line 382 of file mesh_as_geometric_object.h.

References oomph::BrokenCopy::broken_copy().

Member Function Documentation

Vector<Vector<std::pair<FiniteElement*,Vector<double> > > > oomph::MeshAsGeomObject::bin_content ( ) const
inline

Get the contents of all bins in vector.

Definition at line 648 of file mesh_as_geometric_object.h.

References Bin_object_coord_pairs.

void oomph::MeshAsGeomObject::construct_it ( Mesh *const &  mesh_pt,
const bool &  compute_extreme_bin_coords 
)
private
void oomph::MeshAsGeomObject::create_bins_of_objects ( const unsigned long &  n_mesh_element)

Initialise and populate the "bin" structure for locating coordinates and increment counter for total number of bins in active use by any MeshAsGeomObject) Note that the number of elements in the mesh is passed in only for a warning message about small numbers of bins.

Initialise the "bin" structure for locating coordinates The number of elements in the mesh is passed in only for an error check about the number of elements / bin.

Flush all objects out of the bin structure

Loop over subobjects (elements) to decide which bin they belong in...

Definition at line 1406 of file mesh_as_geometric_object.cc.

References Already_warned_about_large_number_of_bin_cells, Already_warned_about_small_number_of_bin_cells, Bin_object_coord_pairs, oomph::Multi_domain_functions::Doc_stats, e, flush_bins_of_objects(), oomph::FiniteElement::get_s_plot(), i, oomph::FiniteElement::interpolated_x(), oomph::FiniteElement::interpolated_zeta(), Max_coords, Min_coords, Nbin_x, Nbin_y, Nbin_z, oomph::GeomObject::nlagrangian(), oomph::FiniteElement::nplot_points(), oomph::Multi_domain_functions::Nsample_points, oomph::Multi_domain_functions::Nx_bin, oomph::Multi_domain_functions::Ny_bin, oomph::Multi_domain_functions::Nz_bin, oomph::oomph_info, oomph::Multi_domain_functions::Percentage_offset, Sub_geom_object_pt, Suppress_warning_about_large_total_number_of_bins, Suppress_warning_about_small_number_of_bins, Threshold_for_elements_per_bin_warning, Threshold_for_total_bin_cell_number_warning, oomph::TimingHelpers::timer(), total_nbin(), Total_nbin_cells_counter, and Use_eulerian_coordinates_during_setup.

unsigned& oomph::MeshAsGeomObject::current_max_spiral_level ( )
inline

Access function to current max. spiral level.

Definition at line 534 of file mesh_as_geometric_object.h.

References Current_max_spiral_level.

Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().

unsigned& oomph::MeshAsGeomObject::current_min_spiral_level ( )
inline

Access function to current min. spiral level.

Definition at line 531 of file mesh_as_geometric_object.h.

References Current_min_spiral_level.

Referenced by oomph::Multi_domain_functions::aux_setup_multi_domain_interaction().

void oomph::MeshAsGeomObject::dposition ( const Vector< double > &  xi,
DenseMatrix< double > &  drdxi 
) const
inlinevirtual

Return the derivative of the position.

Reimplemented from oomph::GeomObject.

Definition at line 508 of file mesh_as_geometric_object.h.

void oomph::MeshAsGeomObject::fill_bin_by_diffusion ( const unsigned &  bin_diffusion_radius = 1)

Fill bin by diffusion, populating each empty bin with the same content as the first non-empty bin found during a spiral-based search up to the specified "radius" (default 1)

Fill bin by diffusion, populating each empty bin with the same content as the first non-empty bin found during a spiral-based search up to the specified "radius" (default 1)

Definition at line 562 of file mesh_as_geometric_object.cc.

References Bin_object_coord_pairs, get_neighbouring_bins_helper(), i, oomph::FiniteElement::interpolated_x(), min_distance(), s, and total_nbin().

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::adapt().

void oomph::MeshAsGeomObject::flush_bins_of_objects ( )
inline

Flush the storage for the binning method (and decrement counter for total number of bins in active use by any MeshAsGeomObject)

Definition at line 629 of file mesh_as_geometric_object.h.

References Bin_object_coord_pairs, and Total_nbin_cells_counter.

Referenced by create_bins_of_objects(), and ~MeshAsGeomObject().

Data* oomph::MeshAsGeomObject::geom_data_pt ( const unsigned &  j)
inlinevirtual

Return pointer to the j-th Data item that the object's shape depends on.

Reimplemented from oomph::GeomObject.

Definition at line 409 of file mesh_as_geometric_object.h.

References Geom_data_pt.

const std::map<unsigned,Vector<std::pair<FiniteElement*,Vector<double> > > >* oomph::MeshAsGeomObject::get_all_bins_content ( ) const
inline

Get the contents of all bins in vector.

Definition at line 657 of file mesh_as_geometric_object.h.

References Bin_object_coord_pairs.

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::adapt().

void oomph::MeshAsGeomObject::get_bin ( const Vector< double > &  zeta,
int &  bin_number 
)

Get the number of the bin containing the specified coordinate. Bin number is negative if the coordinate is outside the bin structure.

Get the number of the bin containing the specified coordinate. Bin number is negative if the coordinate is outside the bin structure.

Definition at line 451 of file mesh_as_geometric_object.cc.

References get_bin_vertices(), i, Max_coords, Min_coords, Nbin_x, Nbin_y, Nbin_z, and oomph::GeomObject::nlagrangian().

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::adapt(), and get_bin().

void oomph::MeshAsGeomObject::get_bin ( const Vector< double > &  zeta,
int &  bin_number,
Vector< std::pair< FiniteElement *, Vector< double > > > &  sample_point_pairs 
)

Get the number of the bin containing the specified coordinate; also return the contents of that bin. Bin number is negative if the coordinate is outside the bin structure.

Get the number of the bin containing the specified coordinate; also return the contents of that bin. Bin number is negative if the coordinate is outside the bin structure.

Definition at line 430 of file mesh_as_geometric_object.cc.

References Bin_object_coord_pairs, and get_bin().

void oomph::MeshAsGeomObject::get_bin_vertices ( const unsigned &  i_bin,
Vector< Vector< double > > &  bin_vertex 
)

Get vector of vectors containing the coordinates of the vertices of the i_bin-th bin: bin_vertex[j][i] contains the i-th coordinate of the j-th vertex.

Get vector of vectors containing the coordinates of the vertices of the i_bin-th bin: bin_vertex[j][i] contains the i-th coordinate of the j-th vertex.

Definition at line 1847 of file mesh_as_geometric_object.cc.

References i, Max_coords, Min_coords, Nbin_x, Nbin_y, Nbin_z, and oomph::GeomObject::nlagrangian().

Referenced by get_bin(), min_distance(), and output_bin_vertices().

void oomph::MeshAsGeomObject::get_fill_stats ( unsigned &  n_bin,
unsigned &  max_n_entry,
unsigned &  min_n_entry,
unsigned &  tot_n_entry,
unsigned &  n_empty 
) const

Provide some stats on the fill level of the associated bin.

Definition at line 1367 of file mesh_as_geometric_object.cc.

References Bin_object_coord_pairs, and total_nbin().

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::adapt().

void oomph::MeshAsGeomObject::get_min_and_max_coordinates ( Mesh *const &  mesh_pt)
void oomph::MeshAsGeomObject::get_neighbouring_bins_helper ( const unsigned &  bin_number,
const unsigned &  level,
Vector< unsigned > &  neighbour_bin,
const bool &  only_use_filled_bins = false 
)

Calculate the bin numbers of all the neighbours to "bin" given the level.

Definition at line 1975 of file mesh_as_geometric_object.cc.

References Bin_object_coord_pairs, i, Nbin_x, Nbin_y, Nbin_z, and oomph::GeomObject::nlagrangian().

Referenced by fill_bin_by_diffusion().

void oomph::MeshAsGeomObject::locate_zeta ( const Vector< double > &  zeta,
GeomObject *&  sub_geom_object_pt,
Vector< double > &  s,
const bool &  use_coordinate_as_initial_guess = false 
)
inlinevirtual

Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Following from the general interface to this function in GeomObjects, setting the optional bool argument to true means that each time the sub-object's locate_zeta function is called, the coordinate argument "s" is used as the initial guess. However, this doesn't make sense here and the argument is ignored (though a warning is issued when the code is compiled in PARANOID setting)

Reimplemented from oomph::GeomObject.

Definition at line 421 of file mesh_as_geometric_object.h.

References spiraling_locate_zeta().

Referenced by position(), oomph::LineVisualiser::setup(), oomph::HelmholtzMGPreconditioner< DIM >::setup_interpolation_matrices(), oomph::MGSolver< DIM >::setup_interpolation_matrices_unstructured(), and oomph::HelmholtzMGPreconditioner< DIM >::setup_interpolation_matrices_unstructured().

double& oomph::MeshAsGeomObject::max_search_radius ( )
inline

Set maximum search radius for locate zeta. This is initialised do DBL_MAX so we brutally search through the entire bin structure, no matter how big it is until we've found the required point (or failed to do so. This can be VERY costly with fine meshes. Here the user takes full responsibility and states that we have no chance in hell to find the required point in a bin whose closest vertex is further than the specified max search radius.

Definition at line 524 of file mesh_as_geometric_object.h.

References Max_search_radius.

Referenced by oomph::LineVisualiser::setup().

unsigned& oomph::MeshAsGeomObject::max_spiral_level ( )
inline

Access function to max. spiral level during straight locate_zeta search (for efficiency; similar to max_search_radius())

Definition at line 528 of file mesh_as_geometric_object.h.

References Max_spiral_level.

double oomph::MeshAsGeomObject::min_distance ( const unsigned &  i_bin,
const Vector< double > &  zeta 
)

Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordinate zeta.

Compute the minimum distance of any vertex in the specified bin from the specified Lagrangian coordinate zeta.

Definition at line 1716 of file mesh_as_geometric_object.cc.

References get_bin_vertices(), i, and oomph::GeomObject::nlagrangian().

Referenced by fill_bin_by_diffusion(), and output_bin_vertices().

void oomph::MeshAsGeomObject::my_spiraling_locate_zeta ( const Vector< double > &  zeta,
GeomObject *&  sub_geom_object_pt,
Vector< double > &  s,
const bool &  called_within_spiral 
)

Version of spiraling locate zeta used for the projection during the unstructured mesh adaptation.

Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Setting the final bool argument to true means that we only search for matching element within a a certain number of "spirals" within the bin structure.

Definition at line 969 of file mesh_as_geometric_object.cc.

References oomph::Multi_domain_functions::Allow_use_of_halo_elements_as_external_elements_for_projection, i, oomph::GeneralisedElement::is_halo(), oomph::FiniteElement::locate_zeta(), and oomph::Multi_domain_functions::Sort_bin_entries.

Referenced by oomph::Multi_domain_functions::locate_zeta_for_local_coordinates().

unsigned oomph::MeshAsGeomObject::nbin_x ( )
inline

Number of bins in x direction.

Definition at line 558 of file mesh_as_geometric_object.h.

References Nbin_x.

Referenced by output_bins().

unsigned oomph::MeshAsGeomObject::nbin_y ( )
inline

Number of bins in y direction.

Definition at line 561 of file mesh_as_geometric_object.h.

References Nbin_y.

Referenced by output_bins().

unsigned oomph::MeshAsGeomObject::nbin_z ( )
inline

Number of bins in z direction.

Definition at line 564 of file mesh_as_geometric_object.h.

References Nbin_z.

Referenced by output_bins().

unsigned oomph::MeshAsGeomObject::ngeom_data ( ) const
inlinevirtual

How many items of Data does the shape of the object depend on?

Reimplemented from oomph::GeomObject.

Definition at line 405 of file mesh_as_geometric_object.h.

References Geom_data_pt.

void oomph::MeshAsGeomObject::operator= ( const MeshAsGeomObject )
inline

Broken assignment operator.

Definition at line 388 of file mesh_as_geometric_object.h.

References oomph::BrokenCopy::broken_assign().

void oomph::MeshAsGeomObject::output_bin_vertices ( std::ostream &  outfile,
const Vector< double > &  zeta 
)

Output bin vertices (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point.

Output bin vertices (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point.

Definition at line 1749 of file mesh_as_geometric_object.cc.

References get_bin_vertices(), i, min_distance(), Nbin_x, Nbin_y, Nbin_z, and oomph::GeomObject::nlagrangian().

Referenced by output_bin_vertices().

void oomph::MeshAsGeomObject::output_bin_vertices ( std::ostream &  outfile)
inline

Output bin vertices (allowing display of bins as zones).

Definition at line 588 of file mesh_as_geometric_object.h.

References oomph::GeomObject::nlagrangian(), and output_bin_vertices().

void oomph::MeshAsGeomObject::output_bin_vertices ( std::ostream &  outfile,
const unsigned &  i_bin,
const Vector< double > &  zeta 
)

Output bin vertices of specified bin (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point.

Output bin vertices of specified bin (allowing display of bins as zones). Final argument specifies the coordinates of a point and output includes the minimum distance of any of the bin vertices to this point.

Definition at line 1801 of file mesh_as_geometric_object.cc.

References get_bin_vertices(), i, min_distance(), and oomph::GeomObject::nlagrangian().

void oomph::MeshAsGeomObject::output_bin_vertices ( std::ostream &  outfile,
const unsigned &  i_bin 
)
inline

Output bin vertices of specified bin (allowing display of bins as zones).

Definition at line 605 of file mesh_as_geometric_object.h.

References oomph::GeomObject::nlagrangian(), and output_bin_vertices().

void oomph::MeshAsGeomObject::output_bins ( std::ofstream &  outfile)
void oomph::MeshAsGeomObject::output_bins ( std::string &  filename)
inline

Output bins.

Definition at line 678 of file mesh_as_geometric_object.h.

References output_bins().

void oomph::MeshAsGeomObject::position ( const Vector< double > &  zeta,
Vector< double > &  r 
) const
inlinevirtual

Return the position as a function of the intrinsic coordinate zeta. This provides an (expensive!) default implementation in which we loop over all the constituent sub-objects and check if they contain zeta and then evaluate their position() function.

Implements oomph::GeomObject.

Definition at line 464 of file mesh_as_geometric_object.h.

References t.

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::apply_max_length_constraint(), oomph::RefineableTriangleMesh< ELEMENT >::refine_boundary(), oomph::RefineableTriangleMesh< ELEMENT >::refine_boundary_constrained_by_target_area(), and oomph::RefineableTriangleMesh< ELEMENT >::snap_nodes_onto_boundary().

void oomph::MeshAsGeomObject::position ( const unsigned &  t,
const Vector< double > &  zeta,
Vector< double > &  r 
) const
inlinevirtual

Parametrised position on object: r(zeta). Evaluated at previous timestep. t=0: current time; t>0: previous timestep. This provides an (expensive!) default implementation in which we loop over all the constituent sub-objects and check if they contain zeta and then evaluate their position() function.

Reimplemented from oomph::GeomObject.

Definition at line 477 of file mesh_as_geometric_object.h.

References i, locate_zeta(), oomph::GeomObject::nlagrangian(), oomph::GeomObject::position(), and s.

void oomph::MeshAsGeomObject::sort_the_bin ( const Vector< double > &  zeta,
Vector< std::pair< FiniteElement *, Vector< double > > > &  sample_point_pairs 
)
private

Sort the sampling points in the specified bin by distance from sampling point.

Sort the sampling points in the specified bin by distance from sampling point

Definition at line 403 of file mesh_as_geometric_object.cc.

void oomph::MeshAsGeomObject::spiraling_locate_zeta ( const Vector< double > &  zeta,
GeomObject *&  sub_geom_object_pt,
Vector< double > &  s,
const bool &  called_within_spiral 
)

Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Setting the final bool argument to true means that we only search for matching element within a a certain number of "spirals" within the bin structure.

Find the sub geometric object and local coordinate therein that corresponds to the intrinsic coordinate zeta. If sub_geom_object_pt=0 on return from this function, none of the constituent sub-objects contain the required coordinate. Setting the final bool argument to true means that we only search for matching element within a a certain number of "spirals" within the bin structure. Only search in nonempty bins.

Definition at line 690 of file mesh_as_geometric_object.cc.

References oomph::Multi_domain_functions::Allow_use_of_halo_elements_as_external_elements_for_projection, i, oomph::GeneralisedElement::is_halo(), oomph::FiniteElement::locate_zeta(), oomph::Multi_domain_functions::Setup_multi_domain_for_projection, and oomph::Multi_domain_functions::Sort_bin_entries.

Referenced by locate_zeta(), oomph::Multi_domain_functions::locate_zeta_for_local_coordinates(), and oomph::Multi_domain_functions::locate_zeta_for_missing_coordinates().

unsigned oomph::MeshAsGeomObject::total_nbin ( ) const
inline

Total number of bins (empty or not)

Definition at line 395 of file mesh_as_geometric_object.h.

References i, Nbin_x, Nbin_y, Nbin_z, and oomph::GeomObject::nlagrangian().

Referenced by create_bins_of_objects(), fill_bin_by_diffusion(), and get_fill_stats().

double& oomph::MeshAsGeomObject::x_max ( )
inline

Access function for max coordinate in x direction.

Definition at line 540 of file mesh_as_geometric_object.h.

References Max_coords.

double& oomph::MeshAsGeomObject::x_min ( )
inline

Access function for min coordinate in x direction.

Definition at line 537 of file mesh_as_geometric_object.h.

References Min_coords.

double& oomph::MeshAsGeomObject::y_max ( )
inline

Access function for max coordinate in y direction.

Definition at line 546 of file mesh_as_geometric_object.h.

References Max_coords.

double& oomph::MeshAsGeomObject::y_min ( )
inline

Access function for min coordinate in y direction.

Definition at line 543 of file mesh_as_geometric_object.h.

References Min_coords.

double& oomph::MeshAsGeomObject::z_max ( )
inline

Access function for max coordinate in z direction.

Definition at line 552 of file mesh_as_geometric_object.h.

References Max_coords.

double& oomph::MeshAsGeomObject::z_min ( )
inline

Access function for min coordinate in z direction.

Definition at line 549 of file mesh_as_geometric_object.h.

References Min_coords.

Member Data Documentation

bool oomph::MeshAsGeomObject::Already_warned_about_large_number_of_bin_cells =false
static

Boolean flag to make sure that warning about large number of bin cells only gets triggered once.

Boolean flag to make sure that warning about large number.

of bin cells only gets triggered once.

Definition at line 707 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

bool oomph::MeshAsGeomObject::Already_warned_about_small_number_of_bin_cells =false
static

Boolean flag to make sure that warning about small number of bin cells only gets triggered once.

Boolean flag to make sure that warning about small number.

of bin cells only gets triggered once.

Definition at line 718 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

SparseVector<Vector<std::pair<FiniteElement*,Vector<double> > > > oomph::MeshAsGeomObject::Bin_object_coord_pairs
private
OomphCommunicator* oomph::MeshAsGeomObject::Communicator_pt
private

Communicator.

Definition at line 267 of file mesh_as_geometric_object.h.

Referenced by get_min_and_max_coordinates().

unsigned oomph::MeshAsGeomObject::Current_max_spiral_level
private

Current max. spiralling level.

Definition at line 262 of file mesh_as_geometric_object.h.

Referenced by current_max_spiral_level().

unsigned oomph::MeshAsGeomObject::Current_min_spiral_level
private

Current min. spiralling level.

Definition at line 259 of file mesh_as_geometric_object.h.

Referenced by current_min_spiral_level().

Vector<Data*> oomph::MeshAsGeomObject::Geom_data_pt
private

Vector of pointers to Data items that affects the object's shape.

Definition at line 219 of file mesh_as_geometric_object.h.

Referenced by geom_data_pt(), and ngeom_data().

bool oomph::MeshAsGeomObject::Have_used_eulerian_coordinates_during_setup
private

Flag to indicate that MeshAsGeomObject has used Eulerian coordinates when setting up bin.

Definition at line 273 of file mesh_as_geometric_object.h.

Referenced by output_bins().

Vector<double> oomph::MeshAsGeomObject::Max_coords
private

Storage for max coordinates in the mesh.

Definition at line 247 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects(), get_bin(), get_bin_vertices(), get_min_and_max_coordinates(), x_max(), y_max(), and z_max().

double oomph::MeshAsGeomObject::Max_search_radius
private

Max radius beyond which we stop searching the bin. Initialised to DBL_MAX so keep going until the point is found or until we've searched every single bin. Overwriting this means we won't search in bins whose closest vertex is at a distance greater than Max_search_radius from the point to be located.

Definition at line 238 of file mesh_as_geometric_object.h.

Referenced by max_search_radius(), and MeshAsGeomObject().

unsigned oomph::MeshAsGeomObject::Max_spiral_level
private

Max. spiralling level (for efficiency; effect similar to max_search_radius)

Definition at line 241 of file mesh_as_geometric_object.h.

Referenced by max_spiral_level(), and MeshAsGeomObject().

Vector<double> oomph::MeshAsGeomObject::Min_coords
private

Storage for min coordinates in the mesh.

Definition at line 244 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects(), get_bin(), get_bin_vertices(), get_min_and_max_coordinates(), x_min(), y_min(), and z_min().

unsigned oomph::MeshAsGeomObject::Nbin_x
private
unsigned oomph::MeshAsGeomObject::Nbin_y
private
unsigned oomph::MeshAsGeomObject::Nbin_z
private
Vector<FiniteElement*> oomph::MeshAsGeomObject::Sub_geom_object_pt
private

Internal storage for the elements that constitute the object.

Definition at line 222 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

bool oomph::MeshAsGeomObject::Suppress_synchronisation_of_bins
private

In parallel computation, suppress synchronisation of bins Default is false. If set to true, each processor will create its own bin structure, spanning only its own elements.

Definition at line 231 of file mesh_as_geometric_object.h.

Referenced by get_min_and_max_coordinates(), and MeshAsGeomObject().

bool oomph::MeshAsGeomObject::Suppress_warning_about_large_total_number_of_bins =false
static

Boolean to supppress warnings about large number of bins.

Definition at line 703 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

bool oomph::MeshAsGeomObject::Suppress_warning_about_small_number_of_bins =false
static

Boolean to supppress warnings about small number of bins.

Definition at line 714 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

unsigned oomph::MeshAsGeomObject::Threshold_for_elements_per_bin_warning = 100
static

Fraction of elements/bin that triggers warning. Too many elements per bin can lead to very slow computations.

Number elements/bin that triggers a warning when it gets too large, i.e. too many elements per bin, which can lead to very slow computations. Sart at 100.

Definition at line 711 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

unsigned long oomph::MeshAsGeomObject::Threshold_for_total_bin_cell_number_warning
static
Initial value:
=
50000000

Total number of bins above which warning is issued. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI).

Definition at line 700 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects().

unsigned long oomph::MeshAsGeomObject::Total_nbin_cells_counter =0
static

Counter for overall number of bins allocated – used to issue warning if this exceeds a threshhold. (Default assignment of 100^DIM bins per MeshAsGeomObject can be a killer if there are huge numbers of sub-meshes (e.g. in unstructured FSI).

Definition at line 694 of file mesh_as_geometric_object.h.

Referenced by create_bins_of_objects(), and flush_bins_of_objects().

bool oomph::MeshAsGeomObject::Use_eulerian_coordinates_during_setup =false
static

Globally set-able (sorry!) flag to indicate that MeshAsGeomObject is to use Eulerian coordinates when setting up bin.

Definition at line 688 of file mesh_as_geometric_object.h.

Referenced by oomph::RefineableTriangleMesh< ELEMENT >::adapt(), construct_it(), create_bins_of_objects(), and get_min_and_max_coordinates().


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