@@ -434,6 +434,7 @@ namespace maps{
434434 class mapconfig {
435435 private:
436436 bool _multimap = false ;
437+ bool _isloaded = false ;
437438 std::tuple<double ,double ,double ,double ,double ,double > _borders;
438439
439440 maps::physmap<double ,11 > _pm;
@@ -443,12 +444,15 @@ namespace maps{
443444 maps::physmap<double ,4 > _hmobm;
444445
445446 VecDev_t<double > _xvec, _yvec, _zvec;
447+ PhysMapHost_t _vec_map;
448+
446449 // efield vecs
447450 VecDev_t<double > _xvec_ef, _yvec_ef, _zvec_ef;
448- VecDev_t<double > efieldvecx, efieldvecy, efieldvecz;
451+ VectorMapHost_t _vec_ef;
452+
449453 // wfield vecs
450454 VecDev_t<double > _xvec_wf, _yvec_wf, _zvec_wf;
451- VecDev_t< double > wfieldvecx, wfieldvecy, wfieldvecz ;
455+ VectorMapHost_t _vec_wf ;
452456
453457 // emob vecs
454458 VecDev_t<double > _xvec_emob, _yvec_emob, _zvec_emob;
@@ -459,14 +463,23 @@ namespace maps{
459463 VecDev_t<double > hmobvec;
460464
461465 public:
462- mapconfig (){}
466+ mapconfig () {
467+ _isloaded = false ;
468+ };
469+
470+ mapconfig (std::string map_path) {
471+ this ->load (map_path);
472+ }
473+ mapconfig (std::string efield_path, std::string emob_path, std::string hmob_path, std::string wfield_path){
474+ this ->load (efield_path, emob_path, hmob_path, wfield_path);
475+ }
463476
464477 void load (std::string map_path){
465478 INFO_LINE (" Loading single map" )
466479 _pm.init (map_path);
467480 _pm.prepare ();
468481 _pm.fillspacepoints <VecDev_t<double > >(_xvec,_yvec,_zvec);
469- _pm.fillallquantities <VecDev_t< double > >(efieldvecx,efieldvecy,efieldvecz,emobvec,hmobvec,wfieldvecx,wfieldvecy,wfieldvecz );
482+ _pm.fillallquantities <PhysMapHost_t >(_vec_map );
470483 std::get<0 >(_borders) = *(_pm.getx ().begin ());
471484 std::get<1 >(_borders) = *(_pm.getx ().rbegin ());
472485 std::get<2 >(_borders) = *(_pm.gety ().begin ());
@@ -476,43 +489,35 @@ namespace maps{
476489 _multimap = false ;
477490 std::cout << MIDDLEROW << std::endl;
478491 INFO_LINE (" Volume boundaries: [ " << std::get<0 >(_borders) << " < x < " << std::get<1 >(_borders) << " ] micron, " <<" [ " << std::get<2 >(_borders) << " < y < " << std::get<3 >(_borders) <<" ] micron, " <<" [ " << std::get<4 >(_borders) << " < z < " << std::get<5 >(_borders) <<" ] micron" )
492+ _isloaded = true ;
479493 }
480494
481495 void load (std::string efield_path, std::string emob_path, std::string hmob_path, std::string wfield_path){
482496 INFO_LINE (" Loading separate maps" )
483497
484-
498+ // get efield
485499 _efieldm.init (efield_path); // E field is a vector
486500 _efieldm.prepare ();
487- _efieldm.fillspacepoints <VecDev_t<double > >(_xvec_ef,_yvec_ef,_zvec_ef);
488- _efieldm.fillvector <VecDev_t<double > >(efieldvecx,efieldvecy,efieldvecz);
489-
490- // for(auto cf:configlist){
491- // if(std::get<bool>(cf.get("plot"))){
492- // VecHost_t<double> efieldvecx_host, efieldvecy_host, efieldvecz_host;
493- // efieldm.fillvector<VecHost_t<double> >(efieldvecx_host,efieldvecy_host,efieldvecz_host);
494- // h3=analysis::getHist3DDraw( efieldvecx_host, efieldvecy_host, efieldvecz_host, efieldm.getx(),efieldm.gety(),efieldm.getz());
495- // break;
496- // }
497- // }
501+ _efieldm.fillspacepoints (_xvec_ef,_yvec_ef,_zvec_ef);
502+ _efieldm.fillvector (_vec_ef);
498503
499504
500505 _wfieldm.init (wfield_path); // Weighting field is a vector
501506 _wfieldm.prepare ();
502- _wfieldm.fillspacepoints <VecDev_t< double > > (_xvec_wf,_yvec_wf,_zvec_wf);
503- _wfieldm.fillvector <VecDev_t< double > >(wfieldvecx,wfieldvecy,wfieldvecz );
507+ _wfieldm.fillspacepoints (_xvec_wf,_yvec_wf,_zvec_wf);
508+ _wfieldm.fillvector (_vec_wf );
504509
505510
506511 _emobm.init (emob_path); // Electron mobility is a scalar
507512 _emobm.prepare ();
508- _emobm.fillspacepoints <VecDev_t< double > > (_xvec_emob,_yvec_emob,_zvec_emob);
509- _emobm.fillscalar <VecDev_t< double > > (emobvec);
513+ _emobm.fillspacepoints (_xvec_emob,_yvec_emob,_zvec_emob);
514+ _emobm.fillscalar (emobvec);
510515
511516
512517 _hmobm.init (hmob_path); // Hole mobility is a scalar
513518 _hmobm.prepare ();
514- _hmobm.fillspacepoints <VecDev_t< double > > (_xvec_hmob,_yvec_hmob,_zvec_hmob);
515- _hmobm.fillscalar <VecDev_t< double > > (hmobvec);
519+ _hmobm.fillspacepoints (_xvec_hmob,_yvec_hmob,_zvec_hmob);
520+ _hmobm.fillscalar (hmobvec);
516521
517522
518523 std::get<0 >(_borders) = std::min (*(_efieldm.getx ().begin ()),std::min (*(_wfieldm.getx ().begin ()),std::min (*(_emobm.getx ().begin ()),*(_hmobm.getx ().begin ()))));
@@ -526,10 +531,13 @@ namespace maps{
526531
527532 std::cout << MIDDLEROW << std::endl;
528533 INFO_LINE (" Volume boundaries: [ " << std::get<0 >(_borders) << " < x < " << std::get<1 >(_borders) << " ] micron, " <<" [ " << std::get<2 >(_borders) << " < y < " << std::get<3 >(_borders) <<" ] micron, " <<" [ " << std::get<4 >(_borders) << " < z < " << std::get<5 >(_borders) <<" ] micron" )
534+
535+ _isloaded = true ;
529536 }
530537
531538 // is multimap or not?
532539 bool ismulti (){return _multimap;}
540+ bool isloaded (){return _isloaded;}
533541 };
534542
535543 // prepare maps
0 commit comments