Page MenuHomec4science

DomainCartesian.cpp
No OneTemporary

File Metadata

Created
Fri, Sep 27, 21:24

DomainCartesian.cpp

//
// Created by Tristan Liardon on 11.12.2018.
//
#include "DomainCartesian.hpp"
DomainCartesian::DomainCartesian(vector<vector<double>> boundaries_, vector<int> subdivision_) {
boundaries = boundaries_;
dimension = (int)boundaries.size();
subdivision = subdivision_;
//Exception: the amount of subdivisions must be over 0.
for(int i = 0; i < dimension; i++){
if (subdivision[i]<1){
OutOfRangeException error("The amount of subdivisions must be over 0.");
error.PrintDebug();
exit(0);
}
}
//Exception: only 1D and 2D integration methods have been implemented
if (dimension > 2){
OutOfRangeException error("The integration methods for dimensions over 2 have not been implemented.");
error.PrintDebug();
exit(0);
}
}
DomainCartesian::DomainCartesian(double a_, double b_, int subdivision_) {
// Transform the boundaries double into the vector form
vector<double> dim1;
dim1.push_back(a_);
dim1.push_back(b_);
boundaries.push_back(dim1);
dimension = 1;
subdivision1D = subdivision_;
//Exception: the amount of subdivisions must be over 0.
if (subdivision1D<1){
OutOfRangeException error("The amount of subdivisions must be over 0.");
error.PrintDebug();
exit(0);
}
}
DomainCartesian::~DomainCartesian() {}
// Get number of elements
int DomainCartesian::GetNumberElements() {
// if dim
return subdivision1D;
}

Event Timeline