1 #ifndef STATE_WORKER_ABSTRACT_HPP 2 #define STATE_WORKER_ABSTRACT_HPP 4 #include "executable.hpp" 28 typedef STD_TR1::shared_ptr<const state_worker> const_ref;
29 typedef STD_TR1::shared_ptr<state_worker> ref;
35 void process_wvs(MPI_Comm comm,
const state_collection::const_ref sc){
36 process_wvs_(comm,sc);};
40 const STD_TR1::shared_ptr<const Rectangle>& rect
45 const STD_TR1::shared_ptr<const Rectangle>& rect
53 const STD_TR1::shared_ptr<const Rectangle>& r){ prepare_Image_(r);};
56 t_filename_list_ref get_filenames(MPI_Comm,
57 const std::string& head,
58 const std::string& getfilen,
59 const std::string& identifier)
const;
63 bool write_potential_;
71 virtual void process_wvs_(MPI_Comm,
const state_collection::const_ref);
73 virtual void process_wv_(MPI_Comm,
const state s) = 0;
75 virtual void init_state_worker() = 0;
77 virtual void prepare_Image_(
const STD_TR1::shared_ptr<const Rectangle>&) = 0;
81 void reinit_param(
const std::string& param_name);
82 void perform_(MPI_Comm comm);
88 typedef std::vector<state_worker::ref> state_worker_List;
89 STD_TR1::shared_ptr<state_worker_List> state_workers;
91 void process_wvs_(MPI_Comm,
const state_collection::const_ref);
92 void process_wv_(MPI_Comm,
const state);
93 void init_state_worker();
95 virtual bool include_state(
const state s ) = 0;
97 virtual void init_condition() = 0;
103 std::map<int, complex > evals;
104 std::map<int, const complex* > state_pointers;
106 Rectangle_const_ref geometry;
110 typedef std::pair<int,int> tworkpair;
112 std::set<tworkpair> work_pairs;
114 std::set<int> needed;
118 state_collection::ref second_set_states;
120 std::vector<int> allstates;
122 virtual void setup_calculation() = 0;
123 virtual void perform_work(MPI_Comm) = 0;
125 void setup_workpairs_needed(MPI_Comm comm,
int);
127 void distribute_simple(MPI_Comm comm);
128 void distribute_mincomm(MPI_Comm comm);
130 void init_second(MPI_Comm comm);
134 const state_collection::const_ref states);
136 void process_wv_(MPI_Comm,
const state);
int n_start()
return the starting index of a file
Definition: abstract_state_worker.hpp:49
void process_wvs(MPI_Comm comm, const state_collection::const_ref sc)
process wavefunction of Rectangle in state, using filen and n
Definition: abstract_state_worker.hpp:35
void prepare_wv(const STD_TR1::shared_ptr< const Rectangle > &r)
prepae wavefunction creation, usually you do not need to call this explicitly
Definition: abstract_state_worker.hpp:52
void process_potential(const std::string &filen, const STD_TR1::shared_ptr< const Rectangle > &rect)
create a wv showing potential inside Rectangle, use filen to create output filename ...
Definition: abstract_state_worker.cpp:99
Definition: abstract_state_worker.hpp:85
Definition: abstract_state_worker.hpp:101
void process_geometry(const std::string &filen, const STD_TR1::shared_ptr< const Rectangle > &rect)
create a wv showing geometry of Rectangle, use filen to create output filename
Definition: abstract_state_worker.cpp:133
Definition: executable.hpp:16
abstract base class to work on wavefunctions (states)
Definition: abstract_state_worker.hpp:23