Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F122167740
DomainCartesian.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
Wed, Jul 16, 07:30
Size
1 KB
Mime Type
text/x-c
Expires
Fri, Jul 18, 07:30 (2 d)
Engine
blob
Format
Raw Data
Handle
27443563
Attached To
R7917 Guggisberg-Liardon - Numerical integration
DomainCartesian.cpp
View Options
//
// 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
Log In to Comment