Coder Social home page Coder Social logo

Comments (2)

zhangchonglin avatar zhangchonglin commented on August 14, 2024

@cwsmith: thanks for creating this issue. From looking at the gmsh.cc code:

core/test/gmsh.cc

Lines 40 to 52 in d7cc6c8

if (gmshVersion == 2) {
if (model.compare("none") == 0) {
m = apf::loadMdsFromGmsh(gmi_load(".null"), gmsh.c_str());
apf::deriveMdsModel(m);
gmi_write_dmg(m->getModel(),outModel.c_str());
} else {
m = apf::loadMdsFromGmsh(gmi_load(model.c_str()), gmsh.c_str());
}
} else if (gmshVersion == 4) {
if (model.compare("none") == 0) {
m = apf::loadMdsDmgFromGmsh(outModel.c_str(), gmsh.c_str());
}
}

  • it seems that with gmsh version 4, the .dmg file is not needed, where function loadMdsDmgFromGmsh does not accept .dmg input file:

    core/mds/mdsGmsh.cc

    Lines 469 to 475 in d7cc6c8

    Mesh2* loadMdsDmgFromGmsh(const char*fnameDmg, const char* filename)
    {
    gmshFindDmg(fnameDmg, filename); // new function that scans $Entities and writes a dmg
    Mesh2* m = makeEmptyMdsMesh(gmi_load(fnameDmg), 0, false);
    readGmsh(m, filename);
    return m;
    }

  • for gmsh version 2, .dmg input file is an optional file.

It seems that the if statement corresponding to gmshVersion == 4 needs to be restructured to be consistent with all types of input arguments.

from core.

cwsmith avatar cwsmith commented on August 14, 2024

it seems that with gmsh version 4, the .dmg file is not needed

That is correct, v4 can embed sufficient info into the .msh file for creating the output .dmg. I'm not sure if all v4 gmsh meshes will have this info though.

loadMdsDmgFromGmsh does not accept .dmg input file

Yeah, thanks for digging.

Regarding the if statement in gmsh.cc for v4, I agree, there should at least be an else that prints a helpful error message.

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.