Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 #include <OpenFOAM/degenerateMatcher.H>
00027 
00028 
00029 
00030 Foam::hexMatcher Foam::degenerateMatcher::hex;
00031 Foam::wedgeMatcher Foam::degenerateMatcher::wedge;
00032 Foam::prismMatcher Foam::degenerateMatcher::prism;
00033 Foam::tetWedgeMatcher Foam::degenerateMatcher::tetWedge;
00034 Foam::pyrMatcher Foam::degenerateMatcher::pyr;
00035 Foam::tetMatcher Foam::degenerateMatcher::tet;
00036 
00037 
00038 Foam::cellShape Foam::degenerateMatcher::match
00039 (
00040     const faceList& faces,
00041     const labelList& owner,
00042     const label cellI,
00043     const labelList& cellFaces
00044 )
00045 {
00046     
00047 
00048     if (hex.matchShape(false, faces, owner, cellI, cellFaces))
00049     {
00050         return cellShape(hex.model(), hex.vertLabels());
00051     }
00052     else if (tet.matchShape(false, faces, owner, cellI, cellFaces))
00053     {
00054         return cellShape(tet.model(), tet.vertLabels());
00055     }
00056     else if (prism.matchShape(false, faces, owner, cellI, cellFaces))
00057     {
00058         return cellShape(prism.model(), prism.vertLabels());
00059     }
00060     else if (pyr.matchShape(false, faces, owner, cellI, cellFaces))
00061     {
00062         return cellShape(pyr.model(), pyr.vertLabels());
00063     }
00064     else if (wedge.matchShape(false, faces, owner, cellI, cellFaces))
00065     {
00066         return cellShape(wedge.model(), wedge.vertLabels());
00067     }
00068     else if (tetWedge.matchShape(false, faces, owner, cellI, cellFaces))
00069     {
00070         return cellShape(tetWedge.model(), tetWedge.vertLabels());
00071     }
00072     else
00073     {
00074         return cellShape(*(cellModeller::lookup(0)), labelList(0));
00075     }
00076 }
00077 
00078 
00079 Foam::cellShape Foam::degenerateMatcher::match(const faceList& faces)
00080 {
00081     
00082 
00083     return match
00084     (
00085         faces, 
00086         labelList(faces.size(), 0),     
00087         0,                              
00088         labelList(cellMatcher::makeIdentity(faces.size()))  
00089                                                             
00090     );
00091 }
00092 
00093 
00094 Foam::cellShape Foam::degenerateMatcher::match(const cellShape& shape)
00095 {
00096     return match(shape.collapsedFaces());
00097 }
00098 
00099 
00100 Foam::cellShape Foam::degenerateMatcher::match
00101 (
00102     const primitiveMesh& mesh,
00103     const label cellI
00104 )
00105 {
00106     return match
00107     (
00108         mesh.faces(), 
00109         mesh.faceOwner(),
00110         cellI,
00111         mesh.cells()[cellI]
00112     );
00113 }
00114 
00115 
00116