Sierra Toolkit Version of the Day
Partition.hpp
Go to the documentation of this file.
00001 
00002 /*--------------------------------------------------------------------*/
00003 /*    Copyright 2001, 2002 Sandia Corporation.                        */
00004 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00005 /*    non-exclusive license for use of this work by or on behalf      */
00006 /*    of the U.S. Government.  Export of this program may require     */
00007 /*    a license from the United States Government.                    */
00008 /*--------------------------------------------------------------------*/
00009 
00010 // Copyright 2001, 2002 Sandia Corporation, Albuquerque, NM.
00011 
00012 #ifndef stk_rebalance_Partition_hpp
00013 #define stk_rebalance_Partition_hpp
00014 
00042 #include <stdexcept>
00043 
00044 // STL components
00045 #include <vector>
00046 #include <utility>
00047 
00048 #include <stk_mesh/base/Entity.hpp>
00049 #include <stk_mesh/base/Field.hpp>
00050 #include <stk_mesh/base/Types.hpp>
00051 #include <stk_mesh/fem/CoordinateSystems.hpp>
00052 #include <stk_mesh/fem/TopologyDimensions.hpp>
00053 
00054 namespace stk {
00055 namespace rebalance {
00056 
00057 typedef mesh::Field<double, mesh::Cartesian>  VectorField ;
00058 typedef mesh::Field<double>                   ScalarField ;
00059 
00060 
00081 class Partition {
00082 
00083 public:
00084 
00086   Partition(stk::ParallelMachine comm);
00087 private:
00088   Partition(const Partition &p);
00089 public:
00090 
00103   virtual void set_mesh_info ( const std::vector<mesh::Entity *> &mesh_entities,
00104                                const VectorField   * nodal_coord_ref,
00105                                const ScalarField   * elem_weight_ref=NULL) = 0;
00106 
00108   virtual ~Partition();
00109 
00111   ParallelMachine parallel() const { return comm_; }
00112 
00114   virtual unsigned num_elems() const = 0;
00115 
00128   virtual void determine_new_partition(bool &RebalancingNeeded) = 0;
00129 
00144   virtual int get_new_partition(stk::mesh::EntityProcVec &new_partition) = 0;
00145 
00147   virtual bool partition_dependents_needed() const = 0;
00148 
00149 
00150 protected:
00151 
00152   const stk::ParallelMachine comm_;
00153 };
00154 
00157 }
00158 } // namespace stk
00159 
00160 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines