Hermes2D  3.0
Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions > Class Template Reference

#include <linearizer.h>

+ Inheritance diagram for Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >:

Classes

class  Iterator
 

Public Member Functions

 LinearizerMultidimensional (LinearizerOutputType linearizerOutputType)
 
void process_solution (MeshFunctionSharedPtr< double > sln, int item=H2D_FN_VAL_0)
 
void process_solution (MeshFunctionSharedPtr< double > *sln, int *items)
 
void save_solution_vtk (MeshFunctionSharedPtr< double > sln, const char *filename, const char *quantity_name, bool mode_3D=true, int item=H2D_FN_VAL_0)
 Save a MeshFunction (Solution, Filter) in VTK format.
 
void save_solution_vtk (std::vector< MeshFunctionSharedPtr< double > > slns, std::vector< int > items, const char *filename, const char *quantity_name, bool mode_3D=true)
 Save multiple MeshFunctions (Solutions, Filters) in VTK format.
 
void save_solution_tecplot (MeshFunctionSharedPtr< double > sln, const char *filename, const char *quantity_name, int item=H2D_FN_VAL_0)
 Save a MeshFunction (Solution, Filter) in Tecplot format.
 
void save_solution_tecplot (std::vector< MeshFunctionSharedPtr< double > > slns, std::vector< int > items, const char *filename, std::vector< std::string > quantity_names)
 Save multiple MeshFunctions (Solutions, Filters) in Tecplot format.
 
void set_criterion (LinearizerCriterion criterion)
 
void set_displacement (MeshFunctionSharedPtr< double > xdisp, MeshFunctionSharedPtr< double > ydisp, double dmult=1.0)
 Set the displacement, i.e. set two functions that will deform the domain for visualization, in the x-direction, and the y-direction.
 
Iterator< typename
LinearizerDataDimensions::vertex_t > 
vertices_begin () const
 Return the appropriate iterator pointing to the beginning.
 
Iterator< typename
LinearizerDataDimensions::triangle_t > 
triangles_begin () const
 Return the appropriate iterator pointing to the beginning.
 
Iterator< typename
LinearizerDataDimensions::edge_t > 
edges_begin () const
 Return the appropriate iterator pointing to the beginning.
 
Iterator< triangle_indices_ttriangle_indices_begin () const
 Return the appropriate iterator pointing to the beginning.
 
int get_vertex_count () const
 Vertex count per all threads.
 
int get_triangle_count () const
 Triangle per all threads.
 
int get_edge_count () const
 Edge count per all threads.
 
int get_triangle_index_count () const
 Triangle index count per all threads.
 
void set_max_absolute_value (double max_abs)
 
double get_min_value () const
 
double get_max_value () const
 
void set_curvature_epsilon (double curvature_epsilon)
 
double get_curvature_epsilon () const
 Get the 'curvature' epsilon determining the tolerance of catching the shape of curved elements.
 
void free ()
 Free the instance.
 
void lock_data () const
 Internal.
 
void unlock_data () const
 
void calc_vertices_aabb (double *min_x, double *max_x, double *min_y, double *max_y) const
 Returns axis aligned bounding box (AABB) of vertices. Assumes lock.
 

Public Attributes

LinearizerCriterion criterion
 

Protected Member Functions

void check_data (MeshFunctionSharedPtr< double > *sln)
 Before assembling.
 
void init (MeshFunctionSharedPtr< double > *sln, int *item)
 
void finish (MeshFunctionSharedPtr< double > *sln)
 
void find_min_max ()
 

Protected Attributes

Quad2Dold_quad [LinearizerDataDimensions::dimension]
 
Quad2Dold_quad_x
 
Quad2Dold_quad_y
 
LinearizerOutputType linearizerOutputType
 
ThreadLinearizerMultidimensional
< LinearizerDataDimensions > ** 
threadLinearizerMultidimensional
 Assembly data.
 
std::vector< MeshSharedPtr > meshes
 
double curvature_epsilon
 Standard and curvature epsilon.
 
bool user_xdisp
 Information if user-supplied displacement functions have been provided.
 
bool user_ydisp
 
pthread_mutex_t data_mutex
 
MeshFunctionSharedPtr< double > xdisp
 Displacement functions, default to ZeroFunctions, may be supplied by set_displacement();.
 
MeshFunctionSharedPtr< double > ydisp
 
double dmult
 Displacement multiplicator - used e.g. in Elasticity to multiply the displacement to make it more noticeable.
 
int item [LinearizerDataDimensions::dimension]
 What kind of information do we want to get out of the solution.
 
int component [LinearizerDataDimensions::dimension]
 
int value_type [LinearizerDataDimensions::dimension]
 
Traverse::State ** states
 
unsigned int num_states
 
double min_val
 
double max_val
 
- Protected Attributes inherited from Hermes::Hermes2D::Mixins::Parallel
unsigned char num_threads_used
 
std::string exceptionMessageCaughtInParallelBlock
 

Friends

class ThreadLinearizerMultidimensional< LinearizerDataDimensions >
 

Detailed Description

template<typename LinearizerDataDimensions>
class Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >

LinearizerMultidimensional is a utility class which converts a higher-order FEM solution defined on a curvilinear, irregular mesh to a linear FEM solution defined on a straight-edged, regular mesh. This is done by adaptive refinement of the higher-order mesh and its subsequent regularization. The linearized mesh can then be easily displayed or exported to standard formats. The class correctly handles discontinuities in the solution (e.g., gradients or in Hcurl) by inserting double vertices where necessary. LinearizerMultidimensional also serves as a container for the resulting linearized mesh. LinearizerMultidimensional serves the purpose of both scalar and vector data.

Definition at line 44 of file linearizer.h.

Constructor & Destructor Documentation

template<typename LinearizerDataDimensions >
Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::LinearizerMultidimensional ( LinearizerOutputType  linearizerOutputType)

Constructor.

Parameters
[in]linearizerOutputTypeSets this instance to be either for OpenGL visualization (Hermes Views, Agros display), or saving the output to a file (VTK, Tecplot)

Definition at line 43 of file linearizer.cpp.

Member Function Documentation

template<typename LinearizerDataDimensions >
void Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::process_solution ( MeshFunctionSharedPtr< double >  sln,
int  item = H2D_FN_VAL_0 
)

Main method - processes the solution and stores the data obtained by the process.

Parameters
[in]slnthe solution
[in]itemwhat item (function value, derivative wrt. x, ..) to use in the solution.

Definition at line 235 of file linearizer.cpp.

template<typename LinearizerDataDimensions >
void Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::set_criterion ( LinearizerCriterion  criterion)

Sets the criterion to use for the linearization process. This criterion is used in ThreadLinearizerMultidimensional class instances (see threadLinearizerMultidimensional array).

Parameters
[in]criterionThe instance of the criterion - see the class LinearizerCriterion for details (method split_decision() for the adaptive criterion, process_[triangle|quad] for the fixed one).

Definition at line 68 of file linearizer.cpp.

Referenced by Hermes::Hermes2D::Views::ScalarView::set_linearizer_criterion(), and Hermes::Hermes2D::Views::VectorView::set_vectorizer_criterion().

template<typename LinearizerDataDimensions >
void Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::set_curvature_epsilon ( double  curvature_epsilon)

Set the threshold for how fine the output for curved elements.

Parameters
[in]curvature_epsilonThe 'curvature' epsilon determining the tolerance of catching the shape of curved elements. The smaller, the finer. Default value = 1e-3.

Definition at line 74 of file linearizer.cpp.

Member Data Documentation

template<typename LinearizerDataDimensions>
LinearizerCriterion Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::criterion

Assigned criterion. Defaults to a fixed criterion with one level of refinement.

Definition at line 142 of file linearizer.h.

template<typename LinearizerDataDimensions>
LinearizerOutputType Hermes::Hermes2D::Views::LinearizerMultidimensional< LinearizerDataDimensions >::linearizerOutputType
protected

Output type setting either the OpenGL or File output. This attribute influences the data that are produced - not all data are needed for both cases.

Definition at line 156 of file linearizer.h.


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