diff --git a/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.depend b/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.depend index a7566d4..0608b27 100644 --- a/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.depend +++ b/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.depend @@ -1,19 +1,37 @@ # depslib dependency file v1.0 1544366338 source:/home/shaqfa/Desktop/CourseHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/main.cpp "fft.h" "matrix.h" 1544366410 /home/shaqfa/Desktop/CourseHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/include/fft.h "matrix.h" 1544295263 /home/shaqfa/Desktop/CourseHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/include/matrix.h +1544296682 source:/home/igtomic/SP4EHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/main.cpp + + "fft.h" + "matrix.h" + + +1544303585 /home/igtomic/SP4EHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/include/fft.h + "matrix.h" + + + +1544296682 /home/igtomic/SP4EHW/SP4EHW_IM/HW3/CodeBlocks Fast Verifications/FFT Test/include/matrix.h + + + + + + diff --git a/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.layout b/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.layout index 209ea9c..683a4e8 100644 --- a/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.layout +++ b/HW3/CodeBlocks Fast Verifications/FFT Test/FFT Test.layout @@ -1,20 +1,31 @@ +<<<<<<< HEAD +======= +<<<<<<< HEAD + +======= + +>>>>>>> 6067b589b58a8b47ec4fbf9237f3df9b74e08b81 +>>>>>>> f24ceedae968bd098a4d5ae986357090364572df + + + diff --git a/HW3/compute_temperature.cc b/HW3/compute_temperature.cc index fce0d52..1571e15 100644 --- a/HW3/compute_temperature.cc +++ b/HW3/compute_temperature.cc @@ -1,11 +1,39 @@ #include "compute_temperature.hh" #include "fft.hh" #include "material_point.hh" #include +#include "my_types.hh" /* -------------------------------------------------------------------------- */ +// Constructor for initizalizing timestep +ComputeTemperature::ComputeTemperature(Real dt) : dt(dt) {} + void ComputeTemperature::compute(System& system) { + +// For the beginning, we need to read the number of particles +UInt Sz = system.getNbParticles(); + +// Matrix is filled with the material points, depending on the system size Sz + +Matrix tempMtx(sqrt(Sz)); + for (auto&& entry : index(tempMtx)) { + int i = std::get<0>(entry); + int j = std::get<1>(entry); + auto& val = std::get<2>(entry); + Particle& par = system.getParticle(i*sqrt(Sz) + j); + auto& mp = static_cast(par); + val = mp.getTemperature(); + } + + + // FFT transform, in order to solve the equation: + // https://www.math.ubc.ca/~feldman/m267/pdeft.pdf + Matrix tempMtx_fft = FFT::transform(tempMtx); + + // Coordinates from FFT + Matrix> fft_coord = FFT::computeFrequencies(N); + } /* -------------------------------------------------------------------------- */ diff --git a/HW3/compute_temperature.hh b/HW3/compute_temperature.hh index 32f3492..0badc1b 100644 --- a/HW3/compute_temperature.hh +++ b/HW3/compute_temperature.hh @@ -1,18 +1,27 @@ #ifndef __COMPUTE_TEMPERATURE__HH__ #define __COMPUTE_TEMPERATURE__HH__ + /* -------------------------------------------------------------------------- */ #include "compute.hh" +#include "my_types.hh" -//! Compute contact interaction between ping-pong balls +//! Compute temperature class ComputeTemperature : public Compute { // Virtual implementation public: //! Penalty contact implementation void compute(System& system) override; +// Adding variables +public: + Real dt; +/*! + \dt: The stable time step for the explicit solver. +*/ + }; /* -------------------------------------------------------------------------- */ #endif //__COMPUTE_TEMPERATURE__HH__