Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

PeriodicDislocationArrayElasticStressModule.h

Go to the documentation of this file.
00001 /*
00002  * File:        PeriodicDislocationArrayElasticStressModule.h
00003  * Copyright:   (c) 2005-2007 Princeton University
00004  * Author(s):   Kevin T. Chu
00005  * Revision:    $Revision: 376 $
00006  * Modified:    $Date: 2007-08-06 19:10:55 -0400 (Mon, 06 Aug 2007) $
00007  * Description: Header file for the 
00008  *              PeriodicDislocationArrayElasticStressModule class
00009  */
00010 
00011 #ifndef included_PeriodicDislocationArrayElasticStressModule_h
00012 #define included_PeriodicDislocationArrayElasticStressModule_h
00013 
00068 // MPI Headers
00069 #include "mpi.h"
00070 
00071 // System Headers
00072 #include <string>
00073 #include <ostream>
00074 #include <vector>
00075 
00076 // FFTW Headers
00077 extern "C" {
00078   #include "fft_3d.h"
00079 }
00080 
00081 // SAMRAI Headers
00082 #include "SAMRAI_config.h"
00083 #include "Patch.h"
00084 #include "PatchHierarchy.h"
00085 #include "Box.h"
00086 #include "tbox/Database.h"
00087 #include "tbox/Pointer.h"
00088 
00089 // LSMDD Headers
00090 #include "LSMDD_config.h"
00091 #include "LSMDD_Types.h"
00092 #include "BurgersVector.h"
00093 #include "LSMDD_Parameters.h"
00094 #include "ElasticStressStrategy.h"
00095 
00096 // namespaces
00097 using namespace std;
00098 using namespace SAMRAI;
00099 using namespace hier;
00100 using namespace tbox;
00101 
00102 
00103 /******************************************************************
00104  *
00105  * PeriodicDislocationArrayElasticStressModule Class Definition
00106  *
00107  ******************************************************************/
00108 
00109 namespace LSMDD {
00110 
00111 class PeriodicDislocationArrayElasticStressModule:
00112   public ElasticStressStrategy
00113 {
00114 public:
00115 
00117 
00135   PeriodicDislocationArrayElasticStressModule(
00136     Pointer<Database> input_db,
00137     Pointer< PatchHierarchy<3> > patch_hierarchy);
00138 
00144   virtual ~PeriodicDislocationArrayElasticStressModule();
00145 
00147 
00148 
00150 
00166   virtual inline int getStressFieldHandle() {
00167     return d_stress_field_handle;
00168   }
00169 
00171 
00172 
00174 
00190   virtual void setStressFieldToZero();
00191 
00208   virtual void addStressFieldForDislocationLine(
00209     const int dislocation_line_handle,
00210     const BurgersVector& burgers_vector,
00211     const LSMDD_Parameters& lsmdd_params);
00212 
00226   virtual void addAuxiliaryStressField(
00227     const int auxiliary_stress_field_handle,
00228     const LSMDD_Parameters& lsmdd_params);
00229 
00250   virtual void addAuxiliaryStressFieldComponent(
00251     const int auxiliary_stress_field_handle,
00252     const LSMDD_Parameters& lsmdd_params,
00253     const int component);
00254 
00256 
00257 
00259 
00276   virtual void printClassData(ostream& os) const;
00277 
00279 
00280 
00281 protected:
00282 
00284 
00303   virtual void getFromInput(Pointer<Database> input_db);
00304 
00325   virtual void computeStressOnPatchTimeEfficient(
00326     Pointer< Patch<3> > patch,
00327     const int dislocation_line_handle,
00328     const BurgersVector& burgers_vector,
00329     const LSMDD_Parameters& lsmdd_params);
00330 
00353   virtual void computeStressOnPatchMemoryEfficient(
00354     Pointer< Patch<3> > patch,
00355     LSMDD::STRESS_COMPONENT_TYPE stress_field_component,
00356     FFT_DATA *stress_field_fft_data,
00357     const int dislocation_line_handle,
00358     const BurgersVector& burgers_vector,
00359     const LSMDD_Parameters& lsmdd_params);
00360 
00370   virtual void allocateFFTData();
00371 
00381   virtual void deallocateFFTData();
00382 
00403   virtual void addStressFieldToSAMRAIPatchData(
00404     Pointer< Patch<3> > patch,
00405     const LSMDD_Parameters& lsmdd_params);
00406 
00407 
00428   virtual void addStressFieldComponentToSAMRAIPatchData(
00429     Pointer< Patch<3> > patch,
00430     FFT_DATA *stress_field_fft_data,
00431     const LSMDD::STRESS_COMPONENT_TYPE stress_component,
00432     const LSMDD_Parameters& lsmdd_params);
00433 
00444   virtual void initializeElasticStressModule();
00445 
00447 
00448 
00449   /****************************************************************
00450    *    
00451    * Data members
00452    *    
00453    ****************************************************************/ 
00454 
00455   // pointer to PatchHierarchy
00456   Pointer< PatchHierarchy<3> > d_patch_hierarchy;
00457 
00458   // memory usage flags
00459   bool d_conserve_memory;
00460   bool d_use_dynamic_memory_allocation;
00461 
00462   // PatchData handle for stress field
00463   int d_stress_field_handle;
00464 
00465   // global index space 
00466   Box<3> d_global_box;
00467 
00468   // index space owned by the local processor
00469   Box<3> d_local_box;
00470 
00471   // pointers to FFT data (required to compute complex FFT using FFTW)
00472   FFT_DATA *d_dislocation_line_fft_data[3];
00473   FFT_DATA *d_stress_field_fft_data[6];
00474   bool d_fft_data_allocated;
00475 
00476   // 3D FFT plan
00477   struct fft_plan_3d *d_fft_plan;
00478 
00479   // Fourier transform parameters
00480   double d_fft_scale_factor;   // scale factor relating Fourier transforms
00481                                // defined in terms of angular and oscillation 
00482                                // frequencies
00483 
00484   // flag to indicate whether the PeriodicDislocationArrayElasticStressModule 
00485   // initialization has been completed
00486   bool d_initialization_complete;
00487 
00488 private:
00489 
00490   /*
00491    * Private copy constructor to prevent use.
00492    * 
00493    * Arguments:     
00494    *  - rhs (in):  PeriodicDislocationArrayElasticStressModule object to copy
00495    * 
00496    */
00497   PeriodicDislocationArrayElasticStressModule(const 
00498     PeriodicDislocationArrayElasticStressModule& rhs){}
00499   
00500   /*
00501    * Private assignment operator to prevent use.
00502    * 
00503    * Arguments:     
00504    *  - rhs (in):    PeriodicDislocationArrayElasticStressModule object to copy
00505    * 
00506    * Return value:   *this
00507    * 
00508    */
00509   const PeriodicDislocationArrayElasticStressModule& operator=(
00510     const PeriodicDislocationArrayElasticStressModule& rhs) 
00511   {
00512     return *this;
00513   }
00514   
00515 };
00516 
00517 } // end LSMDD namespace
00518 
00519 #endif
00520 

Generated on Tue Aug 7 15:43:41 2007 for LSMDD by doxygen 1.3.4