MOAB: Mesh Oriented datABase  (version 5.4.1)
MeshOutputFunctor.hpp
Go to the documentation of this file.
00001 /*
00002  * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003  * storing and accessing finite element mesh data.
00004  *
00005  * Copyright 2007 Sandia Corporation.  Under the terms of Contract
00006  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007  * retains certain rights in this software.
00008  *
00009  * This library is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU Lesser General Public
00011  * License as published by the Free Software Foundation; either
00012  * version 2.1 of the License, or (at your option) any later version.
00013  *
00014  */
00015 
00016 /**\class moab::MeshOutputFunctor
00017  *\brief Implements the abstract EntityRefinerOutputFunctor class.
00018  *
00019  * This class is a concrete implementation of the EntityRefinerOutputFunctor.
00020  * It creates new vertices and regions in a new or existing mesh as
00021  * the input entities are streamed through the refiner.
00022  *
00023  * \author David Thompson
00024  * \author Philippe Pebay
00025  *
00026  * \date 28 July 2008
00027  */
00028 #ifndef MOAB_MESH_OUTPUT_FUNCTOR_HPP
00029 #define MOAB_MESH_OUTPUT_FUNCTOR_HPP
00030 
00031 #include "moab/Types.hpp"
00032 #include "EntityRefiner.hpp"
00033 #include "ProcessSet.hpp"
00034 
00035 #include <vector>
00036 #include <map>
00037 
00038 #include <cstring>
00039 
00040 namespace moab
00041 {
00042 
00043 class SplitVerticesBase;
00044 class EntitySource;
00045 class ParallelComm;
00046 
00047 class MeshOutputFunctor : public EntityRefinerOutputFunctor
00048 {
00049   public:
00050     MeshOutputFunctor( RefinerTagManager* tag_mgr );
00051     ~MeshOutputFunctor();
00052 
00053     void print_vert_crud( EntityHandle vout,
00054                           int nvhash,
00055                           EntityHandle* vhash,
00056                           const double* vcoords,
00057                           const void* vtags );
00058     void assign_global_ids( ParallelComm* comm );
00059     void exchange_handles( ParallelComm* comm );
00060 
00061     void assign_tags( EntityHandle vhandle, const void* vtags );
00062 
00063     virtual EntityHandle map_vertex( EntityHandle vhash, const double* vcoords, const void* vtags );
00064     using EntityRefinerOutputFunctor::operator();
00065     virtual EntityHandle operator()( int nvhash, EntityHandle* vhash, const double* vcoords, const void* vtags );
00066     virtual void operator()( EntityHandle h );
00067     virtual void operator()( EntityType etyp );
00068 
00069     Interface* mesh_in;
00070     Interface* mesh_out;
00071     bool input_is_output;
00072     SplitVerticesBase* vertex_map;
00073     std::vector< SplitVerticesBase* > split_vertices;
00074     std::vector< EntitySource* > new_entities;
00075     std::vector< EntityHandle > elem_vert;
00076     RefinerTagManager* tag_manager;
00077     EntityHandle destination_set;
00078     std::map< ProcessSet, int > proc_partition_counts;
00079 };
00080 
00081 }  // namespace moab
00082 
00083 #endif  // MOAB_MESH_OUTPUT_FUNCTOR_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines