Loading...
Searching...
No Matches
MeshQuality.h
// Copyright (C) 2013 Garth N. Wells
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// First added: 2013-10-07
// Last changed:
#ifndef __MESH_QUALITY_H
#define __MESH_QUALITY_H
#include <string>
#include <utility>
#include <vector>
#include <boost/multi_array.hpp>
#include <memory>
#include "Cell.h"
namespace dolfin
{
class Mesh;
class MeshQuality
{
public:
static MeshFunction<double>
radius_ratios(std::shared_ptr<const Mesh> mesh);
static MeshFunction<double>
aspect_ratio_gamma(std::shared_ptr<const Mesh> mesh);
static std::pair<double, double> radius_ratio_min_max(const Mesh& mesh);
static std::pair<std::vector<double>, std::vector<double> >
radius_ratio_histogram_data(const Mesh& mesh,
std::size_t num_bins = 50);
static std::string
radius_ratio_matplotlib_histogram(const Mesh& mesh,
std::size_t num_intervals = 50);
static void dihedral_angles(const Cell& cell, std::vector<double>& dh_angle);
static std::pair<double, double>
dihedral_angles_min_max(const Mesh& mesh);
static std::pair<std::vector<double>, std::vector<double> >
dihedral_angles_histogram_data(const Mesh& mesh,
std::size_t num_bins = 100);
static std::string
dihedral_angles_matplotlib_histogram(const Mesh& mesh,
std::size_t num_intervals = 100);
};
}
#endif
dolfin::Cell
A Cell is a MeshEntity of topological codimension 0.
Definition Cell.h:43
dolfin::MeshFunction
Definition MeshFunction.h:58
dolfin::MeshQuality
The class provides functions to quantify mesh quality.
Definition MeshQuality.h:39
dolfin::MeshQuality::dihedral_angles
static void dihedral_angles(const Cell &cell, std::vector< double > &dh_angle)
Get internal dihedral angles of a tetrahedral cell.
Definition MeshQuality.cpp:167
dolfin::MeshQuality::aspect_ratio_gamma
static MeshFunction< double > aspect_ratio_gamma(std::shared_ptr< const Mesh > mesh)
Definition MeshQuality.cpp:46
dolfin::MeshQuality::radius_ratio_matplotlib_histogram
static std::string radius_ratio_matplotlib_histogram(const Mesh &mesh, std::size_t num_intervals=50)
Definition MeshQuality.cpp:116
dolfin::MeshQuality::dihedral_angles_histogram_data
static std::pair< std::vector< double >, std::vector< double > > dihedral_angles_histogram_data(const Mesh &mesh, std::size_t num_bins=100)
Definition MeshQuality.cpp:234
dolfin::MeshQuality::radius_ratios
static MeshFunction< double > radius_ratios(std::shared_ptr< const Mesh > mesh)
Definition MeshQuality.cpp:33
dolfin::MeshQuality::radius_ratio_min_max
static std::pair< double, double > radius_ratio_min_max(const Mesh &mesh)
Definition MeshQuality.cpp:68
dolfin::MeshQuality::dihedral_angles_min_max
static std::pair< double, double > dihedral_angles_min_max(const Mesh &mesh)
Get internal minimum and maximum dihedral angles of a 3D mesh.
Definition MeshQuality.cpp:200
dolfin::MeshQuality::dihedral_angles_matplotlib_histogram
static std::string dihedral_angles_matplotlib_histogram(const Mesh &mesh, std::size_t num_intervals=100)
Create Matplotlib string to plot dihedral angles quality histogram.
Definition MeshQuality.cpp:278
dolfin::MeshQuality::radius_ratio_histogram_data
static std::pair< std::vector< double >, std::vector< double > > radius_ratio_histogram_data(const Mesh &mesh, std::size_t num_bins=50)
Definition MeshQuality.cpp:85
dolfin::Mesh
Definition Mesh.h:84
dolfin
Definition adapt.h:30