Go to the documentation of this file.
20 #ifndef LIBMESH_MESH_SMOOTHER_VSMOOTHER_H
21 #define LIBMESH_MESH_SMOOTHER_VSMOOTHER_H
23 #include "libmesh/libmesh_config.h"
24 #if defined(LIBMESH_ENABLE_VSMOOTHER) && LIBMESH_DIM > 1
27 #include "libmesh/libmesh_common.h"
28 #include "libmesh/mesh_smoother.h"
40 class UnstructuredMesh;
74 unsigned miniterBC=5);
80 std::vector<float> * adapt_data,
85 Real percent_to_move=1);
93 std::vector<float> * adapt_data,
98 Real percent_to_move=1);
225 template <
typename T>
244 template <
typename T>
247 Array3D(
unsigned nx,
unsigned ny,
unsigned nz)
264 std::vector<int> & mask,
266 std::vector<int> & mcells,
267 std::vector<int> & edges,
268 std::vector<int> & hnodes);
273 int read_adp(std::vector<Real> & afun);
284 const std::vector<Real> & K,
290 std::vector<Real> & afun,
294 const std::vector<int> & mask,
296 const std::vector<int> & mcells,
297 const std::vector<int> & edges,
298 const std::vector<int> & hnodes,
300 const std::vector<int> & iter,
308 const std::vector<int> & mcells,
314 std::vector<Real> & Gamma,
319 const std::vector<int> & mcells,
326 const std::vector<int> & mask,
328 const std::vector<int> & mcells,
334 const std::vector<int> & edges,
335 const std::vector<int> & hnodes,
341 const std::vector<Real> & afun);
344 const std::vector<int> & mask,
346 const std::vector<int> & mcells,
357 const std::vector<Real> & afun,
363 const std::vector<int> & cell_in,
364 const std::vector<int> & mask,
375 const std::vector<Real> & afun,
376 std::vector<Real> & Gloc);
379 std::vector<Real> & G,
381 const std::vector<int> & cell_in,
388 const std::vector<int> & cell_in,
392 const std::vector<Real> & K,
399 const std::vector<Real> & g,
407 const std::vector<int> & ia,
408 const std::vector<int> & ja,
409 const std::vector<Real> & a,
410 std::vector<Real> & x,
411 const std::vector<Real> & b,
417 const std::vector<int> & ia,
418 const std::vector<int> & ja,
419 const std::vector<Real> & a,
420 const std::vector<Real> & u,
421 std::vector<Real> & x,
422 const std::vector<Real> & b,
423 std::vector<Real> & r,
424 std::vector<Real> & p,
425 std::vector<Real> & z,
431 const std::vector<int> & ia,
432 const std::vector<int> & ja,
433 const std::vector<Real> & a,
438 void gener(
char grid[],
int n);
443 #endif // defined(LIBMESH_ENABLE_VSMOOTHER) && LIBMESH_DIM > 1
445 #endif // LIBMESH_MESH_SMOOTHER_VSMOOTHER_H
void gener(char grid[], int n)
Real avertex(const std::vector< Real > &afun, std::vector< Real > &G, const Array2D< Real > &R, const std::vector< int > &cell_in, int nvert, int adp)
void set_generate_data(bool b)
Allow user to control whether the metric is generated from the initial mesh.
int pcg_par_check(int n, const std::vector< int > &ia, const std::vector< int > &ja, const std::vector< Real > &a, Real eps, int maxite, int msglev)
void adp_renew(const Array2D< Real > &R, const Array2D< int > &cells, std::vector< Real > &afun, int adp)
dof_id_type _n_nodes
The number of nodes in the Mesh at the time of smoothing.
std::ofstream _logfile
All output (including debugging) is sent to the _logfile.
const UnstructuredMesh * _area_of_interest
Area of Interest Mesh.
virtual void smooth() override
Redefinition of the smooth function from the base class.
int readmetr(std::string name, Array3D< Real > &H)
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< T > & operator[](unsigned i)
std::vector< std::vector< T > > _data
int readgr(Array2D< Real > &R, std::vector< int > &mask, Array2D< int > &cells, std::vector< int > &mcells, std::vector< int > &edges, std::vector< int > &hnodes)
dof_id_type _n_hanging_edges
The number of hanging node edges in the Mesh at the time of smoothing.
int writegr(const Array2D< Real > &R)
Real minJ(Array2D< Real > &R, const std::vector< int > &mask, const Array2D< int > &cells, const std::vector< int > &mcells, Real epsilon, Real w, int me, const Array3D< Real > &H, Real vol, const std::vector< int > &edges, const std::vector< int > &hnodes, int msglev, Real &Vmin, Real &emax, Real &qmin, int adp, const std::vector< Real > &afun)
std::map< dof_id_type, std::vector< dof_id_type > > _hanging_nodes
Map for hanging_nodes.
3D array type for interfacing with C APIs.
float adapt_minimum() const
std::vector< float > * _adapt_data
Vector for holding adaptive data.
const std::vector< T > & operator[](unsigned i) const
Real distance_moved() const
Real jac2(Real x1, Real y1, Real x2, Real y2)
Real vertex(Array3D< Real > &W, Array2D< Real > &F, const Array2D< Real > &R, const std::vector< int > &cell_in, Real epsilon, Real w, int nvert, const std::vector< Real > &K, const Array2D< Real > &H, int me, Real vol, int f, Real &Vmin, int adp, const std::vector< Real > &g, Real sigma)
VariationalMeshSmoother(UnstructuredMesh &mesh, Real theta=0.5, unsigned miniter=2, unsigned maxiter=5, unsigned miniterBC=5)
Simple constructor to use for smoothing purposes.
Real jac3(Real x1, Real y1, Real z1, Real x2, Real y2, Real z2, Real x3, Real y3, Real z3)
Real localP(Array3D< Real > &W, Array2D< Real > &F, Array2D< Real > &R, const std::vector< int > &cell_in, const std::vector< int > &mask, Real epsilon, Real w, int nvert, const Array2D< Real > &H, int me, Real vol, int f, Real &Vmin, Real &qmin, int adp, const std::vector< Real > &afun, std::vector< Real > &Gloc)
Real _dist_norm
Records a relative "distance moved".
Real maxE(Array2D< Real > &R, const Array2D< int > &cells, const std::vector< int > &mcells, int me, const Array3D< Real > &H, Real v, Real epsilon, Real w, std::vector< Real > &Gamma, Real &qmin)
Real minq(const Array2D< Real > &R, const Array2D< int > &cells, const std::vector< int > &mcells, int me, const Array3D< Real > &H, Real &vol, Real &Vmin)
dof_id_type _n_cells
The number of active elements in the Mesh at the time of smoothing.
The UnstructuredMesh class is derived from the MeshBase class.
Real minJ_BC(Array2D< Real > &R, const std::vector< int > &mask, const Array2D< int > &cells, const std::vector< int > &mcells, Real epsilon, Real w, int me, const Array3D< Real > &H, Real vol, int msglev, Real &Vmin, Real &emax, Real &qmin, int adp, const std::vector< Real > &afun, int NCN)
int solver(int n, const std::vector< int > &ia, const std::vector< int > &ja, const std::vector< Real > &a, std::vector< Real > &x, const std::vector< Real > &b, Real eps, int maxite, int msglev)
const unsigned _dim
Smoother control variables.
Array2D< T > & operator[](unsigned i)
std::vector< Array2D< T > > _data
This is an implementation of Larisa Branets' smoothing algorithms.
void metr_data_gen(std::string grid, std::string metr, int me)
2D array type for interfacing with C APIs.
Array2D(unsigned nx, unsigned ny)
void full_smooth(Array2D< Real > &R, const std::vector< int > &mask, const Array2D< int > &cells, const std::vector< int > &mcells, const std::vector< int > &edges, const std::vector< int > &hnodes, Real w, const std::vector< int > &iter, int me, const Array3D< Real > &H, int adp, int gr)
virtual ~VariationalMeshSmoother()
Destructor.
void set_metric(MetricType t)
Allow user to control the smoothing metric used.
int basisA(Array2D< Real > &Q, int nvert, const std::vector< Real > &K, const Array2D< Real > &H, int me)
const Real _percent_to_move
Dampening factor.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
This class provides the necessary interface for mesh smoothing.
const unsigned _miniterBC
int read_adp(std::vector< Real > &afun)
Real _distance
Max distance of the last set of movement.
const Array2D< T > & operator[](unsigned i) const
Array3D(unsigned nx, unsigned ny, unsigned nz)
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
int pcg_ic0(int n, const std::vector< int > &ia, const std::vector< int > &ja, const std::vector< Real > &a, const std::vector< Real > &u, std::vector< Real > &x, const std::vector< Real > &b, std::vector< Real > &r, std::vector< Real > &p, std::vector< Real > &z, Real eps, int maxite, int msglev)