oomph::TriangleMeshParameters Class Reference

#include <triangle_mesh.template.h>

Public Member Functions

 TriangleMeshParameters (Vector< TriangleMeshClosedCurve * > &outer_boundary_pt)
 
 TriangleMeshParameters (TriangleMeshClosedCurve *outer_boundary_pt)
 
 TriangleMeshParameters ()
 
virtual ~TriangleMeshParameters ()
 Empty destructor. More...
 
Vector< TriangleMeshClosedCurve * > outer_boundary_pt () const
 Helper function for getting the outer boundary. More...
 
Vector< TriangleMeshClosedCurve * > & outer_boundary_pt ()
 Helper function for getting access to the outer boundary. More...
 
TriangleMeshClosedCurveouter_boundary_pt (const unsigned &i) const
 Helper function for getting the i-th outer boundary. More...
 
TriangleMeshClosedCurve *& outer_boundary_pt (const unsigned &i)
 Helper function for getting access to the i-th outer boundary. More...
 
Vector< TriangleMeshClosedCurve * > internal_closed_curve_pt () const
 Helper function for getting the internal closed boundaries. More...
 
Vector< TriangleMeshClosedCurve * > & internal_closed_curve_pt ()
 
Vector< TriangleMeshOpenCurve * > internal_open_curves_pt () const
 Helper function for getting the internal open boundaries. More...
 
Vector< TriangleMeshOpenCurve * > & internal_open_curves_pt ()
 
double element_area () const
 Helper function for getting the element area. More...
 
doubleelement_area ()
 Helper function for getting access to the element area. More...
 
Vector< Vector< double > > extra_holes_coordinates () const
 Helper function for getting the extra holes. More...
 
Vector< Vector< double > > & extra_holes_coordinates ()
 Helper function for getting access to the extra holes. More...
 
void add_region_coordinates (const unsigned &i, Vector< double > &region_coordinates)
 Helper function for getting the extra regions. More...
 
std::map< unsigned, Vector< double > > & regions_coordinates ()
 Helper function for getting access to the regions coordinates. More...
 
void set_target_area_for_region (const unsigned &i, const double &area)
 Helper function to specify target area for region. More...
 
std::map< unsigned, double > & target_area_for_region ()
 Helper function for getting access to the region's target areas. More...
 
void enable_use_attributes ()
 Helper function for enabling the use of attributes. More...
 
void disable_use_attributes ()
 Helper function for disabling the use of attributes. More...
 
bool is_use_attributes () const
 
void enable_boundary_refinement ()
 Helper function for enabling the use of boundary refinement. More...
 
bool is_mesh_distributed () const
 Boolean to indicate if Mesh has been distributed. More...
 
void set_communicator_pt (OomphCommunicator *comm_pt)
 Function to set communicator (mesh is then assumed to be distributed) More...
 
OomphCommunicatorcommunicator_pt () const
 Read-only access fct to communicator (Null if mesh is not distributed) More...
 
void disable_boundary_refinement ()
 Helper function for disabling the use of boundary refinement. More...
 
bool is_boundary_refinement_allowed () const
 Helper function for getting the status of boundary refinement. More...
 
void enable_internal_boundary_refinement ()
 Helper function for enabling the use of boundary refinement. More...
 
void disable_internal_boundary_refinement ()
 Helper function for disabling the use of boundary refinement. More...
 
bool is_internal_boundary_refinement_allowed () const
 Helper function for getting the status of boundary refinement. More...
 
void enable_automatic_creation_of_vertices_on_boundaries ()
 
void disable_automatic_creation_of_vertices_on_boundaries ()
 
bool is_automatic_creation_of_vertices_on_boundaries_allowed ()
 

Protected Attributes

Vector< TriangleMeshClosedCurve * > Outer_boundary_pt
 The outer boundary. More...
 
Vector< TriangleMeshClosedCurve * > Internal_closed_curve_pt
 Internal closed boundaries. More...
 
Vector< TriangleMeshOpenCurve * > Internal_open_curves_pt
 Internal boundaries. More...
 
double Element_area
 The element are when calling triangulate external routine. More...
 
Vector< Vector< double > > Extra_holes_coordinates
 Store the coordinates for defining extra holes. More...
 
std::map< unsigned, Vector< double > > Regions_coordinates
 
std::map< unsigned, doubleRegions_areas
 
bool Use_attributes
 Define the use of attributes (regions) More...
 
bool Boundary_refinement
 Do not allow refinement of nodes on the boundary. More...
 
bool Internal_boundary_refinement
 Do not allow refinement of nodes on the internal boundary. More...
 
bool Allow_automatic_creation_of_vertices_on_boundaries
 
OomphCommunicatorComm_pt
 

Detailed Description

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// Helper object for dealing with the parameters used for the TriangleMesh objects

Constructor & Destructor Documentation

◆ TriangleMeshParameters() [1/3]

oomph::TriangleMeshParameters::TriangleMeshParameters ( Vector< TriangleMeshClosedCurve * > &  outer_boundary_pt)
inline

Constructor: Only takes the outer boundary, all the other parameters are stated with the specific parameters

100  Element_area(0.2),
101  Use_attributes(false),
102  Boundary_refinement(true),
105  Comm_pt(0)
106  {
107  }
bool Boundary_refinement
Do not allow refinement of nodes on the boundary.
Definition: triangle_mesh.template.h:394
Vector< TriangleMeshClosedCurve * > outer_boundary_pt() const
Helper function for getting the outer boundary.
Definition: triangle_mesh.template.h:139
bool Internal_boundary_refinement
Do not allow refinement of nodes on the internal boundary.
Definition: triangle_mesh.template.h:397
Vector< TriangleMeshClosedCurve * > Outer_boundary_pt
The outer boundary.
Definition: triangle_mesh.template.h:368
bool Allow_automatic_creation_of_vertices_on_boundaries
Definition: triangle_mesh.template.h:401
bool Use_attributes
Define the use of attributes (regions)
Definition: triangle_mesh.template.h:391
OomphCommunicator * Comm_pt
Definition: triangle_mesh.template.h:406
double Element_area
The element are when calling triangulate external routine.
Definition: triangle_mesh.template.h:377

◆ TriangleMeshParameters() [2/3]

oomph::TriangleMeshParameters::TriangleMeshParameters ( TriangleMeshClosedCurve outer_boundary_pt)
inline

Constructor: Only takes the outer boundary, all the other parameters are stated with the specific parameters

112  : Element_area(0.2),
113  Use_attributes(false),
114  Boundary_refinement(true),
117  Comm_pt(0)
118  {
119  Outer_boundary_pt.resize(1);
121  }

References outer_boundary_pt(), and Outer_boundary_pt.

◆ TriangleMeshParameters() [3/3]

oomph::TriangleMeshParameters::TriangleMeshParameters ( )
inline

Constructor: Takes nothing and initializes the other parameters to the default ones

126  : Element_area(0.2),
127  Use_attributes(false),
128  Boundary_refinement(true),
131  Comm_pt(0)
132  {
133  }

◆ ~TriangleMeshParameters()

virtual oomph::TriangleMeshParameters::~TriangleMeshParameters ( )
inlinevirtual

Empty destructor.

136 {}

Member Function Documentation

◆ add_region_coordinates()

void oomph::TriangleMeshParameters::add_region_coordinates ( const unsigned i,
Vector< double > &  region_coordinates 
)
inline

Helper function for getting the extra regions.

215  {
216  // Verify if not using the default region number (zero)
217  if (i == 0)
218  {
219  std::ostringstream error_message;
220  error_message
221  << "Please use another region id different from zero.\n"
222  << "It is internally used as the default region number.\n";
223  throw OomphLibError(error_message.str(),
226  }
227 
228  // First check if the region with the specified id does not already exist
229  std::map<unsigned, Vector<double>>::iterator it;
230  it = Regions_coordinates.find(i);
231 
232  // If it is already a region defined with that id throw an error
233  if (it != Regions_coordinates.end())
234  {
235  std::ostringstream error_message;
236  error_message << "The region id (" << i << ") that you are using for"
237  << "defining\n"
238  << "your region is already in use. Use another\n"
239  << "region id and verify that you are not re-using\n"
240  << " previously defined regions ids\n"
241  << std::endl;
242  OomphLibWarning(error_message.str(),
245  }
246 
247  // If it does not exist then create the map
248  Regions_coordinates[i] = region_coordinates;
249 
250  // Automatically set the using of attributes to enable
252  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
void enable_use_attributes()
Helper function for enabling the use of attributes.
Definition: triangle_mesh.template.h:273
std::map< unsigned, Vector< double > > Regions_coordinates
Definition: triangle_mesh.template.h:384
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References enable_use_attributes(), i, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION, and Regions_coordinates.

Referenced by oomph::DiskTetMeshFacetedSurface::DiskTetMeshFacetedSurface(), DropInChannelProblem< ELEMENT >::DropInChannelProblem(), HomogenisationProblem< ELEMENT >::HomogenisationProblem(), MeltContactProblem< ELEMENT >::MeltContactProblem(), RingWithTRibProblem< ELASTICITY_ELEMENT >::RingWithTRibProblem(), SolarRadiationProblem< ELEMENT >::SolarRadiationProblem(), StefanBoltzmannProblem< ELEMENT >::StefanBoltzmannProblem(), TwoLayerInterfaceProblem< ELEMENT >::TwoLayerInterfaceProblem(), and UnstructuredFvKProblem< ELEMENT >::UnstructuredFvKProblem().

◆ communicator_pt()

OomphCommunicator* oomph::TriangleMeshParameters::communicator_pt ( ) const
inline

Read-only access fct to communicator (Null if mesh is not distributed)

311  {
312  return Comm_pt;
313  }

References Comm_pt.

◆ disable_automatic_creation_of_vertices_on_boundaries()

void oomph::TriangleMeshParameters::disable_automatic_creation_of_vertices_on_boundaries ( )
inline

Disables the creation of points (by Triangle) on the outer and internal boundaries

References Allow_automatic_creation_of_vertices_on_boundaries.

◆ disable_boundary_refinement()

void oomph::TriangleMeshParameters::disable_boundary_refinement ( )
inline

Helper function for disabling the use of boundary refinement.

317  {
318  Boundary_refinement = false;
319  }

References Boundary_refinement.

Referenced by HomogenisationProblem< ELEMENT >::HomogenisationProblem().

◆ disable_internal_boundary_refinement()

void oomph::TriangleMeshParameters::disable_internal_boundary_refinement ( )
inline

Helper function for disabling the use of boundary refinement.

335  {
337  }

References Internal_boundary_refinement.

◆ disable_use_attributes()

void oomph::TriangleMeshParameters::disable_use_attributes ( )
inline

Helper function for disabling the use of attributes.

280  {
281  Use_attributes = false;
282  }

References Use_attributes.

◆ element_area() [1/2]

double& oomph::TriangleMeshParameters::element_area ( )
inline

Helper function for getting access to the element area.

196  {
197  return Element_area;
198  }

References Element_area.

◆ element_area() [2/2]

double oomph::TriangleMeshParameters::element_area ( ) const
inline

Helper function for getting the element area.

190  {
191  return Element_area;
192  }

References Element_area.

Referenced by AxiPoroProblem< ELEMENT, TIMESTEPPER >::AxiPoroProblem(), AxisymmetricVibratingShellProblem< ELEMENT >::AxisymmetricVibratingShellProblem(), BubbleInChannelProblem< ELEMENT >::BubbleInChannelProblem(), ContactProblem< ELEMENT >::ContactProblem(), DarcyProblem< ELEMENT >::DarcyProblem(), oomph::DiskTetMeshFacetedSurface::DiskTetMeshFacetedSurface(), DropInChannelProblem< ELEMENT >::DropInChannelProblem(), ElasticAnnulusProblem< ELASTICITY_ELEMENT >::ElasticAnnulusProblem(), FourierDecomposedTimeHarmonicLinearElasticityProblem< ELEMENT >::FourierDecomposedTimeHarmonicLinearElasticityProblem(), HomogenisationProblem< ELEMENT >::HomogenisationProblem(), MeltContactProblem< ELEMENT >::MeltContactProblem(), PMLFourierDecomposedHelmholtzProblem< ELEMENT >::PMLFourierDecomposedHelmholtzProblem(), PMLHelmholtzMGProblem< ELEMENT >::PMLHelmholtzMGProblem(), PMLProblem< ELEMENT >::PMLProblem(), PoissonProblem< ELEMENT >::PoissonProblem(), PressureWaveFSIProblem< FLUID_ELEMENT, SOLID_ELEMENT >::PressureWaveFSIProblem(), RingWithTRibProblem< ELASTICITY_ELEMENT >::RingWithTRibProblem(), SolarRadiationProblem< ELEMENT >::SolarRadiationProblem(), StefanBoltzmannProblem< ELEMENT >::StefanBoltzmannProblem(), TwoLayerInterfaceProblem< ELEMENT >::TwoLayerInterfaceProblem(), UnsteadyHeatMeltProblem< ELEMENT >::UnsteadyHeatMeltProblem(), UnsteadyHeatProblem< ELEMENT >::UnsteadyHeatProblem(), UnstructuredFluidProblem< ELEMENT >::UnstructuredFluidProblem(), UnstructuredFvKProblem< ELEMENT >::UnstructuredFvKProblem(), UnstructuredImmersedEllipseProblem< ELEMENT >::UnstructuredImmersedEllipseProblem(), UnstructuredPoissonProblem< ELEMENT >::UnstructuredPoissonProblem(), UnstructuredSolidProblem< ELEMENT, MESH >::UnstructuredSolidProblem(), UnstructuredTorusProblem< ELEMENT >::UnstructuredTorusProblem(), and VibratingShellProblem< ELEMENT >::VibratingShellProblem().

◆ enable_automatic_creation_of_vertices_on_boundaries()

void oomph::TriangleMeshParameters::enable_automatic_creation_of_vertices_on_boundaries ( )
inline

Enables the creation of points (by Triangle) on the outer and internal boundaries

References Allow_automatic_creation_of_vertices_on_boundaries.

◆ enable_boundary_refinement()

void oomph::TriangleMeshParameters::enable_boundary_refinement ( )
inline

Helper function for enabling the use of boundary refinement.

293  {
294  Boundary_refinement = true;
295  }

References Boundary_refinement.

Referenced by AxisymmetricVibratingShellProblem< ELEMENT >::AxisymmetricVibratingShellProblem(), and VibratingShellProblem< ELEMENT >::VibratingShellProblem().

◆ enable_internal_boundary_refinement()

void oomph::TriangleMeshParameters::enable_internal_boundary_refinement ( )
inline

Helper function for enabling the use of boundary refinement.

329  {
331  }

References Internal_boundary_refinement.

◆ enable_use_attributes()

void oomph::TriangleMeshParameters::enable_use_attributes ( )
inline

Helper function for enabling the use of attributes.

274  {
275  Use_attributes = true;
276  }

References Use_attributes.

Referenced by add_region_coordinates().

◆ extra_holes_coordinates() [1/2]

Vector<Vector<double> >& oomph::TriangleMeshParameters::extra_holes_coordinates ( )
inline

Helper function for getting access to the extra holes.

208  {
210  }
Vector< Vector< double > > Extra_holes_coordinates
Store the coordinates for defining extra holes.
Definition: triangle_mesh.template.h:380

References Extra_holes_coordinates.

◆ extra_holes_coordinates() [2/2]

Vector<Vector<double> > oomph::TriangleMeshParameters::extra_holes_coordinates ( ) const
inline

Helper function for getting the extra holes.

202  {
204  }

References Extra_holes_coordinates.

◆ internal_closed_curve_pt() [1/2]

Vector<TriangleMeshClosedCurve*>& oomph::TriangleMeshParameters::internal_closed_curve_pt ( )
inline

Helper function for getting access to the internal closed boundaries

171  {
173  }
Vector< TriangleMeshClosedCurve * > Internal_closed_curve_pt
Internal closed boundaries.
Definition: triangle_mesh.template.h:371

References Internal_closed_curve_pt.

◆ internal_closed_curve_pt() [2/2]

◆ internal_open_curves_pt() [1/2]

Vector<TriangleMeshOpenCurve*>& oomph::TriangleMeshParameters::internal_open_curves_pt ( )
inline

Helper function for getting access to the internal open boundaries

184  {
186  }
Vector< TriangleMeshOpenCurve * > Internal_open_curves_pt
Internal boundaries.
Definition: triangle_mesh.template.h:374

References Internal_open_curves_pt.

◆ internal_open_curves_pt() [2/2]

◆ is_automatic_creation_of_vertices_on_boundaries_allowed()

bool oomph::TriangleMeshParameters::is_automatic_creation_of_vertices_on_boundaries_allowed ( )
inline

Returns the status of the variable Allow_automatic_creation_of_vertices_on_boundaries

References Allow_automatic_creation_of_vertices_on_boundaries.

◆ is_boundary_refinement_allowed()

bool oomph::TriangleMeshParameters::is_boundary_refinement_allowed ( ) const
inline

Helper function for getting the status of boundary refinement.

323  {
324  return Boundary_refinement;
325  }

References Boundary_refinement.

◆ is_internal_boundary_refinement_allowed()

bool oomph::TriangleMeshParameters::is_internal_boundary_refinement_allowed ( ) const
inline

Helper function for getting the status of boundary refinement.

341  {
343  }

References Internal_boundary_refinement.

◆ is_mesh_distributed()

bool oomph::TriangleMeshParameters::is_mesh_distributed ( ) const
inline

Boolean to indicate if Mesh has been distributed.

299  {
300  return (Comm_pt != 0);
301  }

References Comm_pt.

◆ is_use_attributes()

bool oomph::TriangleMeshParameters::is_use_attributes ( ) const
inline

Helper function for getting the status of use_attributes variable

287  {
288  return Use_attributes;
289  }

References Use_attributes.

◆ outer_boundary_pt() [1/4]

Vector<TriangleMeshClosedCurve*>& oomph::TriangleMeshParameters::outer_boundary_pt ( )
inline

Helper function for getting access to the outer boundary.

146  {
147  return Outer_boundary_pt;
148  }

References Outer_boundary_pt.

◆ outer_boundary_pt() [2/4]

Vector<TriangleMeshClosedCurve*> oomph::TriangleMeshParameters::outer_boundary_pt ( ) const
inline

Helper function for getting the outer boundary.

140  {
141  return Outer_boundary_pt;
142  }

References Outer_boundary_pt.

Referenced by TriangleMeshParameters().

◆ outer_boundary_pt() [3/4]

TriangleMeshClosedCurve*& oomph::TriangleMeshParameters::outer_boundary_pt ( const unsigned i)
inline

Helper function for getting access to the i-th outer boundary.

158  {
159  return Outer_boundary_pt[i];
160  }

References i, and Outer_boundary_pt.

◆ outer_boundary_pt() [4/4]

TriangleMeshClosedCurve* oomph::TriangleMeshParameters::outer_boundary_pt ( const unsigned i) const
inline

Helper function for getting the i-th outer boundary.

152  {
153  return Outer_boundary_pt[i];
154  }

References i, and Outer_boundary_pt.

◆ regions_coordinates()

std::map<unsigned, Vector<double> >& oomph::TriangleMeshParameters::regions_coordinates ( )
inline

Helper function for getting access to the regions coordinates.

256  {
257  return Regions_coordinates;
258  }

References Regions_coordinates.

◆ set_communicator_pt()

void oomph::TriangleMeshParameters::set_communicator_pt ( OomphCommunicator comm_pt)
inline

Function to set communicator (mesh is then assumed to be distributed)

305  {
306  Comm_pt = comm_pt;
307  }

References Comm_pt.

◆ set_target_area_for_region()

void oomph::TriangleMeshParameters::set_target_area_for_region ( const unsigned i,
const double area 
)
inline

Helper function to specify target area for region.

262  {
263  Regions_areas[i] = area;
264  }
std::map< unsigned, double > Regions_areas
Definition: triangle_mesh.template.h:388

References i, and Regions_areas.

◆ target_area_for_region()

std::map<unsigned, double>& oomph::TriangleMeshParameters::target_area_for_region ( )
inline

Helper function for getting access to the region's target areas.

268  {
269  return Regions_areas;
270  }

References Regions_areas.

Member Data Documentation

◆ Allow_automatic_creation_of_vertices_on_boundaries

bool oomph::TriangleMeshParameters::Allow_automatic_creation_of_vertices_on_boundaries
protected

◆ Boundary_refinement

bool oomph::TriangleMeshParameters::Boundary_refinement
protected

Do not allow refinement of nodes on the boundary.

Referenced by disable_boundary_refinement(), enable_boundary_refinement(), and is_boundary_refinement_allowed().

◆ Comm_pt

OomphCommunicator* oomph::TriangleMeshParameters::Comm_pt
protected

Pointer to communicator – set to NULL if mesh is not distributed Required to pass it to new distributed meshes created at the adaptation stage

Referenced by communicator_pt(), is_mesh_distributed(), and set_communicator_pt().

◆ Element_area

double oomph::TriangleMeshParameters::Element_area
protected

The element are when calling triangulate external routine.

Referenced by element_area().

◆ Extra_holes_coordinates

Vector<Vector<double> > oomph::TriangleMeshParameters::Extra_holes_coordinates
protected

Store the coordinates for defining extra holes.

Referenced by extra_holes_coordinates().

◆ Internal_boundary_refinement

bool oomph::TriangleMeshParameters::Internal_boundary_refinement
protected

Do not allow refinement of nodes on the internal boundary.

Referenced by disable_internal_boundary_refinement(), enable_internal_boundary_refinement(), and is_internal_boundary_refinement_allowed().

◆ Internal_closed_curve_pt

Vector<TriangleMeshClosedCurve*> oomph::TriangleMeshParameters::Internal_closed_curve_pt
protected

Internal closed boundaries.

Referenced by internal_closed_curve_pt().

◆ Internal_open_curves_pt

Vector<TriangleMeshOpenCurve*> oomph::TriangleMeshParameters::Internal_open_curves_pt
protected

Internal boundaries.

Referenced by internal_open_curves_pt().

◆ Outer_boundary_pt

Vector<TriangleMeshClosedCurve*> oomph::TriangleMeshParameters::Outer_boundary_pt
protected

The outer boundary.

Referenced by outer_boundary_pt(), and TriangleMeshParameters().

◆ Regions_areas

std::map<unsigned, double> oomph::TriangleMeshParameters::Regions_areas
protected

Target areas for regions; defaults to 0.0 which (luckily) implies "no specific target area" for triangle!

Referenced by set_target_area_for_region(), and target_area_for_region().

◆ Regions_coordinates

std::map<unsigned, Vector<double> > oomph::TriangleMeshParameters::Regions_coordinates
protected

Store the coordinates for defining extra regions The key on the map is the region id

Referenced by add_region_coordinates(), and regions_coordinates().

◆ Use_attributes

bool oomph::TriangleMeshParameters::Use_attributes
protected

Define the use of attributes (regions)

Referenced by disable_use_attributes(), enable_use_attributes(), and is_use_attributes().


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