Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F65262624
Input.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jun 2, 08:57
Size
2 KB
Mime Type
text/x-c
Expires
Tue, Jun 4, 08:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18038780
Attached To
rODVPROJECT Group15_PCSC_Project
Input.cpp
View Options
#include <cassert>
#include "Input.h"
///Constructor of the class
Input::Input(double time_step, int dimension, int order, int number_steps, int write_output_timestep,
const vector<vector<double>>& initial_condition_matrix ,const vector<vector<double>>& changing_matrix, const vector<vector<double>>& past_step_matrix) {
assert(number_steps % write_output_timestep == 0.0);
Timestep = new double;
NumberSteps = new int;
Order = new int;
Dimension = new int;
WriteOutputTimestep = new int;
*Timestep = time_step;
*NumberSteps = number_steps;
*Order = order;
*Dimension = dimension;
*WriteOutputTimestep = write_output_timestep;
const vector<vector<double>> &InitialConditionMatrix = initial_condition_matrix;
const vector<vector<double>> &ChangingMatrix = changing_matrix;
const vector<vector<double>> &PastStepMatrix = past_step_matrix;
}
///Return the time step
double& Input::GetTimestep() const
{
return *Timestep;
}
///Return the dimension
int& Input::GetDimension() const
{
return *Dimension;
}
///Return the order of the solver
int& Input::GetOrder() const
{
return *Order;
}
///Return the overall number of steps
int& Input::GetNumberSteps() const
{
return *NumberSteps;
}
///Return the Timestep defining when we write the output solution
int& Input::GetWriteOutputTimestep() const
{
return *WriteOutputTimestep;
}
///Return the initial condition matrix
vector<vector<double>>& Input::GetInitialConditionMatrix() const
{
return *InitialConditionMatrix;
}
///Return the changing matrix corresponding to several states when the program run
vector<vector<double>>& Input::GetChangingMatrix() const
{
return *ChangingMatrix;
}
///Return the past step corresponding to i-1
vector<vector<double>>& Input::GetPastStepMatrix() const
{
return *PastStepMatrix;
}
///Destructor
Input::~Input(){
delete Timestep;
delete NumberSteps;
delete Order;
delete Dimension;
delete WriteOutputTimestep;
delete InitialConditionMatrix;
delete ChangingMatrix;
delete PastStepMatrix;
}
Event Timeline
Log In to Comment