25 return IT::Record(
"OutputMesh",
"Parameters of the refined output mesh.")
27 "Maximal level of refinement of the output mesh.")
29 "Set true for using error_control_field. Set false for global uniform refinement to max_level.")
31 "Name of an output field, according to which the output mesh will be refined. The field must be a SCALAR one.")
61 if(
it) error_control_field_name_ = *
it;
119 DebugOut() <<
"Create outputmesh identical to computational one.";
125 unsigned int coord_id = 0,
127 auto &node_vec = *(
nodes_->get_component_data(0).get() );
132 node_vec[coord_id] = node->getX(); coord_id++;
133 node_vec[coord_id] = node->getY(); coord_id++;
134 node_vec[coord_id] = node->getZ(); coord_id++;
142 unsigned int ele_id = 0,
146 auto &offset_vec = *( offsets_->get_component_data(0).get() );
149 offset += ele->dim() + 1;
150 offset_vec[ele_id] = offset;
151 (*orig_element_indices_)[ele_id] = ele_id;
155 const unsigned int n_connectivities = offset_vec[offset_vec.size()-1];
157 auto &connect_vec = *(
connectivity_->get_component_data(0).get() );
160 node = ele->node[li];
161 connect_vec[connect_id] = node->aux;
171 ASSERT(0).error(
"Not implemented yet.");
177 ASSERT(0).error(
"Not implemented yet.");
207 ASSERT_DBG(output_mesh->nodes_->n_values() > 0);
211 DebugOut() <<
"Create discontinuous outputmesh.";
214 const unsigned int n_corners = output_mesh->connectivity_->n_values();
223 unsigned int coord_id = 0,
227 auto &node_vec = *(
nodes_->get_component_data(0).get() );
228 auto &conn_vec = *( connectivity_->get_component_data(0).get() );
229 for(
const auto & ele : *output_mesh)
231 unsigned int n = ele.n_nodes(),
233 con_off = (* offsets_)[ele_idx];
235 for(li = 0; li < n; li++)
238 unsigned int off =
spacedim * (* output_mesh->connectivity_)[con_off - n + li];
239 auto &d = *( output_mesh->nodes_->get_component_data(0).get() );
241 node_vec[coord_id] = d[off]; ++coord_id;
242 node_vec[coord_id] = d[off+1]; ++coord_id;
243 node_vec[coord_id] = d[off+2]; ++coord_id;
245 conn_vec[corner_id] = corner_id;
254 ASSERT(0).error(
"Not implemented yet.");
259 ASSERT(0).error(
"Not implemented yet.");
Classes for auxiliary output mesh.
void create_refined_mesh() override
Creates refined mesh.
static const unsigned int spacedim
Shortcut instead of spacedim template. We suppose only spacedim=3 at the moment.
#define FOR_ELEMENT_NODES(i, j)
Base class for Output mesh.
GeneralIterator< OutputElement > OutputElementIterator
unsigned int n_elements()
Returns number of element.
Mesh * orig_mesh_
Pointer to the computational mesh.
#define FOR_ELEMENTS(_mesh_, __i)
~OutputMeshDiscontinuous()
static const Input::Type::Record & get_input_type()
The specification of output mesh.
const unsigned int max_level_
Maximal level of refinement.
std::shared_ptr< ElementDataCache< unsigned int > > connectivity_
Vector maps the nodes to their coordinates in vector nodes_.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
std::shared_ptr< ElementDataCache< unsigned int > > offsets_
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
unsigned int n_nodes()
Returns number of nodes.
std::shared_ptr< ElementDataCache< double > > nodes_
Vector of node coordinates. [spacedim x n_nodes].
bool refinement_criterion()
unsigned int n_elements() const
std::string error_control_field_name_
Refinement error control field name.
bool refinement_criterion()
virtual ~OutputMeshBase()
#define FOR_NODES(_mesh_, i)
void create_mesh(std::shared_ptr< OutputMesh > output_mesh)
Creates output mesh from the given continuous one.
OutputMeshDiscontinuous(Mesh &mesh)
Input::Record input_record_
Input record for output mesh.
OutputElementIterator end()
Gives iterator to the LAST element of the output mesh.
friend class OutputElement
Friend provides access to vectors for element accessor class.
#define ASSERT_PTR(ptr)
Definition of assert macro checking non-null pointer (PTR)
Class OutputElement and its iterator OutputElementIterator on the output mesh.
void create_identical_mesh()
Creates the output mesh identical to the computational one.
unsigned int n_nodes() const
General iterator template. Provides iterator over objects in some container.
#define DebugOut()
Macro defining 'debug' record of log.
void create_refined_mesh() override
Creates discontinuous refined mesh.
std::shared_ptr< std::vector< unsigned int > > orig_element_indices_
Vector of element indices in the computational mesh. (Important when refining.)
OutputElementIterator begin()
Gives iterator to the FIRST element of the output mesh.
OutputMeshBase(Mesh &mesh)
Constructor. Takes computational mesh as a parameter.