tmp
This commit is contained in:
parent
b7508642a7
commit
807e472dee
@ -45,7 +45,10 @@ int main(int argc, char *argv[])
|
|||||||
std::cout << "data name: " << data3.name_ << std::endl;
|
std::cout << "data name: " << data3.name_ << std::endl;
|
||||||
data3.datval_.show();
|
data3.datval_.show();
|
||||||
|
|
||||||
|
rgd.diff("data-4", "data-1", "data-3");
|
||||||
|
|
||||||
rgd.remove_data("data-1");
|
rgd.remove_data("data-1");
|
||||||
rgd.show_info();
|
rgd.show_info();
|
||||||
|
rgd.save_gmsh_withdata("ex1_out", gctl::OverWrite, gctl::NotPacked);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
@ -276,9 +276,8 @@ const gctl::array<double> *gctl::linear_mesh_2d::get_ysizes() const
|
|||||||
|
|
||||||
void gctl::linear_mesh_2d::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::linear_mesh_2d::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -366,9 +366,8 @@ const gctl::array<double> *gctl::linear_mesh_3d::get_zsizes() const
|
|||||||
|
|
||||||
void gctl::linear_mesh_3d::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::linear_mesh_3d::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -652,10 +652,9 @@ void gctl::regular_grid::save_surfer_grid(std::string filename, std::string datn
|
|||||||
|
|
||||||
void gctl::regular_grid::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::regular_grid::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,9 +213,8 @@ double gctl::regular_mesh_2d::get_ysize() const
|
|||||||
|
|
||||||
void gctl::regular_mesh_2d::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::regular_mesh_2d::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -260,9 +260,8 @@ double gctl::regular_mesh_3d::get_zsize() const
|
|||||||
|
|
||||||
void gctl::regular_mesh_3d::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::regular_mesh_3d::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -277,10 +277,10 @@ void gctl::regular_mesh_sph_3d::save_gmsh(std::string filename, index_packed_e p
|
|||||||
tmp_nodes[i].y = tmp_c.y;
|
tmp_nodes[i].y = tmp_c.y;
|
||||||
tmp_nodes[i].z = tmp_c.z;
|
tmp_nodes[i].z = tmp_c.z;
|
||||||
}
|
}
|
||||||
std::ofstream outfile;
|
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.init_file(filename, Output);
|
||||||
gctl::save2gmsh(outfile, elements, tmp_nodes, packed);
|
meshio_.set_packed(packed, Output);
|
||||||
outfile.close();
|
meshio_.save_mesh(elements, tmp_nodes);
|
||||||
tmp_nodes.clear();
|
tmp_nodes.clear();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -197,9 +197,8 @@ void gctl::tetrahedron_mesh::load_gmsh(std::string filename, index_packed_e pack
|
|||||||
|
|
||||||
void gctl::tetrahedron_mesh::save_gmsh(std::string filename, index_packed_e packed)
|
void gctl::tetrahedron_mesh::save_gmsh(std::string filename, index_packed_e packed)
|
||||||
{
|
{
|
||||||
std::ofstream outfile;
|
meshio_.init_file(filename, Output);
|
||||||
gctl::open_outfile(outfile, filename, ".msh");
|
meshio_.set_packed(packed, Output);
|
||||||
gctl::save2gmsh(outfile, elements, nodes, packed);
|
meshio_.save_mesh(elements, nodes);
|
||||||
outfile.close();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -530,31 +530,19 @@ void wavelet(const std::vector<std::string> &cmd_units)
|
|||||||
|
|
||||||
void sum_data(const std::vector<std::string> &cmd_units)
|
void sum_data(const std::vector<std::string> &cmd_units)
|
||||||
{
|
{
|
||||||
// sum-data \<new-data-name\> \<data-name1\> \<data-name2\>
|
// sum-data \<new-data\> \<data1\> \<data2\>
|
||||||
if (cmd_units.size() < 4) throw std::runtime_error("sum: insufficient parameters.");
|
if (cmd_units.size() < 4) throw std::runtime_error("sum: insufficient parameters.");
|
||||||
|
|
||||||
gctl::array<std::string> copy_str(3, "null");
|
rg.sum(cmd_units[1], cmd_units[2], cmd_units[3]);
|
||||||
for (size_t i = 1; i <= GCTL_MIN(cmd_units.size() - 1, 3); i++)
|
|
||||||
{
|
|
||||||
copy_str[i - 1] = cmd_units[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
rg.sum(copy_str[0], copy_str[1], copy_str[2]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void diff_data(const std::vector<std::string> &cmd_units)
|
void diff_data(const std::vector<std::string> &cmd_units)
|
||||||
{
|
{
|
||||||
// sum-data \<new-data-name\> \<data-name1\> \<data-name2\>
|
// diff \<new-data\> \<data1\> \<data2\>
|
||||||
if (cmd_units.size() < 4) throw std::runtime_error("diff: insufficient parameters.");
|
if (cmd_units.size() < 4) throw std::runtime_error("diff: insufficient parameters.");
|
||||||
|
|
||||||
gctl::array<std::string> copy_str(3, "null");
|
rg.diff(cmd_units[1], cmd_units[2], cmd_units[3]);
|
||||||
for (size_t i = 1; i <= GCTL_MIN(cmd_units.size() - 1, 3); i++)
|
|
||||||
{
|
|
||||||
copy_str[i - 1] = cmd_units[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
rg.diff(copy_str[0], copy_str[1], copy_str[2]);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,10 +32,10 @@ data type of the used data. 'dx' and 'dy' give the calculation directions. highe
|
|||||||
#### wavelet \<data-name\> \<wavelet-name\> \<order\> [\<show-summary\>]
|
#### wavelet \<data-name\> \<wavelet-name\> \<order\> [\<show-summary\>]
|
||||||
Using a wavelet \<wavelet-name\> to decompose the selecte data. Avaiable wavelets include 'bd2'... .The order of decomposition could be set using \<order\>. And set \<show-summary\> to yes to see the summary.
|
Using a wavelet \<wavelet-name\> to decompose the selecte data. Avaiable wavelets include 'bd2'... .The order of decomposition could be set using \<order\>. And set \<show-summary\> to yes to see the summary.
|
||||||
|
|
||||||
#### sum \<new-data-name\> \<data-name1\> \<data-name2\>
|
#### sum \<new-data\> \<data1\> \<data2\>
|
||||||
Calculate the sum of the two data. The arguments' format should be clear enough.
|
Calculate the sum of the two data. The arguments' format should be clear enough.
|
||||||
|
|
||||||
#### diff \<new-data-name\> \<data-name1\> \<data-name2\>
|
#### diff \<new-data\> \<data1\> \<data2\>
|
||||||
Calculate the difference of the two data. The arguments' format should be clear enough.
|
Calculate the difference of the two data. The arguments' format should be clear enough.
|
||||||
|
|
||||||
#### bool \<new-data-name\> \<data-name1> \<bool-data\> [reverse]
|
#### bool \<new-data-name\> \<data-name1> \<bool-data\> [reverse]
|
||||||
|
Loading…
Reference in New Issue
Block a user