12#ifndef BEMBEL_SRC_GEOMETRY_GEOMETRYIO_HPP_
13#define BEMBEL_SRC_GEOMETRY_GEOMETRYIO_HPP_
27 std::vector<Bembel::Patch>
out;
28 std::stringstream
iss;
35 std::cerr <<
"File " <<
file_name <<
" doesn't exist!";
39 for (
int i = 0;
i < 5;
i++) {
44 for (
int i = 0;
i < 5;
i++) {
54 std::vector<int>
info;
55 std::vector<Eigen::MatrixXd>
tmp;
100 for (
int k = 0;
k < 4;
k++) {
105 for (
int i = 0;
i <
M;
i++)
106 for (
int j = 0;
j <
N;
j++) {
134 file <<
"# nurbs mesh v.2.1"
137 file <<
"# Generated by BEMBEL, see www.bembel.eu"
155 const std::vector<Eigen::MatrixXd> &
xyzw,
156 const std::vector<double> &
knt1,
157 const std::vector<double> &
knt2)
noexcept {
158 std::ofstream file(
file_name, std::ios::app);
159 int N =
xyzw[0].cols();
160 int M =
xyzw[0].rows();
164 file <<
p1 <<
" " <<
p2 <<
" \r\n";
165 file <<
N <<
" " <<
M <<
" \r\n";
167 for (
unsigned int i = 0;
i <
knt1.size() - 1;
i++) {
168 file << std::fixed << std::setprecision(15) <<
knt1[
i] <<
" ";
170 file << std::fixed << std::setprecision(15) <<
knt1[
knt1.size() - 1]
172 for (
unsigned int i = 0;
i <
knt2.size() - 1;
i++) {
173 file << std::fixed << std::setprecision(15) <<
knt2[
i] <<
" ";
175 file << std::fixed << std::setprecision(15) <<
knt2[
knt2.size() - 1]
179 for (
unsigned int n = 0;
n <
xyzw.size();
n++) {
180 for (
int i = 0;
i <
M;
i++)
181 for (
int j = 0;
j <
N;
j++) {
182 file << std::fixed << std::setprecision(15) <<
xyzw[
n](
i,
j);
183 if (
N *
i +
j ==
M *
N - 1) {
212 "I assume 0 and 1 as unique knots!");
214 "I assume 0 and 1 as unique knots!");
227 std::vector<Eigen::MatrixXd>
data(
234 data[0](rowIndex, colIndex) =
patch.data_[4 *
i];
235 data[1](rowIndex, colIndex) =
patch.data_[4 *
i + 1];
236 data[2](rowIndex, colIndex) =
patch.data_[4 *
i + 2];
237 data[3](rowIndex, colIndex) =
patch.data_[4 *
i + 3];
this class wraps a GeometryVector and provides some basic functionality, like reading Geometry files
void WriteDATFile(const std::vector< Patch > &Geometry, const std::string &file_name)
exports a geometry from Bembel to a .dat file.
std::vector< Patch > LoadGeometryFileDAT(const std::string &file_name) noexcept
loads geometry from file with GEOPDE-format. Note that the direction of the normals must be consisten...
Routines for the evalutation of pointwise errors.
constexpr int getFunctionSpaceOutputDimension()
void WritePatch(const std::string &file_name, int current_patch_number, const std::vector< Eigen::MatrixXd > &xyzw, const std::vector< double > &knt1, const std::vector< double > &knt2) noexcept
method to write Patch information into textfile
void MakeFile(const std::string &file_name, int number_of_patches) noexcept
method to generate textfile for the geometry