oomph::DiskWithTwoLayersTetMeshFacetedSurface Class Reference

#include <tetmesh_faceted_surfaces.h>

+ Inheritance diagram for oomph::DiskWithTwoLayersTetMeshFacetedSurface:

Public Member Functions

 DiskWithTwoLayersTetMeshFacetedSurface (DiskLikeGeomObjectWithBoundaries *disk_parametrised_by_nonsingular_coordinates_pt, const unsigned &half_nsegment, const unsigned &first_one_based_boundary_id_for_disk, const unsigned &one_based_region_id_above_disk, const unsigned &one_based_region_id_below_disk, unsigned &last_one_based_boundary_id_for_disk, unsigned &last_one_based_boundary_id)
 
- Public Member Functions inherited from oomph::DiskTetMeshFacetedSurface
 DiskTetMeshFacetedSurface (DiskLikeGeomObjectWithBoundaries *disk_parametrised_by_nonsingular_coordinates_pt, const unsigned &half_nsegment, const unsigned &first_one_based_boundary_id_for_disk, unsigned &last_one_based_boundary_id_for_disk)
 
 ~DiskTetMeshFacetedSurface ()
 Destructor. More...
 
void boundary_zeta01 (const unsigned &facet_id, const double &zeta_boundary, Vector< double > &zeta)
 
- Public Member Functions inherited from oomph::TetMeshFacetedSurface
 TetMeshFacetedSurface ()
 Constructor: More...
 
virtual ~TetMeshFacetedSurface ()
 Empty destructor. More...
 
unsigned nvertex () const
 Number of vertices. More...
 
unsigned nfacet () const
 Number of facets. More...
 
unsigned one_based_facet_boundary_id (const unsigned &j) const
 One-based boundary id of j-th facet. More...
 
unsigned one_based_vertex_boundary_id (const unsigned &j) const
 First (of possibly multiple) one-based boundary id of j-th vertex. More...
 
double vertex_coordinate (const unsigned &j, const unsigned &i) const
 i-th coordinate of j-th vertex More...
 
unsigned nvertex_on_facet (const unsigned &j) const
 Number of vertices defining the j-th facet. More...
 
bool boundaries_can_be_split_in_tetgen ()
 Test whether boundary can be split in tetgen. More...
 
void enable_boundaries_can_be_split_in_tetgen ()
 Test whether boundaries can be split in tetgen. More...
 
void disable_boundaries_can_be_split_in_tetgen ()
 Test whether boundaries can be split in tetgen. More...
 
TetMeshFacetfacet_pt (const unsigned &j) const
 Pointer to j-th facet. More...
 
TetMeshVertexvertex_pt (const unsigned &j) const
 Pointer to j-th vertex. More...
 
DiskLikeGeomObjectWithBoundariesgeom_object_with_boundaries_pt ()
 
void output (std::ostream &outfile) const
 Output. More...
 
void output (const std::string &filename) const
 Output. More...
 
virtual void boundary_zeta12 (const unsigned &facet_id, const double &zeta_boundary, Vector< double > &zeta)
 
virtual void boundary_zeta20 (const unsigned &facet_id, const double &zeta_boundary, Vector< double > &zeta)
 
Vector< unsignedvertex_index_in_tetgen (const unsigned &f)
 
- Public Member Functions inherited from oomph::TetMeshFacetedClosedSurface
 TetMeshFacetedClosedSurface ()
 Constructor: More...
 
virtual ~TetMeshFacetedClosedSurface ()
 Empty destructor. More...
 
void enable_faceted_volume_represents_hole_for_gmsh ()
 Declare closed surface to represent hole for gmsh. More...
 
void disable_faceted_volume_represents_hole_for_gmsh ()
 Declare closed surface NOT to represent hole for gmsh. More...
 
bool faceted_volume_represents_hole_for_gmsh () const
 Does closed surface represent hole for gmsh? More...
 
const doubleinternal_point_for_tetgen (const unsigned &j, const unsigned &i) const
 i=th coordinate of the j-th internal point for tetgen More...
 
void set_hole_for_tetgen (const Vector< double > &hole_point)
 Specify coordinate of hole for tetgen. More...
 
void set_region_for_tetgen (const unsigned &region_id, const Vector< double > &region_point)
 
unsigned ninternal_point_for_tetgen ()
 
const intregion_id_for_tetgen (const unsigned &j) const
 
bool internal_point_identifies_hole_for_tetgen (const unsigned &j)
 Is j-th internal point for tetgen associated with a hole? More...
 
bool internal_point_identifies_region_for_tetgen (const unsigned &j)
 Is j-th internal point for tetgen associated with a region? More...
 

Additional Inherited Members

- Protected Attributes inherited from oomph::DiskTetMeshFacetedSurface
unsigned Nfacet
 Number of facets. More...
 
std::vector< boolFacet_is_on_boundary
 Is facet on boundary? More...
 
Vector< doubleLeft_boundary_coordinate
 Left boundary coordinate of i-th facet. More...
 
Vector< doubleRight_boundary_coordinate
 Right boundary coordinate of i-th facet. More...
 
Vector< unsignedBoundary_id
 ID of boundary the i-th facet is located on. More...
 
unsigned Nelement_on_disk_boundary
 Number of elements on disk boundary. More...
 
TriangleMesh< TPoissonElement< 2, 2 > > * Tri_mesh_pt
 Mesh used to facet-ise (discretise) disk. More...
 
std::map< Node *, TetMeshVertex * > Equivalent_vertex_pt
 Mapping between nodes and vertices. More...
 
- Protected Attributes inherited from oomph::TetMeshFacetedSurface
Vector< TetMeshVertex * > Vertex_pt
 Vector pointers to vertices. More...
 
Vector< TetMeshFacet * > Facet_pt
 Vector of pointers to facets. More...
 
bool Boundaries_can_be_split_in_tetgen
 
Vector< Vector< unsigned > > Facet_vertex_index_in_tetgen
 
DiskLikeGeomObjectWithBoundariesGeom_object_with_boundaries_pt
 GeomObject with boundaries associated with this surface. More...
 

Detailed Description

//////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// TetMeshFacetedClosedSurface that defines disk with two layers on top and bottom

Constructor & Destructor Documentation

◆ DiskWithTwoLayersTetMeshFacetedSurface()

oomph::DiskWithTwoLayersTetMeshFacetedSurface::DiskWithTwoLayersTetMeshFacetedSurface ( DiskLikeGeomObjectWithBoundaries disk_parametrised_by_nonsingular_coordinates_pt,
const unsigned half_nsegment,
const unsigned first_one_based_boundary_id_for_disk,
const unsigned one_based_region_id_above_disk,
const unsigned one_based_region_id_below_disk,
unsigned last_one_based_boundary_id_for_disk,
unsigned last_one_based_boundary_id 
)
inline

Constructor: Pass pointer to GeomObject (with boundaries, and parametrised by coordinates without coordinate singularities, i.e. not polars, say) that defines the shape of the disk. Other args specify:

  • half the number of segments on perimeter of disk
  • first one-based boundary ID to be used to enumerate the boundaries on the disk
  • one based region ID for region above the disk
  • one based region ID for region below the disk

Computes:

  • last one-based boundary id used to enumerate boundaries on disk
  • last one-based boundary id used to enumerate any boundaries

Identify region for tetgen

1094  :
1095  DiskTetMeshFacetedSurface(disk_parametrised_by_nonsingular_coordinates_pt,
1096  half_nsegment,
1097  first_one_based_boundary_id_for_disk,
1098  last_one_based_boundary_id_for_disk)
1099  {
1100 
1101  // Currently: Number of facets = number of elements on disk.
1102  // Set bounding region numbers for existing facets:
1103  unsigned nel=Nfacet;
1104  for (unsigned e=0;e<Nfacet;e++)
1105  {
1106  Facet_pt[e]->set_one_based_adjacent_region_id(
1107  one_based_region_id_above_disk);
1108  Facet_pt[e]->set_one_based_adjacent_region_id(
1109  one_based_region_id_below_disk);
1110  }
1111 
1112  // Additional facets: one square facet moving up/down from each
1113  // side and two lids.
1115  Facet_pt.resize(Nfacet);
1116  Facet_is_on_boundary.resize(Nfacet,false);
1117 
1118  // Find sorted sequence of vertices going around the
1119  // perimeter of the disk
1120  Vector<TetMeshVertex*> sorted_perimeter_vertex_pt;
1121  std::set<TetMeshFacet*> boundary_facet_pt;
1122  bool first=true;
1123  for (unsigned e=0;e<nel;e++)
1124  {
1125  if (Facet_is_on_boundary[e])
1126  {
1127  boundary_facet_pt.insert(Facet_pt[e]);
1128  if (first)
1129  {
1130  TetMeshVertex* vertex0_pt=Facet_pt[e]->vertex_pt(0);
1131  sorted_perimeter_vertex_pt.push_back(vertex0_pt);
1132  first=false;
1133  }
1134  }
1135  }
1136  while (boundary_facet_pt.size()!=1)
1137  {
1138  for (std::set<TetMeshFacet*>::iterator it=boundary_facet_pt.begin();
1139  it!=boundary_facet_pt.end();it++)
1140  {
1141  unsigned n_last=sorted_perimeter_vertex_pt.size();
1142  if (sorted_perimeter_vertex_pt[n_last-1]==
1143  (*it)->vertex_pt(0))
1144  {
1145  sorted_perimeter_vertex_pt.push_back((*it)->vertex_pt(1));
1146  boundary_facet_pt.erase(*it);
1147  break;
1148  }
1149  }
1150  }
1151 
1152  //Find mean position
1153  double z_mean=0.0;
1154  double z_min= DBL_MAX;
1155  double z_max=-DBL_MAX;
1156  unsigned n=sorted_perimeter_vertex_pt.size();
1157  for (unsigned j=0;j<n;j++)
1158  {
1159  double z=sorted_perimeter_vertex_pt[j]->x(2);
1160  z_mean+=z;
1161  if (z>z_max) z_max=z;
1162  if (z<z_min) z_min=z;
1163  }
1164  z_mean/=double(n);
1165  double layer_thickness=0.6*(z_max-z_min);
1166 
1167  // Loop over upper/lower layer
1168  unsigned facet_count=nel;
1169  int offset_sign=-1;
1170  unsigned one_based_boundary_id=last_one_based_boundary_id_for_disk+1;
1171  unsigned n_vertex_on_disk=Vertex_pt.size();
1172  unsigned n_vertex_on_disk_perimeter=sorted_perimeter_vertex_pt.size();
1173  for (unsigned i_offset=0;i_offset<2;i_offset++)
1174  {
1175  unsigned one_based_region_id=one_based_region_id_below_disk;
1176  if (i_offset==1) one_based_region_id=one_based_region_id_above_disk;
1177 
1178  for (unsigned j=0;j<n_vertex_on_disk_perimeter;j++)
1179  {
1180  Vector<double> posn(3);
1181  posn[0]=sorted_perimeter_vertex_pt[j]->x(0);
1182  posn[1]=sorted_perimeter_vertex_pt[j]->x(1);
1183  posn[2]=z_mean+double(offset_sign)*layer_thickness;
1184  Vertex_pt.push_back(new TetMeshVertex(posn));
1185  }
1186  unsigned count=0;
1187  for (unsigned j=0;j<n_vertex_on_disk_perimeter-1;j++)
1188  {
1189  Facet_pt[facet_count]=new TetMeshFacet(4);
1190  Facet_pt[facet_count]->set_one_based_boundary_id(one_based_boundary_id);
1191  Facet_pt[facet_count]->set_vertex_pt(0,sorted_perimeter_vertex_pt[j]);
1192  Facet_pt[facet_count]->set_vertex_pt(1,sorted_perimeter_vertex_pt[j+1]);
1193  Facet_pt[facet_count]->
1194  set_vertex_pt(2,Vertex_pt[n_vertex_on_disk+
1195  i_offset*n_vertex_on_disk_perimeter+j+1]);
1196  Facet_pt[facet_count]->
1197  set_vertex_pt(3,Vertex_pt[n_vertex_on_disk+
1198  i_offset*n_vertex_on_disk_perimeter+j ]);
1199  Facet_pt[facet_count]->
1200  set_one_based_adjacent_region_id(one_based_region_id);
1201  count++;
1202  facet_count++;
1203  one_based_boundary_id++;
1204  }
1205  Facet_pt[facet_count]=new TetMeshFacet(4);
1206  Facet_pt[facet_count]->set_one_based_boundary_id(one_based_boundary_id);
1207  Facet_pt[facet_count]->set_vertex_pt(0,sorted_perimeter_vertex_pt[count]);
1208  Facet_pt[facet_count]->set_vertex_pt(1,sorted_perimeter_vertex_pt[0]);
1209  Facet_pt[facet_count]->
1210  set_vertex_pt(2,Vertex_pt[n_vertex_on_disk+
1211  i_offset*n_vertex_on_disk_perimeter+0]);
1212  Facet_pt[facet_count]->
1213  set_vertex_pt(3,Vertex_pt[n_vertex_on_disk+
1214  i_offset*n_vertex_on_disk_perimeter+count]);
1215  Facet_pt[facet_count]->
1216  set_one_based_adjacent_region_id(one_based_region_id);
1217 
1218 
1219  // Closing lid
1220  facet_count++;
1221  one_based_boundary_id++;
1222  Facet_pt[facet_count]=new TetMeshFacet(n_vertex_on_disk_perimeter);
1223  Facet_pt[facet_count]->set_one_based_boundary_id(one_based_boundary_id);
1224  for (unsigned j=0;j<n_vertex_on_disk_perimeter;j++)
1225  {
1226  Facet_pt[facet_count]->
1227  set_vertex_pt(j,Vertex_pt[n_vertex_on_disk+
1228  i_offset*n_vertex_on_disk_perimeter+j]);
1229  }
1230  Facet_pt[facet_count]->
1231  set_one_based_adjacent_region_id(one_based_region_id);
1232 
1233  // Last one used (gets assigned twice but last one sticks!)
1234  last_one_based_boundary_id=one_based_boundary_id;
1235 
1236  // Bump
1237  facet_count++;
1238  one_based_boundary_id++;
1239 
1241  Vector<double> region_point(3,0.0);
1242  region_point[2]=z_mean+0.5*double(offset_sign)*layer_thickness;
1243  set_region_for_tetgen(one_based_region_id-1,region_point);
1244 
1245  offset_sign*=-1;
1246  }
1247  }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::vector< bool > Facet_is_on_boundary
Is facet on boundary?
Definition: tetmesh_faceted_surfaces.h:693
DiskTetMeshFacetedSurface(DiskLikeGeomObjectWithBoundaries *disk_parametrised_by_nonsingular_coordinates_pt, const unsigned &half_nsegment, const unsigned &first_one_based_boundary_id_for_disk, unsigned &last_one_based_boundary_id_for_disk)
Definition: tetmesh_faceted_surfaces.h:377
unsigned Nfacet
Number of facets.
Definition: tetmesh_faceted_surfaces.h:690
unsigned Nelement_on_disk_boundary
Number of elements on disk boundary.
Definition: tetmesh_faceted_surfaces.h:705
void set_region_for_tetgen(const unsigned &region_id, const Vector< double > &region_point)
Definition: tet_mesh.h:582
Vector< TetMeshVertex * > Vertex_pt
Vector pointers to vertices.
Definition: tet_mesh.h:483
Vector< TetMeshFacet * > Facet_pt
Vector of pointers to facets.
Definition: tet_mesh.h:486
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References e(), oomph::DiskTetMeshFacetedSurface::Facet_is_on_boundary, oomph::TetMeshFacetedSurface::Facet_pt, j, n, oomph::DiskTetMeshFacetedSurface::Nelement_on_disk_boundary, oomph::DiskTetMeshFacetedSurface::Nfacet, oomph::TetMeshFacetedClosedSurface::set_region_for_tetgen(), and oomph::TetMeshFacetedSurface::Vertex_pt.


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