1 #ifndef __METRIC_TO_MESH_GENERATOR_H__ 2 #define __METRIC_TO_MESH_GENERATOR_H__ 4 #include <deal.II/fe/fe_q.h> 5 #include <deal.II/fe/fe_system.h> 6 #include <deal.II/fe/mapping_fe_field.h> 8 #include <deal.II/distributed/tria.h> 9 #include <deal.II/grid/tria.h> 11 #include <deal.II/base/conditional_ostream.h> 13 #include <deal.II/lac/vector.h> 14 #include <deal.II/lac/la_parallel_vector.templates.h> 16 #include <deal.II/dofs/dof_handler.h> 20 #if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation<dim> does not work for 1D 21 template <
int dim,
int nstate,
typename real,
typename MeshType = dealii::Triangulation<dim>>
23 template <
int dim,
int nstate,
typename real,
typename MeshType = dealii::parallel::distributed::Triangulation<dim>>
27 using VectorType = dealii::LinearAlgebra::distributed::Vector<double>;
33 std::shared_ptr<dealii::MappingFEField<dim,dim,VectorType,DoFHandlerType>> _volume_nodes_mapping,
34 std::shared_ptr<MeshType> _triangulation);
69 const dealii::FE_Q<dim>
fe_q;
84 dealii::ConditionalOStream
pcout;
const std::string filename_msh
.geo file
dealii::DoFHandler< dim > dof_handler_vertices
DoFHandler to get global index of vertices.
MetricToMeshGenerator(std::shared_ptr< dealii::MappingFEField< dim, dim, VectorType, DoFHandlerType >> _volume_nodes_mapping, std::shared_ptr< MeshType > _triangulation)
Constructor.
dealii::IndexSet ghost_vertex_dofs
Dofs not owned by current processor (but it can still access them).
std::shared_ptr< MeshType > triangulation
Stores triangulation currently in use.
dealii::DoFHandler< dim > DoFHandlerType
Alias for declaring DofHandler.
const dealii::FESystem< dim > fe_system
FESystem for vertices, created with nstate = 1 to relate an entire vertex of size dim by a single dof...
Files for the baseline physics.
dealii::IndexSet locally_owned_vertex_dofs
Dofs owned by current processor.
int mpi_rank
Processor# of current processor.
void generate_mesh_from_cellwise_metric(const std::vector< dealii::Tensor< 2, dim, real >> &cellwise_optimal_metric)
Generates mesh from the input cellwise metric.
std::shared_ptr< dealii::MappingFEField< dim, dim, VectorType, DoFHandlerType > > volume_nodes_mapping
Mapping field to update physical quadrature points, jacobians etc with the movement of volume nodes...
void write_pos_file() const
Writes .pos file.
void reinit()
Reinitialize dof handler vertices after updating triangulation.
dealii::IndexSet locally_relevant_vertex_dofs
Union of locally owned degrees of freedom and ghost degrees of freedom.
std::vector< dealii::Point< dim > > all_vertices
Stores all vertices.
void interpolate_metric_to_vertices(const std::vector< dealii::Tensor< 2, dim, real >> &cellwise_optimal_metric)
Interpolates cellwise metric field to vertices.
void write_geo_file() const
Writes .geo file.
const dealii::FE_Q< dim > fe_q
Continuous FE of degree 1.
std::string get_generated_mesh_filename() const
Returns name of the .msh file.
int n_mpi
Total no. of processors.
~MetricToMeshGenerator()=default
Destructor.
std::array< VectorType, dim *dim > optimal_metric_at_vertices
Stores optimal metric at vertices. Accessed by optimal_metric_at_vertices[position_in_metric_tensor][...
const std::string filename_pos
.pos file.
dealii::ConditionalOStream pcout
std::cout only on processor #0.
MPI_Comm mpi_communicator
Alias for MPI_COMM_WORLD.
dealii::LinearAlgebra::distributed::Vector< double > VectorType
Alias for dealii's parallel distributed vector.
Class to convert metric field to mesh using BAMG.
const std::string filename_geo
.geo file
const std::string filename
Name of the file.