30 #ifndef OOMPH_MESH_AS_GEOMETRIC_OBJECT_HEADER
31 #define OOMPH_MESH_AS_GEOMETRIC_OBJECT_HEADER
35 #include <oomph-lib-config.h>
61 namespace MeshAsGeomObject_Helper
70 SamplePointContainerParameters*& sample_point_container_parameters_pt);
101 sample_point_container_parameters_pt) != 0)
106 sample_point_container_parameters_pt) != 0)
110 #ifdef OOMPH_HAS_CGAL
112 sample_point_container_parameters_pt) != 0)
119 throw OomphLibError(
"Wrong sample_point_container_parameters_pt",
120 OOMPH_CURRENT_FUNCTION,
121 OOMPH_EXCEPTION_LOCATION);
170 dim[0] = dim_reduce[0];
171 dim[1] = dim_reduce[1];
179 static_cast<unsigned>(dim[1]));
183 std::set<Data*> tmp_geom_data;
189 for (
unsigned e = 0;
e < n_sub_object;
e++)
198 std::ostringstream error_message;
199 error_message <<
"Unable to dynamic cast element: " << std::endl
200 <<
"into a FiniteElement: GeomObject representation is "
203 OOMPH_CURRENT_FUNCTION,
204 OOMPH_EXCEPTION_LOCATION);
217 unsigned ngeom = tmp_geom_data.size();
219 typedef std::set<Data*>::iterator IT;
221 for (IT it = tmp_geom_data.begin(); it != tmp_geom_data.end(); it++)
242 #ifdef OOMPH_HAS_CGAL
254 oomph_info <<
"Sample_point_container_version = "
257 OOMPH_CURRENT_FUNCTION,
258 OOMPH_EXCEPTION_LOCATION);
319 mesh_pt, sample_point_container_parameters_pt);
322 build_it(sample_point_container_parameters_pt);
323 delete sample_point_container_parameters_pt;
332 build_it(sample_point_container_parameters_pt);
376 const bool& use_coordinate_as_initial_guess =
false)
379 if (use_coordinate_as_initial_guess)
382 "Ignoring the use_coordinate_as_initial_guess argument.",
383 "MeshAsGeomObject::locate_zeta()",
384 OOMPH_EXCEPTION_LOCATION);
422 zeta, sub_geom_object_pt,
s);
423 if (sub_geom_object_pt == 0)
425 std::ostringstream error_message;
426 error_message <<
"Cannot locate zeta ";
427 for (
unsigned i = 0;
i < n_lagrangian;
i++)
429 error_message << zeta[
i] <<
" ";
431 error_message << std::endl;
434 OOMPH_CURRENT_FUNCTION,
435 OOMPH_EXCEPTION_LOCATION);
446 OOMPH_CURRENT_FUNCTION,
447 OOMPH_EXCEPTION_LOCATION);
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
///////////////////////////////////////////////////////////////////////////// ///////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
virtual void locate_zeta(const Vector< double > &zeta, GeomObject *&sub_geom_object_pt, Vector< double > &s)=0
Find sub-GeomObject (finite element) and the local coordinate s within it that contains point with gl...
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
A class that represents a collection of data; each Data object may contain many different individual ...
A general Finite Element class.
unsigned dim() const
Return the spatial dimension of the element, i.e. the number of local coordinates required to paramet...
/////////////////////////////////////////////////////////////////////
virtual void position(const Vector< double > &zeta, Vector< double > &r) const =0
Parametrised position on object at current time: r(zeta).
void set_nlagrangian_and_ndim(const unsigned &n_lagrangian, const unsigned &n_dim)
Set # of Lagrangian and Eulerian coordinates.
unsigned nlagrangian() const
Access function to # of Lagrangian coordinates.
///////////////////////////////////////////////////////////////////// ///////////////////////////////...
MeshAsGeomObject()
Empty Constructor.
unsigned Sample_point_container_version
Which version of the sample point container are we using?
unsigned sample_point_container_version() const
Which sample point container is used in locate zeta? (uses enum Sample_Point_Container_Type)
SamplePointContainer * Sample_point_container_pt
Pointer to the sample point container.
void build_it(SamplePointContainerParameters *sample_point_container_parameters_pt)
Helper function to actually build the thing.
unsigned nelement()
Number of elements in the underlying mesh.
void operator=(const MeshAsGeomObject &)=delete
Broken assignment operator.
OomphCommunicator * Communicator_pt
Communicator.
unsigned ngeom_data() const
How many items of Data does the shape of the object depend on?
Vector< FiniteElement * > Sub_geom_object_pt
Internal storage for the elements that constitute the object.
FiniteElement * finite_element_pt(const unsigned &e)
Return pointer to e-th finite element.
MeshAsGeomObject(Mesh *const &mesh_pt)
Constructor.
~MeshAsGeomObject()
Destructor.
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 coordina...
Data * geom_data_pt(const unsigned &j)
Return pointer to the j-th Data item that the object's shape depends on.
MeshAsGeomObject(const MeshAsGeomObject &)=delete
Broken copy constructor.
MeshAsGeomObject(SamplePointContainerParameters *sample_point_container_parameters_pt)
Constructor.
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: pre...
Mesh * Mesh_pt
Pointer to mesh.
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!...
SamplePointContainer * sample_point_container_pt() const
Pointer to the sample point container.
void dposition(const Vector< double > &xi, DenseMatrix< double > &drdxi) const
Return the derivative of the position.
Vector< Data * > Geom_data_pt
Vector of pointers to Data items that affects the object's shape.
bool is_mesh_distributed() const
Boolean to indicate if Mesh has been distributed.
OomphCommunicator * communicator_pt() const
Read-only access fct to communicator (Null if mesh is not distributed, i.e. if we don't have mpi).
FiniteElement * finite_element_pt(const unsigned &e) const
Upcast (downcast?) to FiniteElement (needed to access FiniteElement member functions).
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nnode() const
Return number of nodes in the mesh.
void output(std::ostream &outfile)
Output for all elements.
Node *& node_pt(const unsigned long &n)
Return pointer to global node n.
unsigned long nelement() const
Return number of elements in the mesh.
unsigned ndim() const
Return (Eulerian) spatial dimension of the node.
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
An OomphLibWarning object which should be created as a temporary object to issue a warning....
/////////////////////////////////////////////////////////////////////////// /////////////////////////...
///////////////////////////////////////////////////////////////// ///////////////////////////////////...
Mesh * mesh_pt() const
Pointer to mesh from whose FiniteElements sample points are created.
A slight extension to the standard template vector class so that we can include "graceful" array rang...
unsigned Default_sample_point_container_version
Default sample point container type. Must currently be one of UseCGALSamplePointContainer,...
void create_sample_point_container_parameters(Mesh *mesh_pt, SamplePointContainerParameters *&sample_point_container_parameters_pt)
"Factory" for SamplePointContainerParameters of the right type as selected by Default_sample_point_co...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
@ UseCGALSamplePointContainer
@ UseNonRefineableBinArray
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...