14 for (
int i = 0; i < T.n_children(); i++)
15 this->
children.push_back(std::make_unique<Tree>(T.child(i)));
24 for (
int i = 0; i < T.n_children(); i++)
25 this->
children.push_back(std::make_unique<Tree>(T.child(i)));
32 if (!T.has_children() || max_depth <= 0)
40 for (
int i = 0; i < T.n_children(); i++)
41 flag = this->
child(i).
merge(T.child(i), max_depth) || flag;
47 std::ostream& ost,
const Tree& T
52 for (
int i = 0; i < T.n_children(); i++)
53 ost << T.child(i) <<
", ";
80 for (
int i = 0; i < n; i++)
81 children.push_back(std::make_unique<Tree>());
90 const Eigen::MatrixXd &cp,
91 const Eigen::MatrixXd &uv);
95 const std::vector<basis::ElementBases> &bases,
96 const std::vector<basis::ElementBases> &gbases,
97 const Eigen::VectorXd &u);
99 std::tuple<bool, int, Tree>
is_valid(
101 const std::vector<basis::ElementBases> &bases,
102 const std::vector<basis::ElementBases> &gbases,
103 const Eigen::VectorXd &u,
104 const double threshold = 0);
108 const std::vector<basis::ElementBases> &bases,
109 const std::vector<basis::ElementBases> &gbases,
110 const Eigen::VectorXd &u1,
111 const Eigen::VectorXd &u2,
112 const double threshold = 0);
116 const std::vector<basis::ElementBases> &bases,
117 const std::vector<basis::ElementBases> &gbases,
118 const Eigen::VectorXd &u1,
119 const Eigen::VectorXd &u2,
120 double precision = .25);
123 Eigen::MatrixXd
extract_nodes(
const int dim,
const std::vector<basis::ElementBases> &bases,
const std::vector<basis::ElementBases> &gbases,
const Eigen::VectorXd &u,
int order,
int n_elem = -1);
Stores the basis functions for a given element in a mesh (facet in 2d, cell in 3d).
std::vector< std::unique_ptr< Tree > > children
bool merge(const Tree &T, int max_depth=2)
const Tree & child(int i) const
bool has_children() const
Tree operator=(const Tree &T)
friend std::ostream & operator<<(std::ostream &ost, const Tree &T)
std::tuple< bool, int, Tree > is_valid(const int dim, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXd &u, const double threshold)
Eigen::VectorXd robust_evaluate_jacobian(const int order, const Eigen::MatrixXd &cp, const Eigen::MatrixXd &uv)
std::tuple< double, int, double, Tree > max_time_step(const int dim, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXd &u1, const Eigen::VectorXd &u2, double precision)
std::vector< int > count_invalid(const int dim, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXd &u)
Eigen::MatrixXd extract_nodes(const int dim, const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &gbases, const Eigen::VectorXd &u, int order, int n_elem)