Изменение индексов граничных условий

Оптимизация кода
This commit is contained in:
2025-05-15 23:26:58 +03:00
parent 5d555820cc
commit 3ed8093481
6 changed files with 14 additions and 57 deletions

View File

@@ -36,8 +36,4 @@ bool Form::Excluded() const {
return excluded;
}
int Form::GetB() { return bound_type; }
//bool Form::operator==(size_t id) const {
// return id_ == id;
//}
int Form::GetB() { return bound_type; }

View File

@@ -1,8 +1,4 @@
#include "Mesh.hpp"
#include <iostream>
#include <fstream>
#include <Object.hpp>
Mesh::Mesh(Object& _obj, double _step) : obj(_obj), step(_step) {
for (double y = 0.0; y <= _obj.Height(); y += _step) {
mesh.push_back(std::vector<Node*>());
@@ -147,34 +143,4 @@ Mesh::~Mesh() {
for (auto line : mesh)
for (auto node : line)
delete node;
}
//void Mesh::ShowLinks() {
// for (auto line : mesh) {
// for (auto node : line) {
// if (node->d())
// std::cout << "| ";
// }
// std::cout << '\n';
// for (auto node : line) {
// if (node->l()) {
// std::cout << '-';
// }
// std::cout << 'N';
// if (node->r()) {
// std::cout << '-';
// }
// else {
// std::cout << '\n';
// }
// }
// for (auto node : line) {
// if (node->u())
// std::cout << "|";
// std::cout << " ";
//
// }
// std::cout << '\n';
// }
//}
}

View File

@@ -72,15 +72,6 @@ double Object::Height() const {
return h;
}
//std::vector<size_t> Object::Get_IDs() {
// std::vector<size_t> ids;
// ids.reserve(forms.size());
// for (auto form : forms) {
// ids.push_back(form->Get_ID());
// }
// return ids;
//}
Form* Object::Who(double x, double y) {
for (auto form : forms) {
if (form->Inhere(x, y)) {

View File

@@ -32,15 +32,15 @@ int main()
{
/* Граничные условия:
1 - нагрев
2 - теплоизоляция
3 - конвекция
4 - отсутствует
2 - конвекция
3 - теплоизоляция
0 - отсутствует
*/
int left = 1;
int top = 3;
int top = 2;
int right = 1;
int bottom = 3;
int arc_bound = 3;
int bottom = 2;
int arc_bound = 2;
int hole_bound = 1;
double step_5 = 5;