PhotoElectrochemical Cell Simulator
A Finite Element Based Simulator For Water Splitting Solar Cells
Public Member Functions | Private Types | Private Attributes
Grid_Maker::Grid< dim > Class Template Reference

This object will be used to build meshes over triangulations provided. More...

#include <Grid.hpp>

Public Member Functions

 Grid (const ParameterSpace::Parameters &sim_parms)
 
void make_DD_Poisson_grid (Triangulation< dim > &triangulation, const int &n_global_refine)
 
void make_Dirichlet_boundaries (Triangulation< dim > &triangulation)
 Subroutine that tags boundaries to be Dirichlet portions. More...
 
void make_electrolyte_grid (Triangulation< dim > &triangulation)
 
void make_grids (Triangulation< dim > &semiconductor_triang, Triangulation< dim > &electrolyte_triang, Triangulation< dim > &Poisson_triang, const bool &full_system)
 
void make_merged_grid (const Triangulation< dim > &semiconductor_triang, const Triangulation< dim > &electrolyte_triang, Triangulation< dim > &merged_triangulation)
 
void make_Neumann_boundaries (Triangulation< dim > &triangulation)
 Tags boundaries of the semiconductor as Neumann/Insulating portions. More...
 
void make_Schottky_boundaries (Triangulation< dim > &triangulation)
 Tags boundaries of the semiconductor as Schottky portions.
 
void make_semiconductor_grid (Triangulation< dim > &triangulation)
 
void make_test_grid (Triangulation< dim > &triangulation, const int &n_global_refine)
 Creates a simple cubic grid with mixed boundaries. More...
 
void make_test_tran_grid (Triangulation< dim > &triangulation, const int &n_global_refine)
 Grid for testing the transient LDG problems. More...
 
void output_mesh (Triangulation< dim > &triangulation, const std::string &grid_name)
 Subroutine that prints the grid into a .msh file.
 
void print_grid (Triangulation< dim > &triangulation, const std::string &grid_name)
 Subroutine that prints the grid into a .eps file.
 
void refine_test_grid (Triangulation< dim > &triangulation, const unsigned int &local_refine)
 

Private Types

enum  { Interface, Dirichlet, Neumann, Schottky }
 
enum  { semiconductor_id, semi_boundary_layer_id, electrolyte_id, elec_boundary_layer_id }
 

Private Attributes

bool insulated
 Set in constructor.
 
unsigned int n_global_refine
 Set in constructor.
 
unsigned int n_local_refine
 Set in constructor.
 
double scaled_boundary_layer
 Set in constructor.
 
double scaled_domain_height
 Set in constructor.
 
double scaled_domain_length
 Set in constructor.
 
double scaled_radius_one
 Set in constructor.
 
double scaled_radius_two
 Set in constructor.
 
bool schottky
 Set in constructor.
 
bool use_boundary_layer
 Set in constructor.
 

Detailed Description

template<int dim>
class Grid_Maker::Grid< dim >

This object will be used to build meshes over triangulations provided.

This object will be used to build meshes over triangulations provided. Will build meshes for the semiconductor-electrolyte interface problem as well * as meshes for testing. Can also be used to print meshes to .eps form.

Constructor & Destructor Documentation

template<int dim>
Grid_Maker::Grid< dim >::Grid ( const ParameterSpace::Parameters sim_parms)

Grid object constructor just initializes private data to which portions of the boundary are Dirichlet and Neumann

Member Function Documentation

template<int dim>
void Grid_Maker::Grid< dim >::make_DD_Poisson_grid ( Triangulation< dim > &  triangulation,
const int &  n_global_refine 
)

Makes a cube and sets all the boundaries to be Dirichlet.

template<int dim>
void Grid_Maker::Grid< dim >::make_Dirichlet_boundaries ( Triangulation< dim > &  triangulation)

Subroutine that tags boundaries to be Dirichlet portions.

This subroutine loops over all the cells in triangulation<code/h> and finds which subroutines are on the boundary. It then flags these faces on the boundary to be Dirichlet portions of boundary.

template<int dim>
void Grid_Maker::Grid< dim >::make_electrolyte_grid ( Triangulation< dim > &  triangulation)

Makes a grid which is of the form,

electrolyte-grid.png

The top radius is radius one while the top radius is radius two . It first makes a temporary triangulation refines it, and then prints it out as "temp.msh", then reads it it in again and attaches it to the passed triangulation. The reason for doing this is so that I can merge this triangulation with another since in order to do that, they must be on the most refined level.

template<int dim>
void Grid_Maker::Grid< dim >::make_grids ( Triangulation< dim > &  semiconductor_triang,
Triangulation< dim > &  electrolyte_triang,
Triangulation< dim > &  Poisson_triang,
const bool &  full_system 
)

Makes the outline grids for the bulk semiconductor + boundary layer and electrolyte + boundary layer. It then merges them to make Poisson grid. All the grids are globally refined. Then we loop over all the cells in the triangulaitions and locally refine the cells in the boundary layer.

template<int dim>
void Grid_Maker::Grid< dim >::make_merged_grid ( const Triangulation< dim > &  semiconductor_triang,
const Triangulation< dim > &  electrolyte_triang,
Triangulation< dim > &  merged_triangulation 
)

Makes a grid which is of the form,

Poisson-grid.png

The top radius is radius one while the top radius is radius two . It does so by merging the two provided grids.

Parameters
semiconductor_triangwhich looks like
semiconductor-grid.png
electrolyte_triang which looks like
electrolyte-grid.png
.

template<int dim>
void Grid_Maker::Grid< dim >::make_Neumann_boundaries ( Triangulation< dim > &  triangulation)

Tags boundaries of the semiconductor as Neumann/Insulating portions.

This subroutine loops over all the cells in triangulation and finds which subroutines are on the boundary. It then flags these faces to be Neumann portions of boundary. The choice of which boundary faces are Neumann is preset in this subroutines source code.

NOTE: BECAREFUL TO MATCH WITH CUBE END POINTS AND DIMENSION. NOTE: Neumann corresponds to a Neumann bounary condition for Poisson and a Robin boundary condition for the drift-diffusion equation.

template<int dim>
void Grid_Maker::Grid< dim >::make_semiconductor_grid ( Triangulation< dim > &  triangulation)

Makes a grid which is of the form,

semiconductor-grid.png

The top radius is radius one while the top radius is radius two . It first makes a temporary triangulation refines it, and then prints it out as "temp.msh", then reads it it in again and attaches it to the passed triangulation. The reason for doing this is so that I can merge this triangulation with another since in order to do that, they must be on the most refined level.

template<int dim>
void Grid_Maker::Grid< dim >::make_test_grid ( Triangulation< dim > &  triangulation,
const int &  n_global_refine 
)

Creates a simple cubic grid with mixed boundaries.

Takes triangulation object and creates a mesh on it. Globally refines the mesh using the refinement level from params.n_global_refine.

See SOLARCELL::SolarCellProblem<dim>::test_steady_state.

template<int dim>
void Grid_Maker::Grid< dim >::make_test_tran_grid ( Triangulation< dim > &  triangulation,
const int &  n_global_refine 
)
template<int dim>
void Grid_Maker::Grid< dim >::refine_test_grid ( Triangulation< dim > &  triangulation,
const unsigned int &  local_refine 
)

Locally refines the triangulation around the point x = 1/2, y = 1/2.


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