Skip to content
Snippets Groups Projects
Commit 5d525152 authored by Matti Pellika's avatar Matti Pellika
Browse files

Fixed orientation issue with overlapping chains.

parent 5d110a04
No related branches found
No related tags found
No related merge requests found
...@@ -649,19 +649,24 @@ void Chain::createPView() ...@@ -649,19 +649,24 @@ void Chain::createPView()
{ {
std::vector<MElement*> elements; std::vector<MElement*> elements;
std::map<int, std::vector<double> > data; std::map<int, std::vector<double> > data;
MElementFactory factory;
for(citer cit = _cells.begin(); cit != _cells.end(); cit++){ for(citer cit = _cells.begin(); cit != _cells.end(); cit++){
Cell* cell = (*cit).first; Cell* cell = (*cit).first;
int coeff = (*cit).second; int coeff = (*cit).second;
MElement* e = cell->getImageMElement(); MElement* e = cell->getImageMElement();
cell->setDeleteImage(false); std::vector<MVertex*> v;
for(int i = 0; i < e->getNumVertices(); i++){
v.push_back(e->getVertex(i));
}
MElement* ne = factory.create(e->getTypeForMSH(), v);
if(cell->getDim() > 0 && coeff < 0) e->revert(); // flip orientation if(cell->getDim() > 0 && coeff < 0) ne->revert(); // flip orientation
for(int i = 0; i < abs(coeff); i++) elements.push_back(e); for(int i = 0; i < abs(coeff); i++) elements.push_back(ne);
std::vector<double> coeffs (1,abs(coeff)); std::vector<double> coeffs (1,abs(coeff));
data[e->getNum()] = coeffs; data[ne->getNum()] = coeffs;
} }
int max[4]; int max[4];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment