Skip to content
Snippets Groups Projects
Commit 885e010d authored by Amaury Johnen's avatar Amaury Johnen
Browse files

higher order elements are not needed to draw the high-order pview

parent 309b9523
No related branches found
No related tags found
No related merge requests found
...@@ -116,9 +116,9 @@ PView* GMSH_AnalyseCurvedMeshPlugin::execute(PView *v) ...@@ -116,9 +116,9 @@ PView* GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
_numElementToScan = static_cast<int>(CurvedMeshOptions_Number[7].def); _numElementToScan = static_cast<int>(CurvedMeshOptions_Number[7].def);
_viewOrder = 10; _viewOrder = 10;
_elementToScan = NULL; _elementToScan = NULL;
_hoElement = NULL; // _hoElement = NULL;
for (int type = 0; type < 20; ++type) { for (int type = 0; type < 20; ++type) {
_allElem[type].clear(); // _allElem[type].clear();
_dataPViewJacAllElements[type].clear(); _dataPViewJacAllElements[type].clear();
} }
...@@ -544,20 +544,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el, ...@@ -544,20 +544,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
_entity = entity; _entity = entity;
_elementToScan = el; _elementToScan = el;
fullMatrix<double> points = // fullMatrix<double> points =
_elementToScan->getFunctionSpace(_viewOrder)->points; // _elementToScan->getFunctionSpace(_viewOrder)->points;
int tag = ElementType::getTag(_elementToScan->getType(), _viewOrder); // int tag = ElementType::getTag(_elementToScan->getType(), _viewOrder);
std::vector<MVertex *> v; // std::vector<MVertex *> v;
for (int k = 0; k < points.size1(); k++) { // for (int k = 0; k < points.size1(); k++) {
double t1 = points(k, 0); // double t1 = points(k, 0);
double t2 = points(k, 1); // double t2 = points(k, 1);
double t3 = points(k, 2); // double t3 = points(k, 2);
SPoint3 pos; // SPoint3 pos;
_elementToScan->pnt(t1, t2, t3, pos); // _elementToScan->pnt(t1, t2, t3, pos);
v.push_back(new MVertex(pos.x(), pos.y(), pos.z())); // v.push_back(new MVertex(pos.x(), pos.y(), pos.z()));
} // }
MElementFactory factory; // MElementFactory factory;
_hoElement = factory.create(tag, v); // _hoElement = factory.create(tag, v);
fullVector<double> jac; fullVector<double> jac;
jacobianBasedQuality::sampleJacobian(_elementToScan, _viewOrder, jacobianBasedQuality::sampleJacobian(_elementToScan, _viewOrder,
...@@ -569,9 +569,10 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el, ...@@ -569,9 +569,10 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
if (_numElementToScan == -7) { if (_numElementToScan == -7) {
const int type = el->getType(); const int type = el->getType();
// _jacAllElem[type].push_back(_jacElementToScan); // _allElem[type].push_back(std::make_pair(el, _hoElement));
_allElem[type].push_back(std::make_pair(el, _hoElement)); _allElem[type].push_back(std::make_pair(el, el));
_dataPViewJacAllElements[type][_hoElement->getNum()] = _jacElementToScan; // _dataPViewJacAllElements[type][_hoElement->getNum()] = _jacElementToScan;
_dataPViewJacAllElements[type][_elementToScan->getNum()] = _jacElementToScan;
} }
} }
...@@ -626,33 +627,33 @@ void GMSH_AnalyseCurvedMeshPlugin::_addElementInEntity(MElement *element, ...@@ -626,33 +627,33 @@ void GMSH_AnalyseCurvedMeshPlugin::_addElementInEntity(MElement *element,
void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan() void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
{ {
if (!_hoElement) return; // if (!_hoElement) return;
const nodalBasis *fs = BasisFactory::getNodalBasis(_hoElement->getTypeForMSH());
const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
// Jacobian determinant // Jacobian determinant
std::map<int, std::vector<double>> dataPView; std::map<int, std::vector<double>> dataPView;
std::stringstream name; std::stringstream name;
if (_numElementToScan != -7) { if (_numElementToScan != -7) {
dataPView[_hoElement->getNum()] = _jacElementToScan; // const nodalBasis *fs = BasisFactory::getNodalBasis(_hoElement->getTypeForMSH());
name.str(std::string()); // const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
name << "Jacobian elem " << _numElementToScan; //
_addElementInEntity(_hoElement, _entity); // dataPView[_hoElement->getNum()] = _jacElementToScan;
PView *view = new PView(name.str().c_str(), "ElementNodeData", // name.str(std::string());
_m, dataPView, 0, 1); // name << "Jacobian elem " << _numElementToScan;
PViewData *viewData = view->getData(); // _addElementInEntity(_hoElement, _entity);
viewData->deleteInterpolationMatrices(_hoElement->getType()); // PView *view = new PView(name.str().c_str(), "ElementNodeData",
viewData->setInterpolationMatrices(_hoElement->getType(), // _m, dataPView, 0, 1);
pfs->coefficients, pfs->monomials, // PViewData *viewData = view->getData();
pfs->coefficients, pfs->monomials); // viewData->deleteInterpolationMatrices(_hoElement->getType());
// viewData->setInterpolationMatrices(_hoElement->getType(),
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
} }
else { else {
for (int type = 0; type < 20; ++type) { for (int type = 0; type < 20; ++type) {
if (_dataPViewJacAllElements[type].empty()) continue; if (_dataPViewJacAllElements[type].empty()) continue;
for (int i = 0; i < _allElem[type].size(); ++i) { // for (int i = 0; i < _allElem[type].size(); ++i) {
_addElementInEntity(_allElem[type][i].second, _entity); // _addElementInEntity(_allElem[type][i].second, _entity);
} // }
name.str(std::string()); name.str(std::string());
name << "Jacobian all "; name << "Jacobian all ";
switch (type) { switch (type) {
...@@ -665,32 +666,40 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan() ...@@ -665,32 +666,40 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
PViewData *viewData = view->getData(); PViewData *viewData = view->getData();
viewData->deleteInterpolationMatrices(type); viewData->deleteInterpolationMatrices(type);
const int hoTag = _allElem[type][0].second->getTypeForMSH(); // const int hoTag = _allElem[type][0].second->getTypeForMSH();
const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag); // const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag);
const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs); // const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
// viewData->setInterpolationMatrices(type,
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
const nodalBasis *fsE = BasisFactory::getNodalBasis(_allElem[type][0].first->getTypeForMSH());
const polynomialBasis *pfsE = dynamic_cast<const polynomialBasis*>(fsE);
const int hoTag = ElementType::getTag(type, _viewOrder);
const nodalBasis *fsV = BasisFactory::getNodalBasis(hoTag);
const polynomialBasis *pfsV = dynamic_cast<const polynomialBasis*>(fsV);
viewData->setInterpolationMatrices(type, viewData->setInterpolationMatrices(type,
pfs->coefficients, pfs->monomials, pfsV->coefficients, pfsV->monomials,
pfs->coefficients, pfs->monomials); pfsE->coefficients, pfsE->monomials);
} }
} }
// Quality measures // Quality measures
fullVector<double> ige; fullVector<double> ige;
if (_numElementToScan != -7) { if (_numElementToScan != -7) {
jacobianBasedQuality::sampleIGEMeasure(_elementToScan, _viewOrder, ige); // jacobianBasedQuality::sampleIGEMeasure(_elementToScan, _viewOrder, ige);
dataPView.clear(); // dataPView.clear();
for (int j = 0; j < ige.size(); ++j) { // for (int j = 0; j < ige.size(); ++j) {
dataPView[_hoElement->getNum()].push_back(ige(j)); // dataPView[_hoElement->getNum()].push_back(ige(j));
} // }
name.str(std::string()); // name.str(std::string());
name << "IGE elem " << _numElementToScan; // name << "IGE elem " << _numElementToScan;
PView *view = new PView(name.str().c_str(), "ElementNodeData", // PView *view = new PView(name.str().c_str(), "ElementNodeData",
_m, dataPView, 0, 1); // _m, dataPView, 0, 1);
PViewData *viewData = view->getData(); // PViewData *viewData = view->getData();
viewData->deleteInterpolationMatrices(_hoElement->getType()); // viewData->deleteInterpolationMatrices(_hoElement->getType());
viewData->setInterpolationMatrices(_hoElement->getType(), // viewData->setInterpolationMatrices(_hoElement->getType(),
pfs->coefficients, pfs->monomials, // pfs->coefficients, pfs->monomials,
pfs->coefficients, pfs->monomials); // pfs->coefficients, pfs->monomials);
} }
else { else {
for (int type = 0; type < 20; ++type) { for (int type = 0; type < 20; ++type) {
...@@ -718,12 +727,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan() ...@@ -718,12 +727,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
PViewData *viewData = view->getData(); PViewData *viewData = view->getData();
viewData->deleteInterpolationMatrices(type); viewData->deleteInterpolationMatrices(type);
const int hoTag = _allElem[type][0].second->getTypeForMSH(); // const int hoTag = _allElem[type][0].second->getTypeForMSH();
const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag); // const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag);
const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs); // const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
// viewData->setInterpolationMatrices(type,
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
const nodalBasis *fsE = BasisFactory::getNodalBasis(_allElem[type][0].first->getTypeForMSH());
const polynomialBasis *pfsE = dynamic_cast<const polynomialBasis*>(fsE);
const int hoTag = ElementType::getTag(type, _viewOrder);
const nodalBasis *fsV = BasisFactory::getNodalBasis(hoTag);
const polynomialBasis *pfsV = dynamic_cast<const polynomialBasis*>(fsV);
viewData->setInterpolationMatrices(type, viewData->setInterpolationMatrices(type,
pfs->coefficients, pfs->monomials, pfsV->coefficients, pfsV->monomials,
pfs->coefficients, pfs->monomials); pfsE->coefficients, pfsE->monomials);
} }
......
...@@ -44,7 +44,7 @@ private : ...@@ -44,7 +44,7 @@ private :
// Element to scan // Element to scan
int _numElementToScan; int _numElementToScan;
MElement *_elementToScan, *_hoElement; MElement *_elementToScan, *__hoElement;
int _viewOrder; int _viewOrder;
std::vector<double> _jacElementToScan; std::vector<double> _jacElementToScan;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment