1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
 * MOAB, a Mesh-Oriented datABase, is a software component for creating,
 * storing and accessing finite element mesh data.
 *
 * Copyright 2007 Sandia Corporation.  Under the terms of Contract
 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
 * retains certain rights in this software.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 */

/**\class moab::MeshOutputFunctor
 *\brief Implements the abstract EntityRefinerOutputFunctor class.
 *
 * This class is a concrete implementation of the EntityRefinerOutputFunctor.
 * It creates new vertices and regions in a new or existing mesh as
 * the input entities are streamed through the refiner.
 *
 * \author David Thompson
 * \author Philippe Pebay
 *
 * \date 28 July 2008
 */
#ifndef MOAB_MESH_OUTPUT_FUNCTOR_HPP
#define MOAB_MESH_OUTPUT_FUNCTOR_HPP

#include "moab/Types.hpp"
#include "EntityRefiner.hpp"
#include "ProcessSet.hpp"

#include <vector>
#include <map>

#include <cstring>

namespace moab
{

class SplitVerticesBase;
class EntitySource;
class ParallelComm;

class MeshOutputFunctor : public EntityRefinerOutputFunctor
{
  public:
    MeshOutputFunctor( RefinerTagManager* tag_mgr );
    ~MeshOutputFunctor();

    void print_vert_crud( EntityHandle vout,
                          int nvhash,
                          EntityHandle* vhash,
                          const double* vcoords,
                          const void* vtags );
    void assign_global_ids( ParallelComm* comm );
    void exchange_handles( ParallelComm* comm );

    void assign_tags( EntityHandle vhandle, const void* vtags );

    virtual EntityHandle map_vertex( EntityHandle vhash, const double* vcoords, const void* vtags );<--- Function in derived class<--- Function in derived class
    using EntityRefinerOutputFunctor::operator();
    virtual EntityHandle operator()( int nvhash, EntityHandle* vhash, const double* vcoords, const void* vtags );<--- Function in derived class<--- Function in derived class
    virtual void operator()( EntityHandle h );<--- Function in derived class<--- Function in derived class
    virtual void operator()( EntityType etyp );<--- Function in derived class<--- Function in derived class

    Interface* mesh_in;
    Interface* mesh_out;
    bool input_is_output;
    SplitVerticesBase* vertex_map;
    std::vector< SplitVerticesBase* > split_vertices;
    std::vector< EntitySource* > new_entities;
    std::vector< EntityHandle > elem_vert;
    RefinerTagManager* tag_manager;
    EntityHandle destination_set;
    std::map< ProcessSet, int > proc_partition_counts;
};

}  // namespace moab

#endif  // MOAB_MESH_OUTPUT_FUNCTOR_HPP