@@ -434,6 +434,7 @@ namespace maps{
434
434
class mapconfig {
435
435
private:
436
436
bool _multimap = false ;
437
+ bool _isloaded = false ;
437
438
std::tuple<double ,double ,double ,double ,double ,double > _borders;
438
439
439
440
maps::physmap<double ,11 > _pm;
@@ -443,12 +444,15 @@ namespace maps{
443
444
maps::physmap<double ,4 > _hmobm;
444
445
445
446
VecDev_t<double > _xvec, _yvec, _zvec;
447
+ PhysMapHost_t _vec_map;
448
+
446
449
// efield vecs
447
450
VecDev_t<double > _xvec_ef, _yvec_ef, _zvec_ef;
448
- VecDev_t<double > efieldvecx, efieldvecy, efieldvecz;
451
+ VectorMapHost_t _vec_ef;
452
+
449
453
// wfield vecs
450
454
VecDev_t<double > _xvec_wf, _yvec_wf, _zvec_wf;
451
- VecDev_t< double > wfieldvecx, wfieldvecy, wfieldvecz ;
455
+ VectorMapHost_t _vec_wf ;
452
456
453
457
// emob vecs
454
458
VecDev_t<double > _xvec_emob, _yvec_emob, _zvec_emob;
@@ -459,14 +463,23 @@ namespace maps{
459
463
VecDev_t<double > hmobvec;
460
464
461
465
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
+ }
463
476
464
477
void load (std::string map_path){
465
478
INFO_LINE (" Loading single map" )
466
479
_pm.init (map_path);
467
480
_pm.prepare ();
468
481
_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 );
470
483
std::get<0 >(_borders) = *(_pm.getx ().begin ());
471
484
std::get<1 >(_borders) = *(_pm.getx ().rbegin ());
472
485
std::get<2 >(_borders) = *(_pm.gety ().begin ());
@@ -476,43 +489,35 @@ namespace maps{
476
489
_multimap = false ;
477
490
std::cout << MIDDLEROW << std::endl;
478
491
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 ;
479
493
}
480
494
481
495
void load (std::string efield_path, std::string emob_path, std::string hmob_path, std::string wfield_path){
482
496
INFO_LINE (" Loading separate maps" )
483
497
484
-
498
+ // get efield
485
499
_efieldm.init (efield_path); // E field is a vector
486
500
_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);
498
503
499
504
500
505
_wfieldm.init (wfield_path); // Weighting field is a vector
501
506
_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 );
504
509
505
510
506
511
_emobm.init (emob_path); // Electron mobility is a scalar
507
512
_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);
510
515
511
516
512
517
_hmobm.init (hmob_path); // Hole mobility is a scalar
513
518
_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);
516
521
517
522
518
523
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{
526
531
527
532
std::cout << MIDDLEROW << std::endl;
528
533
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 ;
529
536
}
530
537
531
538
// is multimap or not?
532
539
bool ismulti (){return _multimap;}
540
+ bool isloaded (){return _isloaded;}
533
541
};
534
542
535
543
// prepare maps
0 commit comments