Commit f31de7ee authored by Dave Moxey's avatar Dave Moxey
Browse files

Merge branch 'feature/linearise-extract' into 'master'

feature/linearise_extract

Small MR that adds the ability to dump the elements which were touched by the linearise module for visualisation.

See merge request !712
parents 3b1843d9 2e684b0b
......@@ -69,6 +69,7 @@ v4.4.0
- Add flag to `insertsurface` process for non-conforming geometries (!700)
- Bug fix to get two meshgen regression tests working (!700)
- Remove libANN in deference to boost::geometry (!703)
- Add a mesh extract option to the linearise module to visualise the result (!712)
**FieldConvert:**
- Move all modules to a new library, FieldUtils, to support post-processing
......
......@@ -55,6 +55,8 @@ ProcessLinear::ProcessLinear(MeshSharedPtr m) : ProcessModule(m)
ConfigOption(false, "0", "remove curve nodes if element is invalid.");
m_config["prismonly"] =
ConfigOption(false, "", "only acts on prims");
m_config["extract"] =
ConfigOption(false, "", "dump a mesh of the extracted elements");
}
ProcessLinear::~ProcessLinear()
......@@ -138,6 +140,8 @@ void ProcessLinear::Process()
vector<NodeSharedPtr> zeroNodes;
boost::unordered_set<int> clearedEdges, clearedFaces, clearedElmts;
vector<ElementSharedPtr> dumpEls;
// Iterate over list of elements of expansion dimension.
while(el.size() > 0)
{
......@@ -153,6 +157,7 @@ void ProcessLinear::Process()
if (Invalid(el[i],thr))//(!gfac->IsValid())
{
dumpEls.push_back(el[i]);
clearedElmts.insert(el[i]->GetId());;
el[i]->SetVolumeNodes(zeroNodes);
......@@ -216,6 +221,26 @@ void ProcessLinear::Process()
<< " elements (" << clearedEdges.size() << " edges, "
<< clearedFaces.size() << " faces)" << endl;
}
if(m_config["extract"].beenSet)
{
MeshSharedPtr dmp = boost::shared_ptr<Mesh>(new Mesh());
dmp->m_expDim = 3;
dmp->m_spaceDim = 3;
dmp->m_nummode = 2;
dmp->m_element[3] = dumpEls;
ModuleSharedPtr mod = GetModuleFactory().CreateInstance(
ModuleKey(eOutputModule, "xml"), dmp);
mod->RegisterConfig("outfile", m_config["extract"].as<string>().c_str());
mod->ProcessVertices();
mod->ProcessEdges();
mod->ProcessFaces();
mod->ProcessElements();
mod->ProcessComposites();
mod->Process();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment