~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to lib/atc/Kinetostat.h

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
  
59
59
  public:
60
60
  
61
 
    KinetostatShapeFunction(Kinetostat *kinetostat,
 
61
    KinetostatShapeFunction(AtomicRegulator *kinetostat,
62
62
                            const std::string & regulatorPrefix = "");
63
63
        
64
64
    virtual ~KinetostatShapeFunction(){};
73
73
    virtual void set_weights();
74
74
 
75
75
    // member data
76
 
    /** pointer to thermostat object for data */
77
 
    Kinetostat * kinetostat_;
 
76
    /** MD mass matrix */
 
77
    DIAG_MAN & mdMassMatrix_;
78
78
    /** pointer to a time filtering object */
79
79
    TimeFilter * timeFilter_;
80
80
    /** stress induced by lambda */
110
110
  
111
111
  public:
112
112
  
113
 
    GlcKinetostat(Kinetostat *kinetostat);
 
113
    GlcKinetostat(AtomicRegulator *kinetostat);
114
114
        
115
115
    virtual ~GlcKinetostat(){};
116
116
 
134
134
                                               double weight = 1.){};
135
135
 
136
136
    // member data
137
 
 
138
 
    /** MD mass matrix */
139
 
    DIAG_MAN & mdMassMatrix_;
140
 
 
141
137
    /** nodeset corresponding to Hoover coupling */
142
138
    std::set<std::pair<int,int> > hooverNodes_;
143
139
 
161
157
  
162
158
  public:
163
159
  
164
 
    DisplacementGlc(Kinetostat * kinetostat);
 
160
    DisplacementGlc(AtomicRegulator * kinetostat);
165
161
        
166
162
    virtual ~DisplacementGlc(){};
167
163
        
227
223
  
228
224
  public:
229
225
  
230
 
    DisplacementGlcFiltered(Kinetostat * kinetostat);
 
226
    DisplacementGlcFiltered(AtomicRegulator * kinetostat);
231
227
        
232
228
    virtual ~DisplacementGlcFiltered(){};
233
229
 
270
266
  
271
267
  public:
272
268
  
273
 
    VelocityGlc(Kinetostat * kinetostat);
 
269
    VelocityGlc(AtomicRegulator * kinetostat);
274
270
        
275
271
    virtual ~VelocityGlc(){};
276
272
 
302
298
    virtual void apply_pre_filtering(double dt);
303
299
    /** sets up and solves kinetostat equations */
304
300
    virtual void compute_kinetostat(double dt);
 
301
    /** applies kinetostat correction to atoms */
 
302
    virtual void apply_kinetostat(double dt);
305
303
    /** sets up appropriate rhs for kinetostat equations */
306
304
    virtual void set_kinetostat_rhs(DENS_MAT & rhs, double dt);
307
305
    /** computes the nodal FE force applied by the kinetostat */
339
337
  
340
338
  public:
341
339
  
342
 
    VelocityGlcFiltered(Kinetostat * kinetostat);
 
340
    VelocityGlcFiltered(AtomicRegulator * kinetostat);
343
341
        
344
342
    virtual ~VelocityGlcFiltered(){};
345
343
 
382
380
  
383
381
  public:
384
382
  
385
 
    StressFlux(Kinetostat * kinetostat);
 
383
    StressFlux(AtomicRegulator * kinetostat);
386
384
        
387
385
    virtual ~StressFlux();
388
386
 
464
462
  
465
463
  public:
466
464
  
467
 
    StressFluxGhost(Kinetostat * kinetostat);
 
465
    StressFluxGhost(AtomicRegulator * kinetostat);
468
466
        
469
467
    virtual ~StressFluxGhost() {};
470
468
 
504
502
  
505
503
  public:
506
504
  
507
 
    StressFluxFiltered(Kinetostat * kinetostat);
 
505
    StressFluxFiltered(AtomicRegulator * kinetostat);
508
506
        
509
507
    virtual ~StressFluxFiltered(){};
510
508
 
545
543
  
546
544
  public:
547
545
  
548
 
    KinetostatGlcFs(Kinetostat *kinetostat,
 
546
    KinetostatGlcFs(AtomicRegulator *kinetostat,
549
547
                    const std::string & regulatorPrefix = "");
550
548
        
551
549
    virtual ~KinetostatGlcFs(){};
559
557
    /** applies thermostat to atoms in the predictor phase */
560
558
    virtual void apply_pre_predictor(double dt);
561
559
 
 
560
    /** applies thermostat to atoms in the pre-corrector phase */
 
561
    virtual void apply_pre_corrector(double dt);
 
562
 
562
563
    /** applies thermostat to atoms in the post-corrector phase */
563
564
    virtual void apply_post_corrector(double dt);
564
565
    
565
566
    /** get data for output */
566
567
    virtual void output(OUTPUT_LIST & outputData);
567
568
 
 
569
    /* flag for performing the full lambda prediction calculation */
 
570
    bool full_prediction();
 
571
 
568
572
  protected:
569
573
 
570
574
    // methods
590
594
    /* sets up and solves the linear system for lambda */
591
595
    virtual void compute_lambda(double dt);
592
596
 
593
 
    /** sets up the transfer which is the set of nodes being regulated */
594
 
    virtual void construct_regulated_nodes() = 0;
595
 
 
596
597
    // member data
597
598
    /** reference to AtC FE velocity */
598
599
    DENS_MAN & velocity_;
600
601
    /** nodal atomic momentum */
601
602
    DENS_MAN * nodalAtomicMomentum_;
602
603
 
 
604
    /** hack to determine if first timestep has been passed */
 
605
    bool isFirstTimestep_;
 
606
 
 
607
    /** local version of velocity used as predicted final veloctiy */
 
608
    PerAtomQuantity<double> * atomPredictedVelocities_;
 
609
 
 
610
    /** predicted nodal atomic momentum */
 
611
    AtfShapeFunctionRestriction * nodalAtomicPredictedMomentum_;
 
612
 
 
613
    /** FE momentum change from kinetostat forces */
 
614
    DENS_MAT deltaMomentum_;
 
615
 
603
616
    /** right-hand side data for thermostat equation */
604
617
    DENS_MAT rhs_;
605
618
 
606
 
    /** mapping from all to regulated nodes */
607
 
    DENS_MAT rhsMap_;
 
619
    /** fraction of timestep over which constraint is exactly enforced */
 
620
    double dtFactor_;
608
621
 
609
622
    // workspace
610
623
    DENS_MAT _lambdaForceOutput_; // force applied by lambda in output format
611
624
    DENS_MAT _velocityDelta_; // change in velocity when lambda force is applied
612
 
    DENS_MAT _deltaMomentum_; // FE velocity change from kinetostat
613
625
 
614
626
  private:
615
627
    
628
640
  
629
641
  public:
630
642
  
631
 
    KinetostatFlux(Kinetostat *kinetostat,
 
643
    KinetostatFlux(AtomicRegulator *kinetostat,
632
644
                   const std::string & regulatorPrefix = "");
633
645
        
634
646
    virtual ~KinetostatFlux(){};
689
701
  
690
702
  public:
691
703
  
692
 
    KinetostatFluxGhost(Kinetostat *kinetostat,
 
704
    KinetostatFluxGhost(AtomicRegulator *kinetostat,
693
705
                        const std::string & regulatorPrefix = "");
694
706
        
695
707
    virtual ~KinetostatFluxGhost(){};
728
740
  
729
741
  public:
730
742
  
731
 
    KinetostatFixed(Kinetostat *kinetostat,
 
743
    KinetostatFixed(AtomicRegulator *kinetostat,
732
744
                    const std::string & regulatorPrefix = "");
733
745
        
734
746
    virtual ~KinetostatFixed(){};
742
754
    /** applies thermostat to atoms in the predictor phase */
743
755
    virtual void apply_pre_predictor(double dt);
744
756
 
 
757
    /** applies thermostat to atoms in the pre-corrector phase */
 
758
    virtual void apply_pre_corrector(double dt);
 
759
 
745
760
    /** applies thermostat to atoms in the post-corrector phase */
746
761
    virtual void apply_post_corrector(double dt);
747
762
 
 
763
    /** compute boundary flux, requires thermostat input since it is part of the coupling scheme */
 
764
    virtual void compute_boundary_flux(FIELDS & fields)
 
765
      {boundaryFlux_[VELOCITY] = 0.;};
 
766
 
748
767
    /** determine if local shape function matrices are needed */
749
768
    virtual bool use_local_shape_functions() const {return atomicRegulator_->use_localized_lambda();};
750
769
 
776
795
    virtual void construct_regulated_nodes();
777
796
 
778
797
    // member data
779
 
    /** MD mass matrix */
780
 
    DIAG_MAN & mdMassMatrix_;
781
 
 
782
798
    /** change in FE momentum over a timestep */
783
799
    DENS_MAT deltaFeMomentum_;
784
800
 
794
810
    /** filtered nodal atomic momentum */
795
811
    DENS_MAN nodalAtomicMomentumFiltered_;
796
812
 
797
 
    /** hack to determine if first timestep has been passed */
798
 
    bool isFirstTimestep_;
 
813
    /** coefficient to account for effect of time filtering on rhs terms */
 
814
    double filterCoefficient_;
 
815
 
 
816
    // workspace
 
817
    DENS_MAT _tempNodalAtomicMomentumFiltered_; // stores filtered momentum change in atoms for persistence during predictor
799
818
 
800
819
  private:
801
820
    
804
823
 
805
824
  };
806
825
 
 
826
  /**
 
827
   *  @class  KinetostatFluxFixed
 
828
   *  @brief  Class for kinetostatting using the velocity matching constraint one one set of nodes and the flux matching constraint on another
 
829
   */
 
830
 
 
831
  class KinetostatFluxFixed : public RegulatorMethod {
 
832
 
 
833
  public:
 
834
 
 
835
    KinetostatFluxFixed(AtomicRegulator * kinetostat,
 
836
                        bool constructThermostats = true);
 
837
        
 
838
    virtual ~KinetostatFluxFixed();
 
839
 
 
840
    /** instantiate all needed data */
 
841
    virtual void construct_transfers();
 
842
 
 
843
    /** pre-run initialization of method data */
 
844
    virtual void initialize();
 
845
 
 
846
    /** applies thermostat to atoms in the predictor phase */
 
847
    virtual void apply_pre_predictor(double dt);
 
848
 
 
849
    /** applies thermostat to atoms in the pre-corrector phase */
 
850
    virtual void apply_pre_corrector(double dt);
 
851
 
 
852
    /** applies thermostat to atoms in the post-corrector phase */
 
853
    virtual void apply_post_corrector(double dt);
 
854
    
 
855
    /** get data for output */
 
856
    virtual void output(OUTPUT_LIST & outputData);
 
857
 
 
858
    /** compute boundary flux, requires kinetostat input since it is part of the coupling scheme */
 
859
    virtual void compute_boundary_flux(FIELDS & fields)
 
860
      {kinetostatBcs_->compute_boundary_flux(fields);};
 
861
 
 
862
  protected:
 
863
 
 
864
    // data
 
865
    /** kinetostat for imposing the fluxes */
 
866
    KinetostatFlux * kinetostatFlux_;
 
867
 
 
868
    /** kinetostat for imposing fixed nodes */
 
869
    KinetostatFixed * kinetostatFixed_;
 
870
 
 
871
    /** pointer to whichever kinetostat should compute the flux, based on coupling method */
 
872
    KinetostatGlcFs * kinetostatBcs_;
 
873
 
 
874
  private:
 
875
 
 
876
    // DO NOT define this
 
877
    KinetostatFluxFixed();
 
878
  };
 
879
 
807
880
}
808
881
 
809
882
#endif