27 return IT::Record(
"OutputMesh",
"Parameters of the refined output mesh.")
29 "Maximal level of refinement of the output mesh.")
31 "Set true for using error_control_field. Set false for global uniform refinement to max_level.")
33 "Name of an output field, according to which the output mesh will be refined. The field must be a SCALAR one.")
81 std::string error_control_field_name =
"";
84 if(
it) error_control_field_name = *
it;
89 THROW(FieldSet::ExcUnknownField()
90 << FieldCommon::EI_Field(error_control_field_name)
99 DebugOut() <<
"Output mesh will be refined according to field " << error_control_field_name <<
".";
102 THROW(ExcFieldNotScalar()
103 << FieldCommon::EI_Field(error_control_field_name)
147 DebugOut() <<
"Create outputmesh identical to computational one.";
154 unsigned int coord_id = 0,
159 nodes_->data_[coord_id] = node->getX(); coord_id++;
160 nodes_->data_[coord_id] = node->getY(); coord_id++;
161 nodes_->data_[coord_id] = node->getZ(); coord_id++;
170 unsigned int ele_id = 0,
176 node = ele->node[li];
182 offset += ele->dim() + 1;
184 (*orig_element_indices_)[ele_id] = ele_id;
193 ASSERT(0).error(
"Not implemented yet.");
199 ASSERT(0).error(
"Not implemented yet.");
225 ASSERT_DBG(output_mesh->nodes_->n_values > 0);
227 if(
nodes_->data_.size() > 0)
return;
229 DebugOut() <<
"Create discontinuous outputmesh.";
232 const unsigned int n_corners = output_mesh->connectivity_->n_values;
239 nodes_->n_values = n_corners;
244 unsigned int coord_id = 0,
248 for(
const auto & ele : *output_mesh)
250 unsigned int n = ele.n_nodes(),
252 con_off = (* offsets_)[ele_idx];
254 for(li = 0; li < n; li++)
257 unsigned int off =
spacedim * (* output_mesh->connectivity_)[con_off - n + li];
258 auto &d = output_mesh->nodes_->data_;
260 nodes_->data_[coord_id] = d[off]; ++coord_id;
261 nodes_->data_[coord_id] = d[off+1]; ++coord_id;
262 nodes_->data_[coord_id] = d[off+2]; ++coord_id;
273 ASSERT(0).error(
"Not implemented yet.");
278 ASSERT(0).error(
"Not implemented yet.");
Classes for auxiliary output mesh.
static const unsigned int spacedim
Shortcut instead of spacedim template. We suppose only spacedim=3 at the moment.
Common abstract parent of all Field<...> classes.
Container for various descendants of FieldCommonBase.
Common parent class for templated OutputData.
#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)
void select_error_control_field(FieldSet &output_fields)
Selects the error control field out of output field set according to input record.
Class template representing a field with values dependent on: point, element, and region...
~OutputMeshDiscontinuous()
std::shared_ptr< MeshData< unsigned int > > connectivity_
Vector maps the nodes to their coordinates in vector nodes_.
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< MeshData< double > > nodes_
Vector of node coordinates. [spacedim x n_nodes].
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
unsigned int n_nodes()
Returns number of nodes.
void create_refined_mesh()
Creates refined mesh.
bool refinement_criterion()
FieldCommon * field(const std::string &field_name) const
unsigned int n_elements() const
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.
std::shared_ptr< MeshData< unsigned int > > offsets_
Vector of offsets of node indices of elements. Maps elements to their nodes in connectivity_.
OutputElementIterator end()
Gives iterator to the LAST element of the output mesh.
friend class OutputElement
Friend provides access to vectors for element accessor class.
void create_refined_mesh()
Creates discontinuous refined mesh.
#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.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
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.
Field< 3, FieldValue< 3 >::Scalar > * error_control_field_
Refinement error control field.
OutputMeshBase(Mesh &mesh)
Constructor. Takes computational mesh as a parameter.