insert boundary layer

This commit is contained in:
Joachim Schoeberl 2014-12-18 16:46:54 +00:00
parent 49e108da4f
commit 4be52c4ee5
3 changed files with 18 additions and 3 deletions

View File

@ -509,8 +509,8 @@ namespace netgen
Element el(types[classify]); Element el(types[classify]);
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
el[i] = nums[vertices[classify][i]]; el[i] = nums[vertices[classify][i]];
el.SetIndex(1); el.SetIndex(blp.matnr);
cout << "el = " << el << endl; // cout << "el = " << el << endl;
if (classify != 0) if (classify != 0)
mesh.AddVolumeElement(el); mesh.AddVolumeElement(el);
} }

View File

@ -14,6 +14,7 @@ public:
// parameters by Philippose .. // parameters by Philippose ..
Array<int> surfid; Array<int> surfid;
int prismlayers = 1; int prismlayers = 1;
int matnr = 1;
double hfirst = 0.01; double hfirst = 0.01;
double growthfactor = 1; double growthfactor = 1;
}; };

View File

@ -137,10 +137,24 @@ void ExportNetgenMeshing()
([](Mesh & self, int bc, double thickness, string material) ([](Mesh & self, int bc, double thickness, string material)
{ {
BoundaryLayerParameters blp; BoundaryLayerParameters blp;
blp.surfid.Append (bc);
for (int i = 1; i <= self.GetNFD(); i++)
if (self.GetFaceDescriptor(i).BCProperty() == bc)
blp.surfid.Append (i);
cout << "add layer at surfaces: " << blp.surfid << endl;
blp.prismlayers = 1; blp.prismlayers = 1;
blp.hfirst = thickness; blp.hfirst = thickness;
blp.growthfactor = 1.0; blp.growthfactor = 1.0;
// find max domain nr
int maxind = 0;
for (ElementIndex ei = 0; ei < self.GetNE(); ei++)
maxind = max (maxind, self[ei].GetIndex());
cout << "maxind = " << maxind << endl;
self.SetMaterial (maxind+1, material.c_str());
blp.matnr = maxind+1;
GenerateBoundaryLayer (self, blp); GenerateBoundaryLayer (self, blp);
} }
)) ))