952 for (
int i = 1; i <
m_layer; i++)
954 m_layerT[i] = m_layerT[i - 1] + a * pow(
m_prog, i) *
m_bl;
959 cout <<
"First layer height " << m_layerT[0] << endl;
971 for (it =
m_mesh->m_vertexSet.begin(); it !=
m_mesh->m_vertexSet.end();
974 vector<pair<int, CADSurfSharedPtr> > ss = (*it)->GetCADSurfs();
975 vector<unsigned int> surfs;
976 for (
int i = 0; i < ss.size(); i++)
978 surfs.push_back(ss[i].first);
980 sort(surfs.begin(), surfs.end());
981 vector<unsigned int> inter, diff;
984 surfs.end(), back_inserter(inter));
985 set_symmetric_difference(inter.begin(), inter.end(), surfs.begin(),
986 surfs.end(), back_inserter(diff));
989 if (inter.size() > 0)
994 bln->stopped =
false;
1003 ASSERTL0(diff.size() <= 1,
"not setup for curve bl refinement");
1004 symSurfs.insert(diff[0]);
1005 bln->symsurf = diff[0];
1020 for (
int i = 0; i <
m_mesh->m_element[2].size(); i++)
1024 m_mesh->m_element[2][i]->m_parentCAD->GetId());
1032 vector<NodeSharedPtr> ns =
m_mesh->m_element[2][i]->GetVertexList();
1033 for (
int j = 0; j < ns.size(); j++)
1037 m_mesh->m_element[2][i]->m_parentCAD->GetId());
1045 bit->second->N =
GetNormal(bit->second->els);
1047 if (
Visability(bit->second->els, bit->second->N) < 0.0)
1049 cerr <<
"failed " << bit->first->m_x <<
" " << bit->first->m_y
1050 <<
" " << bit->first->m_z <<
" "
1051 <<
Visability(bit->second->els, bit->second->N) << endl;
1055 Array<OneD, NekDouble> loc = bit->first->GetLoc();
1056 for (
int k = 0; k < 3; k++)
1058 loc[k] += bit->second->N[k] * m_layerT[0];
1061 bit->second->pNode = boost::shared_ptr<Node>(
1062 new Node(
m_mesh->m_numNodes++, loc[0], loc[1], loc[2]));
1063 bit->second->bl = 0;
1066 m_symSurfs = vector<unsigned int>(symSurfs.begin(), symSurfs.end());
1072 if (!bit->second->onSym)
1077 Array<OneD, NekDouble> uv(2);
1078 Array<OneD, NekDouble> loc = bit->second->pNode->GetLoc();
1079 m_mesh->m_cad->GetSurf(bit->second->symsurf)->ProjectTo(loc, uv);
1081 Array<OneD, NekDouble> nl =
1082 m_mesh->m_cad->GetSurf(bit->second->symsurf)->P(uv);
1084 Array<OneD, NekDouble> N(3);
1085 N[0] = nl[0] - bit->first->m_x;
1086 N[1] = nl[1] - bit->first->m_y;
1087 N[2] = nl[2] - bit->first->m_z;
1089 NekDouble mag = sqrt(N[0] * N[0] + N[1] * N[1] + N[2] * N[2]);
1095 bit->second->AlignNode(m_layerT[0]);
1103 added.insert(bit->first->m_id);
1104 for (
int i = 0; i < bit->second->els.size(); i++)
1106 vector<NodeSharedPtr> ns = bit->second->els[i]->GetVertexList();
1107 for (
int j = 0; j < ns.size(); j++)
1110 if (t == added.end())
1118 for (
int l = 0; l < 10; l++)
1122 if (bit->first->GetNumCADSurf() > 1)
1127 Array<OneD, NekDouble> sumV(3, 0.0);
1128 vector<blInfoSharedPtr> data =
m_nToNInfo[bit->first];
1130 for (
int i = 0; i < data.size(); i++)
1132 NekDouble d = bit->first->Distance(data[i]->oNode);
1134 sumV[0] += data[i]->N[0] / d;
1135 sumV[1] += data[i]->N[1] / d;
1136 sumV[2] += data[i]->N[2] / d;
1142 sqrt(sumV[0] * sumV[0] + sumV[1] * sumV[1] + sumV[2] * sumV[2]);
1147 Array<OneD, NekDouble> N(3);
1149 N[0] = (1.0 - 0.8) * bit->second->N[0] + 0.8 * sumV[0];
1150 N[1] = (1.0 - 0.8) * bit->second->N[1] + 0.8 * sumV[1];
1151 N[2] = (1.0 - 0.8) * bit->second->N[2] + 0.8 * sumV[2];
1153 mag = sqrt(N[0] * N[0] + N[1] * N[1] + N[2] * N[2]);
1159 bit->second->AlignNode(m_layerT[0]);
1177 ASSERTL0(failed == 0,
"some normals failed to generate");
1181 Array<OneD, NekDouble> u1, v1, w1;
1184 LibUtilities::NodalUtilPrism nodalPrism(1, u1, v1, w1);
1186 NekMatrix<NekDouble> Vandermonde = *nodalPrism.GetVandermonde();
1187 NekMatrix<NekDouble> VandermondeI = Vandermonde;
1188 VandermondeI.Invert();
1190 m_deriv[0] = *nodalPrism.GetVandermondeForDeriv(0) * VandermondeI;
1191 m_deriv[1] = *nodalPrism.GetVandermondeForDeriv(1) * VandermondeI;
1192 m_deriv[2] = *nodalPrism.GetVandermondeForDeriv(2) * VandermondeI;
#define ASSERTL0(condition, msg)
Array< OneD, NekDouble > GetNormal(std::vector< ElementSharedPtr > tris)
std::vector< unsigned int > m_symSurfs
list of surfaces to be remeshed due to the boundary layer
MeshSharedPtr m_mesh
mesh object containing surface mesh
NekDouble Visability(std::vector< ElementSharedPtr > tris, Array< OneD, NekDouble > N)
Array< OneD, NekDouble > m_layerT
NekDouble m_bl
thickness of the boundary layer
std::map< NodeSharedPtr, blInfoSharedPtr > m_blData
data structure used to store and develop bl information
NekMatrix< NekDouble > m_deriv[3]
PointsManagerT & PointsManager(void)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
std::map< NodeSharedPtr, std::vector< blInfoSharedPtr > > m_nToNInfo
boost::shared_ptr< blInfo > blInfoSharedPtr
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
3D electrostatically spaced points on a Prism
std::vector< unsigned int > m_blsurfs
List of surfaces onto which boundary layers are placed.