GetFEM  5.4.2
getfem::partial_mesh_fem Class Reference

a subclass of mesh_fem which allows to eliminate a number of dof of the original mesh_fem. More...

#include <getfem_partial_mesh_fem.h>

Inherits getfem::mesh_fem.

Public Member Functions

void update_from_context (void) const
 this function has to be defined and should update the object when the context is modified.
 
void adapt (const dal::bit_vector &kept_dof, const dal::bit_vector &rejected_elt=dal::bit_vector())
 build the mesh_fem keeping only the dof of the original mesh_fem which are listed in kept_dof.
 
pfem fem_of_element (size_type cv) const
 Return the basic fem associated with an element (if no fem is associated, the function will crash! use the convex_index() of the mesh_fem to check that a fem is associated to a given convex). More...
 
virtual dim_type get_qdim () const
 Return the Q dimension. More...
 
virtual void set_qdim (dim_type)
 Change the Q dimension.
 
virtual void set_qdim (dim_type, dim_type)
 Set the dimension for a matrix field.
 
virtual void set_qdim (dim_type, dim_type, dim_type, dim_type)
 Set the dimension for a fourth order tensor field.
 
virtual void set_qdim (const bgeot::multi_index &)
 Set the dimension for an arbitrary order tensor field.
 
ind_dof_ct ind_basic_dof_of_element (size_type cv) const
 Give an array of the dof numbers a of convex. More...
 
ind_dof_face_ct ind_basic_dof_of_face_of_element (size_type cv, short_type f) const
 Give an array of the dof numbers lying of a convex face (all degrees of freedom whose associated base function is non-zero on the convex face). More...
 
size_type nb_basic_dof_of_face_of_element (size_type cv, short_type f) const
 Return the number of dof lying on the given convex face. More...
 
size_type nb_basic_dof_of_element (size_type cv) const
 Return the number of degrees of freedom attached to a given convex. More...
 
base_node point_of_basic_dof (size_type cv, size_type i) const
 Return the geometrical location of a degree of freedom. More...
 
base_node point_of_basic_dof (size_type d) const
 Return the geometrical location of a degree of freedom. More...
 
dim_type basic_dof_qdim (size_type d) const
 Return the dof component number (0<= x <Qdim)
 
size_type first_convex_of_basic_dof (size_type d) const
 Shortcut for convex_to_dof(d)[0]. More...
 
const mesh::ind_cv_ct & convex_to_basic_dof (size_type d) const
 Return the list of convexes attached to the specified dof. More...
 
size_type nb_dof (void) const
 Return the total number of degrees of freedom.
 
size_type nb_basic_dof (void) const
 Return the total number of basic degrees of freedom (before the optional reduction).
 
dal::bit_vector basic_dof_on_region (const mesh_region &b) const
 Get a list of basic dof lying on a given mesh_region. More...
 
void read_from_file (std::istream &)
 Read the mesh_fem from a stream. More...
 
void write_to_file (std::ostream &ost) const
 Write the mesh_fem to a stream.
 
- Public Member Functions inherited from getfem::mesh_fem
const dal::bit_vector & convex_index () const
 Get the set of convexes where a finite element has been assigned.
 
bool is_reduced () const
 Return true if a reduction matrix is applied to the dofs.
 
const REDUCTION_MATRIX & reduction_matrix () const
 Return the reduction matrix applied to the dofs.
 
const EXTENSION_MATRIX & extension_matrix () const
 Return the extension matrix corresponding to reduction applied (RE=I).
 
template<typename MATR , typename MATE >
void set_reduction_matrices (const MATR &RR, const MATE &EE)
 Allows to set the reduction and the extension matrices. More...
 
void reduce_to_basic_dof (const dal::bit_vector &kept_basic_dof)
 Allows to set the reduction and the extension matrices in order to keep only a certain number of dof.
 
void set_reduction (bool r)
 Validate or invalidate the reduction (keeping the reduction matrices).
 
const meshlinked_mesh () const
 Return a reference to the underlying mesh.
 
void set_auto_add (dim_type K, bool disc=false, scalar_type alpha=scalar_type(0), bool complete=false)
 Set the degree of the fem for automatic addition of element option. More...
 
void set_auto_add (pfem pf)
 Set the fem for automatic addition of element option. More...
 
dim_type get_qdim_m () const IS_DEPRECATED
 for matrix fields, return the number of rows.
 
dim_type get_qdim_n () const IS_DEPRECATED
 for matrix fields, return the number of columns.
 
void set_finite_element (size_type cv, pfem pf)
 Set the finite element method of a convex. More...
 
void set_finite_element (const dal::bit_vector &cvs, pfem pf)
 Set the finite element on a set of convexes. More...
 
void set_finite_element (pfem pf)
 shortcut for set_finite_element(linked_mesh().convex_index(),pf); and set_auto_add(pf).
 
void set_classical_finite_element (size_type cv, dim_type fem_degree, bool complete=false)
 Set a classical (i.e. More...
 
void set_classical_finite_element (const dal::bit_vector &cvs, dim_type fem_degree, bool complete=false)
 Set a classical (i.e. More...
 
void set_classical_discontinuous_finite_element (size_type cv, dim_type fem_degree, scalar_type alpha=0, bool complete=false)
 Similar to set_classical_finite_element, but uses discontinuous lagrange elements. More...
 
void set_classical_discontinuous_finite_element (const dal::bit_vector &cvs, dim_type fem_degree, scalar_type alpha=0, bool complete=false)
 Similar to set_classical_finite_element, but uses discontinuous lagrange elements. More...
 
void set_classical_finite_element (dim_type fem_degree, bool complete=false)
 Shortcut for set_classical_finite_element(linked_mesh().convex_index(),...)
 
void set_classical_discontinuous_finite_element (dim_type fem_degree, scalar_type alpha=0, bool complete=false)
 Shortcut for set_classical_discontinuous_finite_element(linked_mesh().convex_index() ,...)
 
virtual void get_global_dof_index (std::vector< size_type > &ind) const
 Give an array that contains the global dof indices corresponding to the mesh_fem dofs or size_type(-1) if a dof is not global. More...
 
virtual void enumerate_dof () const
 Renumber the degrees of freedom. More...
 
dal::bit_vector dof_on_region (const mesh_region &b) const
 Get a list of dof lying on a given mesh_region. More...
 
 mesh_fem (const mesh &me, dim_type Q=1)
 Build a new mesh_fem. More...
 
void read_from_file (const std::string &name)
 Read the mesh_fem from a file. More...
 
void write_to_file (const std::string &name, bool with_mesh=false) const
 Write the mesh_fem to a file. More...
 
- Public Member Functions inherited from getfem::context_dependencies
bool context_check () const
 return true if update_from_context was called
 

Detailed Description

a subclass of mesh_fem which allows to eliminate a number of dof of the original mesh_fem.

Definition at line 55 of file getfem_partial_mesh_fem.h.

Member Function Documentation

◆ fem_of_element()

pfem getfem::partial_mesh_fem::fem_of_element ( size_type  cv) const
inlinevirtual

Return the basic fem associated with an element (if no fem is associated, the function will crash! use the convex_index() of the mesh_fem to check that a fem is associated to a given convex).

This fem does not take into account the optional vectorization due to qdim nor the optional reduction.

Reimplemented from getfem::mesh_fem.

Definition at line 70 of file getfem_partial_mesh_fem.h.

◆ get_qdim()

virtual dim_type getfem::partial_mesh_fem::get_qdim ( ) const
inlinevirtual

Return the Q dimension.

A mesh_fem used for scalar fields has Q=1, for vector fields, Q is typically equal to linked_mesh().dim().

Reimplemented from getfem::mesh_fem.

Definition at line 73 of file getfem_partial_mesh_fem.h.

◆ ind_basic_dof_of_element()

ind_dof_ct getfem::partial_mesh_fem::ind_basic_dof_of_element ( size_type  cv) const
inlinevirtual

Give an array of the dof numbers a of convex.

Parameters
cvthe convex number.
Returns
a pseudo-container of the dof number.

Reimplemented from getfem::mesh_fem.

Definition at line 101 of file getfem_partial_mesh_fem.h.

◆ ind_basic_dof_of_face_of_element()

ind_dof_face_ct getfem::partial_mesh_fem::ind_basic_dof_of_face_of_element ( size_type  cv,
short_type  f 
) const
inlinevirtual

Give an array of the dof numbers lying of a convex face (all degrees of freedom whose associated base function is non-zero on the convex face).

Parameters
cvthe convex number.
fthe face number.
Returns
a pseudo-container of the dof number.

Reimplemented from getfem::mesh_fem.

Definition at line 109 of file getfem_partial_mesh_fem.h.

◆ nb_basic_dof_of_face_of_element()

size_type getfem::partial_mesh_fem::nb_basic_dof_of_face_of_element ( size_type  cv,
short_type  f 
) const
inlinevirtual

Return the number of dof lying on the given convex face.

Parameters
cvthe convex number.
fthe face number.

Reimplemented from getfem::mesh_fem.

Definition at line 112 of file getfem_partial_mesh_fem.h.

◆ nb_basic_dof_of_element()

size_type getfem::partial_mesh_fem::nb_basic_dof_of_element ( size_type  cv) const
inlinevirtual

Return the number of degrees of freedom attached to a given convex.

Parameters
cvthe convex number.

Reimplemented from getfem::mesh_fem.

Definition at line 115 of file getfem_partial_mesh_fem.h.

◆ point_of_basic_dof() [1/2]

base_node getfem::partial_mesh_fem::point_of_basic_dof ( size_type  cv,
size_type  i 
) const
inlinevirtual

Return the geometrical location of a degree of freedom.

Parameters
cvthe convex number.
ithe local dof number.

Reimplemented from getfem::mesh_fem.

Definition at line 118 of file getfem_partial_mesh_fem.h.

◆ point_of_basic_dof() [2/2]

base_node getfem::partial_mesh_fem::point_of_basic_dof ( size_type  d) const
inlinevirtual

Return the geometrical location of a degree of freedom.

Parameters
dthe global dof number.

Reimplemented from getfem::mesh_fem.

Definition at line 121 of file getfem_partial_mesh_fem.h.

◆ first_convex_of_basic_dof()

size_type getfem::partial_mesh_fem::first_convex_of_basic_dof ( size_type  d) const
inlinevirtual

Shortcut for convex_to_dof(d)[0].

Parameters
dthe global dof number.

Reimplemented from getfem::mesh_fem.

Definition at line 127 of file getfem_partial_mesh_fem.h.

◆ convex_to_basic_dof()

const mesh::ind_cv_ct& getfem::partial_mesh_fem::convex_to_basic_dof ( size_type  d) const
inlinevirtual

Return the list of convexes attached to the specified dof.

Parameters
dthe global dof number.
Returns
an array of convex numbers.

Reimplemented from getfem::mesh_fem.

Definition at line 130 of file getfem_partial_mesh_fem.h.

◆ basic_dof_on_region()

dal::bit_vector getfem::partial_mesh_fem::basic_dof_on_region ( const mesh_region b) const
inlinevirtual

Get a list of basic dof lying on a given mesh_region.

Parameters
bthe mesh_region.
Returns
the list in a dal::bit_vector.

Reimplemented from getfem::mesh_fem.

Definition at line 141 of file getfem_partial_mesh_fem.h.

◆ read_from_file()

void getfem::partial_mesh_fem::read_from_file ( std::istream &  ist)
inlinevirtual

Read the mesh_fem from a stream.

Parameters
istthe stream.

Reimplemented from getfem::mesh_fem.

Definition at line 147 of file getfem_partial_mesh_fem.h.


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