Skip to content
Snippets Groups Projects
Commit 1d90e12b authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

No commit message

No commit message
parent fa5bbf4c
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,7 @@ class cartesianBox {
// set of active cells; the value stored for cell (i,j,k) is the
// linear index (i + _Nxi * j + _Nxi *_Neta * k)
std::set<int> _activeCells;
// map of stored nodal values, index by the linear index (i +
// map of stored nodal values, indexed by the linear index (i +
// (_Nxi+1) * j + (_Nxi+1) * (_Neta+1) * k). Along with the value is
// stored a node tag (used for global numbering of the nodes across
// the grid levels)
......@@ -48,7 +48,7 @@ class cartesianBox {
// level of the box (coarset box has highest level; finest box has
// level==1)
int _level;
// pointer to a finer (refined by 2) level box (if any)
// pointer to a finer (refined by 2) level box, if any
cartesianBox<scalar> *_childBox;
int _getNumNodes()
{
......@@ -82,16 +82,15 @@ class cartesianBox {
int i, j, k;
getCellIJK(*it, i, j, k);
if(!simplex){
fprintf(f, "%d 5 3 1 1 1", num++);
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i, j, k))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i + 1, j, k))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i + 1, j + 1, k))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i, j + 1, k))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i, j, k + 1))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i + 1, j, k + 1))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i + 1, j + 1, k + 1))));
fprintf(f, " %d", std::abs(getNodeTag(getNodeIndex(i, j + 1, k + 1))));
fprintf(f, "\n");
fprintf(f, "%d 5 3 1 1 1 %d %d %d %d %d %d %d %d\n", num++,
std::abs(getNodeTag(getNodeIndex(i, j, k))),
std::abs(getNodeTag(getNodeIndex(i + 1, j, k))),
std::abs(getNodeTag(getNodeIndex(i + 1, j + 1, k))),
std::abs(getNodeTag(getNodeIndex(i, j + 1, k))),
std::abs(getNodeTag(getNodeIndex(i, j, k + 1))),
std::abs(getNodeTag(getNodeIndex(i + 1, j, k + 1))),
std::abs(getNodeTag(getNodeIndex(i + 1, j + 1, k + 1))),
std::abs(getNodeTag(getNodeIndex(i, j + 1, k + 1))));
}
else{
int idx[6][4] = {
......@@ -165,7 +164,7 @@ class cartesianBox {
if(it != _nodalValues.end())
values.push_back(it->second.first);
else{
Msg::Error("Could not find value i,j,k=%d,%d,%d for cell %d\n",
Msg::Error("Could not find value i,j,k=%d,%d,%d for cell %d",
i + I, j + J, k + K, t);
values.push_back(0.);
}
......
// lx ly lz rmax levels
//
// plaqueEp.stp 0.2 0.2 0.2 0.3 3
// plaqueEpRotated.stp 0.3 0.3 0.3 0.3 3
// jonction_collee2.stp 6 6 6 10 3
// panneau_raidi_simple.stp 3 3 50 10 1
// plaque_trouee.stp 1 1 1 2 3
#include "Gmsh.h"
#include "GModel.h"
#include "MVertex.h"
......@@ -184,10 +192,12 @@ int main(int argc,char *argv[])
double rmax = atof(argv[5]);
int levels = (argc > 6) ? atof(argv[6]) : 1;
// minimum distance between points in the cloud at the coarsest level
// minimum distance between points in the cloud at the coarsest
// level
double sampling = std::min(rmax, std::min(lx, std::min(ly, lz)));
// radius of the "tube" created around edges at the coarsest level
// radius of the "tube" created around parts to refine at the
// coarsest level
double rtube = std::max(lx, std::max(ly, lz)) * 2.;
GModel *gm = GModel::current();
......@@ -270,7 +280,8 @@ int main(int argc,char *argv[])
Msg::Info("Renumbering mesh vertices across levels");
box.renumberNodes();
box.writeMSH("yeah.msh", true);
bool decomposeInSimplex = false;
box.writeMSH("yeah.msh", decomposeInSimplex);
Msg::Info("Done!");
GmshFinalize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment