File: ThermalTimeIntegrator.h

package info (click to toggle)
lammps 20220106.git7586adbb6a%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 348,064 kB
  • sloc: cpp: 831,421; python: 24,896; xml: 14,949; f90: 10,845; ansic: 7,967; sh: 4,226; perl: 4,064; fortran: 2,424; makefile: 1,501; objc: 238; lisp: 163; csh: 16; awk: 14; tcl: 6
file content (348 lines) | stat: -rw-r--r-- 10,033 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
#ifndef THERMAL_TIME_INTEGRATOR_H
#define THERMAL_TIME_INTEGRATOR_H

// ATC headers
#include "TimeIntegrator.h"

namespace ATC {

  // forward declarations
  class ThermalIntegrationMethod;
  class AtfShapeFunctionRestriction;

  /**
   *  @class  ThermalTimeIntegrator
   *  @brief  Class for various time integrators for thermal FE quantities
   *          (handles parsing and stores basic data structures)
   */

  class ThermalTimeIntegrator : public TimeIntegrator {

  public:

    // constructor
    ThermalTimeIntegrator(ATC_Coupling * atc,
                          TimeIntegrationType timeIntegrationType);

    // destructor
    virtual ~ThermalTimeIntegrator(){};

    /** parser/modifier */
    virtual bool modify(int narg, char **arg);

    /** create objects to implement requested numerical method */
    virtual void construct_methods();

    /** pack persistent fields */
    virtual void pack_fields(RESTART_LIST & data);

    // Member data access
    /** access for filtered atomic power */
    DENS_MAN & nodal_atomic_power_filtered(){return nodalAtomicPowerFiltered_;};

    /** access for filtered atomic energy */
    // note:  nodalAtomicEnergy_ should always be reset as it tracks the original energy + MD evolution
    DENS_MAN & nodal_atomic_energy_filtered(){return nodalAtomicEnergyFiltered_;};

  protected:

    /** filtered atomic power */

    DENS_MAN nodalAtomicPowerFiltered_;

    /** filtered atomic energy due initial conditions and MD updates */
    DENS_MAN nodalAtomicEnergyFiltered_;

  private:

    // DO NOT define this
    ThermalTimeIntegrator();

  };

  /**
   *  @class  ThermalIntegrationMethod
   *  @brief  Class for various time integration methods for thermal FE quantities
   */

  class ThermalIntegrationMethod : public TimeIntegrationMethod {

  public:

    // constructor
    ThermalIntegrationMethod(ThermalTimeIntegrator * thermalTimeIntegrator);

    // destructor
    virtual ~ThermalIntegrationMethod() {};

    /** create and get necessary transfer operators */
    virtual void construct_transfers();

    /** checks to see if first RHS computation is needed */
    virtual bool has_final_predictor() {return true;};

  protected:

    /** time filtering object */
    TimeFilter * timeFilter_;

    /** finite element temperature field */
    DENS_MAN & temperature_;
    /** finite element temperature Rate of change (Roc) */
    DENS_MAN & temperatureRoc_;
    /** finite element temperature 2nd time derivative */
    DENS_MAN & temperature2Roc_;

    /** atomic nodal temperature field for output */
    DENS_MAN & nodalAtomicTemperatureOut_;

    /** interscale operator for instantaneous temperature */
    DENS_MAN * nodalAtomicTemperature_;

    /** right-hand side of temperature equation */
    DENS_MAN & temperatureRhs_;

    /** finite element power from atomic quantities for output */
    DENS_MAN & nodalAtomicPowerOut_;

    /** workspace for gear integration */
    DENS_MAT _temperatureResidual_;

  private:

    // DO NOT define this
    ThermalIntegrationMethod();

  };

  /**
   *  @class  ThermalTimeIntegratorGear
   *  @brief  Class uses 3rd order Gear integration for time integration of FE temperature field
   */

  class ThermalTimeIntegratorGear : public ThermalIntegrationMethod {

  public:

    // constructor
    ThermalTimeIntegratorGear(ThermalTimeIntegrator * ThermalTimeIntegrator);

    // destructor
    virtual ~ThermalTimeIntegratorGear() {};

    /** create and get necessary transfer operators */
    virtual void construct_transfers();

    /** pre time integration initialization of data */
    virtual void initialize();

    // time step methods, corresponding to ATC_Transfer
    /** second part of pre_initial_integrate */
    virtual void pre_initial_integrate2(double dt);
    /** first part of post_final_integrate */
    virtual void post_final_integrate1(double dt);

    /** parallel post-processing operations pre-output */
    virtual void post_process();

    /** finalize state of some unfiltered variables */
    virtual void finish();

  protected:

    /** filtered atomic power */
    DENS_MAN & nodalAtomicPowerFiltered_;

    /** instantaneous atomic power */
    AtfShapeFunctionRestriction * nodalAtomicPower_;

  private:

    // DO NOT define this
    ThermalTimeIntegratorGear();

  };

  /**
   *  @class  ThermalTimeIntegratorGearFiltered
   *  @brief  Gear integration for FE thermal quantities with time filtering
   */

  class ThermalTimeIntegratorGearFiltered : public ThermalTimeIntegratorGear {

  public:

    // constructor
    ThermalTimeIntegratorGearFiltered(ThermalTimeIntegrator * thermalTimeIntegrator);

    // destructor
    virtual ~ThermalTimeIntegratorGearFiltered(){};

    // time step methods, corresponding to ATC_Transfer
    /** second part of pre_initial_integrate */
    virtual void pre_initial_integrate2(double dt);
    /** first part of post_final_integrate */
    virtual void post_final_integrate1(double dt);
    /** third part of post_final_integrate */
    virtual void post_final_integrate3(double dt);

    /** parallel post-processing operations pre-output */
    virtual void post_process();

  protected:

    /** finite element temperature 3rd time derivative */
    DENS_MAN & temperature3Roc_;

  private:

    // DO NOT define this
    ThermalTimeIntegratorGearFiltered();

  };

  /**
   *  @class  ThermalTimeIntegratorFractionalStep
   *  @brief  Class for using 3rd order Gear integration to update FE contributions to temperature field
   *          (Uses same update for the atomic contributions to the finite
   *           elements as are used by the LAMMPS integration scheme
   *           for the atomic velocities and positions, i.e. Verlet.)
   */

  class ThermalTimeIntegratorFractionalStep : public ThermalIntegrationMethod {

  public:

    // constructor
    ThermalTimeIntegratorFractionalStep(ThermalTimeIntegrator * ThermalTimeIntegrator);

    // destructor
    virtual ~ThermalTimeIntegratorFractionalStep() {};

    /** create and get necessary transfer operators */
    virtual void construct_transfers();

    /** pre time integration initialization of data */
    virtual void initialize();

    // time step methods, corresponding to ATC_Transfer
    /** first part of pre_initial_integrate */
    virtual void pre_initial_integrate1(double dt);
    /** second part of pre_initial_integrate */
    virtual void pre_initial_integrate2(double dt);
    /** first part of pre_final_integrate */
    virtual void pre_final_integrate1(double dt);
    /** first part of post_final_integrate */
    virtual void post_final_integrate1(double dt);
    /** third part of post_final_integrate */
    virtual void post_final_integrate3(double dt);

    /** checks to see if first RHS computation is needed */
    virtual bool has_final_corrector() {return true;};

    /** post-process data */
    virtual void post_process();

    /** finalize state of some unfiltered variables */
    virtual void finish();

  protected:

    // methods
    /** applies Gear predictor */
    virtual void apply_gear_predictor(double dt);

    /** applies Gear corrector */
    virtual void apply_gear_corrector(const DENS_MAT & R_theta,
                                      double dt);

    /** compute old energy and temperature for use in time integrators */
    virtual void compute_old_time_data();

    /** computes temperature change associated with atomic energy change */
    virtual void compute_temperature_delta(const DENS_MAT & atomicEnergyDelta,
                                           double dt);

    // data
    /** filtered restricted atomic energy */
    DENS_MAN & nodalAtomicEnergyFiltered_;

    /** filtered atomic power, for post-processing only */
    DENS_MAN & nodalAtomicPowerFiltered_;

    /** change in FE temperature due to atomic motions */
    DENS_MAN atomicTemperatureDelta_;

    /** fractional step auxiliary storage for restricted atomic energy */
    DENS_MAN * nodalAtomicEnergy_;

    /** power associated with thermostat for post-processing */
    DENS_MAT nodalAtomicPower_;

    /** restricted atomic energy from previous time step */
    DENS_MAN nodalAtomicEnergyOld_;

    /** FE atomic temperature contribution from previous time step */
    DENS_MAN nodalAtomicTemperatureOld_;

  private:

    // DO NOT define this
    ThermalTimeIntegratorFractionalStep();

  };

  /**
   *  @class  ThermalTimeIntegratorFractionalStepFiltered
   *  @brief  Class for using filtered results from a 3rd order Gear integration to update FE contributions to temperature field
   */

  class ThermalTimeIntegratorFractionalStepFiltered : public ThermalTimeIntegratorFractionalStep {

  public:

    // constructor
    ThermalTimeIntegratorFractionalStepFiltered(ThermalTimeIntegrator * ThermalTimeIntegrator);

    // destructor
    virtual ~ThermalTimeIntegratorFractionalStepFiltered();

    // time step methods, corresponding to ATC_Transfer
    /** first part of pre_initial_integrate */
    virtual void pre_initial_integrate1(double dt);

    /** add output data */
    virtual void output(OUTPUT_LIST & outputData);

    /** finalize state of some unfiltered variables */
    virtual void finish(){};

  protected:

    // methods
    /** applies Gear predictor */
    virtual void apply_gear_predictor(double dt);

    /** applies Gear corrector */
    virtual void apply_gear_corrector(const DENS_MAT & R_theta,
                                      double dt);

    /** compute old energy and temperature for use in time integrators */
    virtual void compute_old_time_data();

    /** computes temperature change associated with atomic energy change */
    virtual void compute_temperature_delta(const DENS_MAT & atomicEnergyDelta,
                                           double dt);

    // data
    /** nodal temperature 3rd time derivative */
    DENS_MAN & temperature3Roc_;

  private:

    // DO NOT define this
    ThermalTimeIntegratorFractionalStepFiltered();

  };
};
#endif