18 #ifndef OUTPUT_MESH_HH_
19 #define OUTPUT_MESH_HH_
35 namespace Input {
namespace Type {
class Record; } }
132 else return shared_from_this();
142 ASSERT(
loc_4_el_[global_idx] != -1)(global_idx).error(
"Element is not local.\n");
147 inline std::shared_ptr<ElementDataCache<unsigned int>>
offsets()
const {
206 std::shared_ptr<ElementDataCache<double>>
nodes_;
210 std::shared_ptr<ElementDataCache<unsigned int>>
offsets_;
213 std::shared_ptr<ElementDataCache<unsigned int>>
node_ids_;
215 std::shared_ptr<ElementDataCache<unsigned int>>
elem_ids_;
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
unsigned int size() const
get global size
General iterator template. Provides iterator over objects of type Object in some container.
Represents an element of the output mesh. Provides element access on the data of the output mesh (nod...
This class is used for output data to VTK file format.
Base class for Output mesh.
double refinement_error_tolerance_
Tolerance for error criterion refinement.
virtual std::shared_ptr< ElementDataCache< double > > make_serial_nodes_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets)=0
OutputMeshBase(Mesh &mesh)
Constructor. Takes computational mesh as a parameter.
LongIdx * node_4_loc_
Index set assigning to local node index its global index.
std::shared_ptr< ElementDataCache< unsigned int > > connectivity_
Vector maps the nodes to their coordinates in vector nodes_.
void make_serial_master_mesh()
Synchronize parallel data and create serial COLECTIVE output mesh on zero process.
std::function< void(const Armor::array &, const ElementAccessor< spacedim > &, std::vector< double > &)> ErrorControlFieldFunc
std::shared_ptr< OutputMeshBase > get_master_mesh()
Return master output mesh if exists or shared_ptr of this object.
@ orig
same as original (computational) mesh
@ discont
discontinuous mesh
virtual std::shared_ptr< OutputMeshBase > construct_mesh()=0
static const Input::Type::Record & get_input_type()
The specification of output mesh.
std::shared_ptr< ElementDataCache< unsigned int > > get_elems_n_nodes()
Compute and return number of nodes for each elements (compute from offsets)
virtual void make_parallel_master_mesh()
Create output mesh of parallel output (implemented only for discontinuous mesh)
unsigned int n_elements()
Returns number of element.
friend class OutputMeshDiscontinuous
std::shared_ptr< OutputMeshBase > master_mesh_
bool is_created()
Check if nodes_, connectivity_ and offsets_ data caches are created.
LongIdx * el_4_loc_
Index set assigning to local element index its global index.
virtual std::shared_ptr< ElementDataCache< unsigned int > > make_serial_connectivity_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets)=0
Input::Record input_record_
Input record for output mesh.
Distribution * el_ds_
Parallel distribution of elements.
std::shared_ptr< ElementDataCache< unsigned int > > node_ids_
Vector gets ids of nodes. Data is used in GMSH output.
bool refine_by_error_
True, if output mesh is to be refined by error criterion.
LongIdx get_loc_elem_idx(LongIdx global_idx)
ErrorControlFieldFunc error_control_field_func_
Refinement error control field function (hold value_list function of field).
OutputElementIterator begin()
Gives iterator to the FIRST element of the output mesh.
std::shared_ptr< std::vector< unsigned int > > orig_element_indices_
Vector of element indices in the computational mesh. (Important when refining.)
const unsigned int max_level_
Maximal level of refinement.
virtual void create_refined_sub_mesh()=0
OutputElementIterator end()
Gives iterator to the LAST element of the output mesh.
std::shared_ptr< ElementDataCache< unsigned int > > elem_ids_
Vector gets ids of elements. Data is used in GMSH output.
std::shared_ptr< ElementDataCache< int > > partitions_
Vector gets partitions of elements. Data is used in GMSH output.
std::shared_ptr< ElementDataCache< double > > nodes_
Vector of node coordinates. [spacedim x n_nodes].
static const unsigned int spacedim
Shortcut instead of spacedim template. We suppose only spacedim=3 at the moment.
MeshType mesh_type_
Type of OutputMesh.
std::shared_ptr< ElementDataCache< unsigned int > > offsets_
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
std::shared_ptr< ElementDataCache< unsigned int > > offsets() const
Getter to offsets data.
unsigned int n_nodes()
Returns number of nodes.
unsigned int n_local_nodes_
Hold number of local nodes (own + ghost), value is equal with size of node_4_loc array.
Mesh * orig_mesh_
Pointer to the computational mesh.
void set_error_control_field(ErrorControlFieldFunc error_control_field_func)
Selects the error control field computing function of output field set according to input record.
LongIdx * loc_4_el_
Index set assigning to global index its local element index.
virtual ~OutputMeshBase()
Distribution * node_ds_
Parallel distribution of nodes. Depends on elements distribution.
std::shared_ptr< ElementDataCache< unsigned int > > region_ids_
Vector gets ids of regions. Data is used in GMSH output.
void create_id_caches()
Create nodes and elements data caches.
Class represents output mesh with discontinuous elements.
bool refinement_criterion_error(const AuxElement &ele, const Space< spacedim >::Point ¢re, const ElementAccessor< spacedim > &ele_acc)
Refinement flag - measures discretisation error according to error control field.
void make_parallel_master_mesh() override
Overrides OutputMeshBase::make_parallel_master_mesh.
void create_refined_sub_mesh() override
Implements OutputMeshBase::create_refined_sub_mesh.
bool refinement_criterion_uniform(const AuxElement &ele)
Refinement flag - checks only maximal level of refinement.
bool refinement_criterion(const AuxElement &ele, const ElementAccessor< spacedim > &ele_acc)
Collects different refinement criteria results.
void refine_aux_element(const AuxElement &aux_element, std::vector< AuxElement > &refinement, const ElementAccessor< spacedim > &ele_acc)
Performs the actual refinement of AuxElement. Recurrent.
std::shared_ptr< ElementDataCache< unsigned int > > make_serial_connectivity_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets) override
Implements OutputMeshBase::make_serial_connectivity_cache.
std::shared_ptr< ElementDataCache< double > > make_serial_nodes_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets) override
Implements OutputMeshBase::make_serial_nodes_cache.
std::shared_ptr< OutputMeshBase > construct_mesh() override
Implements OutputMeshBase::construct_mesh.
~OutputMeshDiscontinuous()
Class represents output mesh with continuous elements.
std::shared_ptr< ElementDataCache< unsigned int > > make_serial_connectivity_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets) override
Implements OutputMeshBase::make_serial_connectivity_cache.
std::shared_ptr< ElementDataCache< double > > make_serial_nodes_cache(std::shared_ptr< ElementDataCache< unsigned int >> global_offsets) override
Implements OutputMeshBase::make_serial_nodes_cache.
std::shared_ptr< OutputMeshBase > construct_mesh() override
Implements OutputMeshBase::construct_mesh.
bool refinement_criterion()
void create_refined_sub_mesh() override
Implements OutputMeshBase::create_refined_sub_mesh.
The class for outputting data during time.
This class is used for output data to VTK file format.
Armor::ArmaVec< double, spacedim > Point
Support classes for parallel programing.
Template Iter serves as general template for internal iterators.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
Iter< OutputElement > OutputElementIterator
Auxiliary structure defining element of refined output mesh.
std::vector< Space< spacedim >::Point > nodes