You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
915 B
35 lines
915 B
#include <iostream>
|
|
#include <unsupported/Eigen/CXX11/Tensor>
|
|
#include <Eigen/Dense>
|
|
#include <Eigen/Eigen>
|
|
#include "Top3d.h"
|
|
#include "Boundary.h"
|
|
using Eigen::Tensor;
|
|
using Tensor3f = Tensor<float, 3>;
|
|
|
|
void print_tensor(const Tensor3f &t3) {
|
|
for (int k = 0; k < t3.dimension(2); ++k) {
|
|
std::cout << t3.chip(k, 2) << std::endl;
|
|
std::cout << std::endl;
|
|
}
|
|
}
|
|
|
|
int main() {
|
|
|
|
auto para = std::make_shared<top::CtrlPara>();
|
|
para->penal=3;
|
|
para->max_loop=4;
|
|
double E = 1.0;
|
|
double Poisson_ratio = 0.3;
|
|
auto material = std::make_shared<SIM::Material>(E, Poisson_ratio);
|
|
auto mesh = std::make_shared<top::Mesh>(10, 200,10);
|
|
top::Top3d top3d(para, material, mesh);
|
|
top::Boundary bdr(mesh);
|
|
auto l_bd=bdr.GetLeftBoundary();
|
|
top3d.AddDBC(l_bd,{1,1,1});
|
|
top3d.AddNBC(bdr.GetRightBottomMidPoint(),{0,0,-1});
|
|
top3d.TopOptMainLoop();
|
|
|
|
|
|
return 0;
|
|
}
|
|
|