InputNek5000.cpp 22.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
////////////////////////////////////////////////////////////////////////////////
//
//  File: InputNek5000.cpp
//
//  For more information, please see: http://www.nektar.info/
//
//  The MIT License
//
//  Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
//  Department of Aeronautics, Imperial College London (UK), and Scientific
//  Computing and Imaging Institute, University of Utah (USA).
//
//  License for the specific language governing rights and limitations under
//  Permission is hereby granted, free of charge, to any person obtaining a
//  copy of this software and associated documentation files (the "Software"),
//  to deal in the Software without restriction, including without limitation
//  the rights to use, copy, modify, merge, publish, distribute, sublicense,
//  and/or sell copies of the Software, and to permit persons to whom the
//  Software is furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included
//  in all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
//  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
//  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
//  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
//  DEALINGS IN THE SOFTWARE.
//
//  Description: Nektar file format converter.
//
////////////////////////////////////////////////////////////////////////////////

#include <map>
#include <vector>
#include <sstream>
#include <string>

#include <boost/algorithm/string.hpp>
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <NekMeshUtils/MeshElements/Element.h>

#include "InputNek5000.h"

using namespace std;
using namespace Nektar::NekMeshUtils;

namespace Nektar
{
namespace Utilities
{

ModuleKey InputNek5000::className = GetModuleFactory().RegisterCreatorFunction(
    ModuleKey(eInputModule, "rea5000"),
    InputNek5000::create, "Reads Nektar rea file.");

InputNek5000::InputNek5000(MeshSharedPtr m) : InputModule(m)
{
}

InputNek5000::~InputNek5000()
{
}

/**
68
 * @brief Processes Nek5000 file format.
69
 *
70
71
72
73
74
 * Nek5000 sessions are defined by rea files, and contain sections defining a
 * DNS simulation in a specific order. The converter only reads mesh
 * information, curve information if it exists and boundary information. The
 * format is similar to the rea format supported by #InputNek, but the layout is
 * sufficiently different that this module is separate.
75
76
77
78
79
80
81
82
83
 */
void InputNek5000::Process()
{
    // Open the file stream.
    OpenStream();

    string line, word;
    int nParam, nElements, nCurves;
    int i, j, k, nodeCounter = 0;
84
    int nComposite           = 1;
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
    LibUtilities::ShapeType elType;
    double vertex[8][3];

    m_mesh->m_expDim   = 0;
    m_mesh->m_spaceDim = 0;

    if (m_mesh->m_verbose)
    {
        cout << "InputNek5000: Start reading file..." << endl;
    }

    // -- Read in parameters.

    // Ignore first 3 lines. 4th line contains number of parameters.
    for (i = 0; i < 4; ++i)
    {
        getline(m_mshFile, line);
    }

    stringstream s(line);
    s >> nParam;

    for (i = 0; i < nParam; ++i)
    {
        string tmp1, tmp2;
        getline(m_mshFile, line);
        s.str(line);
        s >> tmp1 >> tmp2;
    }

    // -- Read in passive scalars (ignore)
    getline(m_mshFile, line);
    s.clear();
    s.str(line);
    s >> j;
    for (i = 0; i < j; ++i)
    {
        getline(m_mshFile, line);
    }

    // -- Read in logical switches (ignore)
    getline(m_mshFile, line);
    s.clear();
    s.str(line);
    s >> j;
    for (i = 0; i < j; ++i)
    {
        getline(m_mshFile, line);
    }

    // -- Read in mesh data.

    // First hunt for MESH tag
    bool foundMesh = false;
    while (!m_mshFile.eof())
    {
        getline(m_mshFile, line);
        if (line.find("MESH") != string::npos)
        {
            foundMesh = true;
            break;
        }
    }

    if (!foundMesh)
    {
        cerr << "Couldn't find MESH tag inside file." << endl;
        abort();
    }

    // Now read in number of elements and space dimension.
    getline(m_mshFile, line);
    s.clear();
    s.str(line);
    s >> nElements >> m_mesh->m_expDim;
    m_mesh->m_spaceDim = m_mesh->m_expDim;

    // Set up field names.
    m_mesh->m_fields.push_back("u");
    m_mesh->m_fields.push_back("v");
    if (m_mesh->m_spaceDim > 2)
    {
        m_mesh->m_fields.push_back("w");
    }
    m_mesh->m_fields.push_back("p");

    // Loop over and create elements.
    for (i = 0; i < nElements; ++i)
    {
        int nNodes;
        getline(m_mshFile, line);

        if (m_mesh->m_expDim == 2)
        {
            // - quad: 2 lines with x-coords, y-coords
            elType = LibUtilities::eQuadrilateral;
            nNodes = 4;
            for (j = 0; j < 2; ++j)
            {
                getline(m_mshFile, line);
                s.clear();
                s.str(line);
                for (k = 0; k < 4; ++k)
                {
                    s >> vertex[k][j];
                }
            }
        }
        else
        {
195
            // - hex: 3 lines with x/y/z-coords for base 4 nodes, then 3 more
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
            //   for upper 4 nodes
            elType = LibUtilities::eHexahedron;
            nNodes = 8;
            for (j = 0; j < 6; ++j)
            {
                getline(m_mshFile, line);
                s.clear();
                s.str(line);
                int offset = j > 2 ? 4 : 0;
                for (k = 0; k < 4; ++k)
                {
                    s >> vertex[offset + k][j % 3];
                }
            }
        }

212
213
214
        // Nek5000 meshes do not contain a unique list of nodes, so this block
        // constructs a unique set so that elements can be created with unique
        // nodes.
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
        vector<NodeSharedPtr> nodeList(nNodes);
        for (k = 0; k < nNodes; ++k)
        {
            nodeList[k] = boost::shared_ptr<Node>(
                new Node(
                    0, vertex[k][0], vertex[k][1], vertex[k][2]));
            pair<NodeSet::iterator, bool> testIns =
                m_mesh->m_vertexSet.insert(nodeList[k]);

            if (!testIns.second)
            {
                nodeList[k] = *(testIns.first);
            }
            else
            {
                nodeList[k]->m_id = nodeCounter++;
            }
        }

        vector<int> tags(1, 0);
        ElmtConfig conf(elType, 1, false, false);
        ElementSharedPtr E = GetElementFactory().CreateInstance(
            elType, conf, nodeList, tags);
        m_mesh->m_element[E->GetDim()].push_back(E);
    }

    // -- Read in curved data.
    getline(m_mshFile, line);
    if (line.find("CURVE") == string::npos)
    {
        cerr << "Cannot find curved side data." << endl;
        abort();
    }

    // Read number of curves.
    getline(m_mshFile, line);
    s.clear();
    s.str(line);
    s >> nCurves;

    Array<OneD, NekDouble> rp;
    int nq = 6;
    LibUtilities::PointsKey curveType(nq, LibUtilities::eGaussLobattoLegendre);
    LibUtilities::PointsManager()[curveType]->GetPoints(rp);

260
261
262
    // Map to reorder Nek5000 -> Nektar++ edge ordering. Nek5000 has the same
    // counter-clockwise ordering of edges/vertices; however the vertical
    // (i.e. t- or xi_3-direction) edges come last.
263
264
265
    int nek2nekedge[12] = {
        0, 1, 2, 3, 8, 9, 10, 11, 4, 5, 6, 7
    };
266
267
268
269

    // Map to reorder Nek5000 -> Nektar++ face ordering. Again we have the same
    // counter-clockwise ordering; however the 4 vertical faces of the hex are
    // first, followed by bottom face and then top face.
270
271
272
    int nek2nekface[6] = {
        1, 2, 3, 4, 0, 5
    };
273
274
275
276
277
278
279
280
281
282
283

    if (nCurves > 0)
    {
        for (i = 0; i < nCurves; ++i)
        {
            getline(m_mshFile, line);

            int elmt, side;
            NekDouble curveData[5];
            char curveType;

284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
            if (nElements < 1000)
            {
                // side in first 3 characters, elmt in next 3
                s.str(line.substr(0, 3));
                s >> side;
                s.clear();
                s.str(line.substr(3, 3));
                s >> elmt;
                line = line.substr(6);
            }
            else if (nElements < 1000000)
            {
                // side in first 2 characters, elmt in next 6
                s.str(line.substr(0, 2));
                s >> side;
                s.clear();
                s.str(line.substr(2, 6));
                s >> elmt;
                line = line.substr(8);
            }
            else
            {
                // side in first 2 characters, elmt in next 12
                s.str(line.substr(0, 2));
                s >> side;
                s.clear();
                s.str(line.substr(2, 12));
                s >> elmt;
                line = line.substr(14);
            }

            s.clear();
            s.str(line);

318
319
320
321
322
323
324
325
326
327
328
329
330
331
            for (j = 0; j < 5; ++j)
            {
                s >> curveData[j];
            }
            s >> curveType;

            elmt--;
            side--;
            side = nek2nekedge[side];

            switch (curveType)
            {
                case 'C':
                {
Dave Moxey's avatar
Dave Moxey committed
332
333
334
335
                    // Apply circular curvature to edges. Nek5000 assumes that
                    // the curvature should be imposed in x-y planes and has no
                    // z-dependence. The following code is adapted from Semtex
                    // (src/mesh.C)
336
337
338
339
340
341
342
343
344
345
346
347
348
349
                    NekDouble radius = curveData[0];
                    int convexity = radius < 0 ? -1 : 1;
                    radius = fabs(radius);

                    ElementSharedPtr el =
                        m_mesh->m_element[m_mesh->m_expDim][elmt];
                    EdgeSharedPtr edge = el->GetEdge(side);
                    edge->m_curveType = LibUtilities::eGaussLobattoLegendre;

                    // Assume 2D projection
                    Node P1(*(edge->m_n1)), P2(*(edge->m_n2));

                    if (fabs(P1.m_z - P2.m_z) > 1e-8)
                    {
Dave Moxey's avatar
Dave Moxey committed
350
                        cout << "warning: detected non x-y edge." << endl;
351
352
353
354
355
356
357
358
359
360
361
362
                    }
                    P1.m_z = P2.m_z = 0.0;

                    Node unitNormal, link, centroid, centre;
                    Node midpoint = (P1 + P2)*0.5, dx = P2 - P1;
                    NekDouble l = sqrt(dx.abs2()), sign = 0.0, semiangle = 0.0;

                    unitNormal.m_x = -dx.m_y / l;
                    unitNormal.m_y = dx.m_x / l;

                    if (2.0 * radius < l)
                    {
Dave Moxey's avatar
Dave Moxey committed
363
                        cerr << "failure" << endl;
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
                    }
                    else
                    {
                        semiangle = asin (0.5 * l / radius);
                    }

                    // Calculate element centroid
                    vector<NodeSharedPtr> elNodes = el->GetVertexList();
                    int nNodes = elNodes.size();

                    for (int i = 0; i < nNodes; ++i)
                    {
                        // Assume 2D projection
                        Node tmp(*elNodes[i]);
                        tmp.m_z = 0.0;
                        centroid += tmp;
                    }

                    centroid /= (NekDouble)nNodes;
                    link      = centroid - midpoint;
                    sign      = link.dot(unitNormal);
                    sign      = convexity * sign / fabs(sign);
386
387
                    centre    = midpoint + unitNormal * (sign * cos(semiangle) *
                                                         radius);
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415

                    NekDouble theta1, theta2, dtheta, phi;
                    theta1 = atan2 (P1.m_y - centre.m_y, P1.m_x - centre.m_x);
                    theta2 = atan2 (P2.m_y - centre.m_y, P2.m_x - centre.m_x);
                    dtheta = theta2 - theta1;

                    if (fabs(dtheta) > 2.0*semiangle + 1e-15)
                    {
                        dtheta += (dtheta < 0.0) ? 2.0*M_PI : -2.0*M_PI;
                    }

                    edge->m_edgeNodes.clear();

                    for (j = 1; j < nq-1; ++j) {
                        phi = theta1 + dtheta * 0.5 * (rp[j] + 1.0);
                        NodeSharedPtr asd(new Node(
                                              0,
                                              centre.m_x + radius * cos(phi),
                                              centre.m_y + radius * sin(phi),
                                              edge->m_n1->m_z));
                        edge->m_edgeNodes.push_back(asd);
                    }
                    break;
                }
                case 's':
                case 'S':
                case 'm':
                case 'M':
416
417
418
                    cerr << "Curve type '" << curveType << "' on side " << side
                         << " of element " << elmt << " is unsupported;"
                         << "will ignore." << endl;
419
420
                    break;
                default:
421
422
423
                    cerr << "Unknown curve type '" << curveType << "' on side "
                         << side << " of element " << elmt << "; will ignore."
                         << endl;
424
425
426
427
428
                    break;
            }
        }
    }

429
430
431
432
433
434
435
436
437
438
    // Read boundary conditions.
    getline(m_mshFile, line);
    getline(m_mshFile, line);
    if (line.find("BOUNDARY") == string::npos)
    {
        cerr << "Cannot find boundary conditions." << endl;
        abort();
    }

    int nSurfaces = 0;
439
    boost::unordered_set<pair<int, int> > periodicIn;
Dave Moxey's avatar
Dave Moxey committed
440
    int periodicInId = -1, periodicOutId = -1;
441

442
443
444
    // Boundary conditions: should be precisely nElements * nFaces lines to
    // read.
    int lineCnt = 0;
Dave Moxey's avatar
Dave Moxey committed
445
446
    int perIn = 0, perOut = 0;

447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
    while (m_mshFile.good())
    {
        getline(m_mshFile, line);

        // Found a new section. We don't support anything in the rea file beyond
        // this point so we'll just quit.
        if (line.find("*") != string::npos)
        {
            break;
        }

        ConditionSharedPtr c = MemoryManager<Condition>::AllocateSharedPtr();
        char bcType;
        int elmt, side;
        NekDouble data[5];

463
464
465
466
467
        // type in chars 0-3
        s.clear();
        s.str(line.substr(0, 4));
        s >> bcType;

468
469
470
471
472
473
474
        // Some lines have no boundary condition entries
        if (s.fail())
        {
            lineCnt++;
            continue;
        }

475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
        if (nElements < 1000)
        {
            // elmt in chars 4-6, side in next 3
            s.clear();
            s.str(line.substr(4, 3));
            s >> elmt;
            s.clear();
            s.str(line.substr(7, 3));
            s >> side;
            line = line.substr(10);
        }
        else if (nElements < 100000)
        {
            // elmt in chars 4-8, side in next 1
            s.clear();
            s.str(line.substr(4, 5));
            s >> elmt;
            s.clear();
            s.str(line.substr(9, 1));
            s >> side;
            line = line.substr(10);
        }
        else if (nElements < 1000000)
        {
            // elmt in chars 4-9, no side
            s.clear();
            s.str(line.substr(4, 6));
            s >> elmt;
            side = lineCnt % (2 * m_mesh->m_expDim);
            line = line.substr(9);
        }
        else
        {
            // elmt in chars 4-15, no side
            s.clear();
            s.str(line.substr(4, 12));
            s >> elmt;
            side = lineCnt % (2 * m_mesh->m_expDim);
            line = line.substr(15);
        }

        s.clear();
        s.str(line);

519
520
521
522
523
524
525
526
527
        for (i = 0; i < 5; ++i)
        {
            s >> data[i];
        }

        // Our ordering starts from 0, not 1.
        --elmt;
        --side;

528
529
530
        // Increment lines read
        lineCnt++;

531
        ElementSharedPtr el = m_mesh->m_element[m_mesh->m_spaceDim][elmt];
Dave Moxey's avatar
Dave Moxey committed
532
533

        std::string fields[] = { "u", "v", "w", "p" };
534
535
536
537
538
539
540
541
542
543
544
545

        switch (bcType)
        {
            case 'E':
                // Edge/face connectivity; ignore since we already have this, at
                // least for conformal meshes.
                continue;

            case 'W':
            {
                for (i = 0; i < m_mesh->m_fields.size() - 1; ++i)
                {
Dave Moxey's avatar
Dave Moxey committed
546
547
548
                    c->field.push_back(fields[i]);
                    c->value.push_back("0");
                    c->type.push_back(eDirichlet);
549
550
551
                }

                // Set high-order boundary condition for wall.
Dave Moxey's avatar
Dave Moxey committed
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
                c->field.push_back(fields[3]);
                c->value.push_back("0");
                c->type.push_back(eHOPCondition);
                break;
            }

            case 'P':
            {
                // Determine periodic element and face.
                int perElmt = (int)(data[0] + 0.5) - 1;
                int perFace = (int)(data[1] + 0.5) - 1;

                bool setup = false;
                if (periodicInId == -1)
                {
                    periodicInId = m_mesh->m_condition.size();
                    periodicOutId = m_mesh->m_condition.size()+1;
                    setup = true;
                }

Dave Moxey's avatar
Dave Moxey committed
572
573
574
575
                bool hasIn = periodicIn.find(make_pair(perElmt, perFace)) !=
                    periodicIn.end();

                if (hasIn)
Dave Moxey's avatar
Dave Moxey committed
576
577
                {
                    swap(periodicInId, periodicOutId);
Dave Moxey's avatar
Dave Moxey committed
578
                    perOut++;
Dave Moxey's avatar
Dave Moxey committed
579
580
581
582
                }
                else
                {
                    periodicIn.insert(make_pair(elmt, side));
Dave Moxey's avatar
Dave Moxey committed
583
                    perIn++;
Dave Moxey's avatar
Dave Moxey committed
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
                }

                std::string periodicInStr = "[" +
                    boost::lexical_cast<string>(periodicInId) + "]";
                std::string periodicOutStr = "[" +
                    boost::lexical_cast<string>(periodicOutId) + "]";

                for (i = 0; i < m_mesh->m_fields.size() - 1; ++i)
                {
                    c->field.push_back(fields[i]);
                    c->value.push_back(periodicOutStr);
                    c->type.push_back(ePeriodic);
                }

                c->field.push_back(fields[3]);
                c->value.push_back(periodicOutStr);
                c->type.push_back(ePeriodic);

                if (setup)
                {
                    ConditionSharedPtr c2 = MemoryManager<Condition>
                        ::AllocateSharedPtr();

                    c->m_composite.push_back(nComposite++);
                    c2->m_composite.push_back(nComposite++);

                    c2->field = c->field;
                    c2->type = c->type;
                    for (i = 0; i < c->type.size(); ++i)
                    {
                        c2->value.push_back(periodicInStr);
                    }

                    m_mesh->m_condition[periodicInId] = c;
                    m_mesh->m_condition[periodicOutId] = c2;
                }
Dave Moxey's avatar
Dave Moxey committed
620
621
622
623
624
625

                if (hasIn)
                {
                    swap(periodicInId, periodicOutId);
                }

626
627
                break;
            }
Dave Moxey's avatar
Dave Moxey committed
628
629
630

            default:
                continue;
631
632
633
634
635
        }

        int compTag, conditionId;
        ElementSharedPtr surfEl;

Dave Moxey's avatar
Dave Moxey committed
636
        // Create element for face (3D) or segment (2D).
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
        if (el->GetDim() == 3)
        {
            FaceSharedPtr f = el->GetFace(nek2nekface[side]);
            vector<NodeSharedPtr> nodeList;
            nodeList.insert(nodeList.begin(),
                            f->m_vertexList.begin(),
                            f->m_vertexList.end());

            vector<int> tags;
            ElmtConfig conf(
                LibUtilities::eQuadrilateral, 1, true, true, false,
                LibUtilities::eGaussLobattoLegendre);
            surfEl =
                GetElementFactory().CreateInstance(LibUtilities::eQuadrilateral,
                                                   conf, nodeList, tags);

            // Copy high-order surface information from edges.
            for (int i = 0; i < f->m_vertexList.size(); ++i)
            {
                surfEl->GetEdge(i)->m_edgeNodes = f->m_edgeList[i]->m_edgeNodes;
                surfEl->GetEdge(i)->m_curveType = f->m_edgeList[i]->m_curveType;
            }
        }
        else
        {
            EdgeSharedPtr f = el->GetEdge(side);

            vector<NodeSharedPtr> nodeList;
            nodeList.push_back(f->m_n1);
            nodeList.push_back(f->m_n2);

            vector<int> tags;

            ElmtConfig conf(
                LibUtilities::eSegment, 1, true, true, false,
                LibUtilities::eGaussLobattoLegendre);
            surfEl = GetElementFactory().CreateInstance(
                LibUtilities::eSegment, conf, nodeList, tags);
        }

        // Now attempt to find this boundary condition inside
        // m_mesh->condition. This is currently a linear search and should
        // probably be made faster!
        ConditionMap::iterator it;
        bool found = false;
        for (it = m_mesh->m_condition.begin(); it != m_mesh->m_condition.end();
             ++it)
        {
            if (c == it->second)
            {
                found = true;
                c = it->second;
                break;
            }
        }

        if (!found)
        {
            conditionId = m_mesh->m_condition.size();
            compTag = nComposite;
            c->m_composite.push_back(compTag);
            m_mesh->m_condition[conditionId] = c;
        }
        else
        {
            compTag = c->m_composite[0];
        }

        // Insert composite tag into element and insert element into
        // mesh.
        vector<int> existingTags = surfEl->GetTagList();

        existingTags.insert(existingTags.begin(), compTag);
        surfEl->SetTagList(existingTags);
        surfEl->SetId(nSurfaces);

        m_mesh->m_element[surfEl->GetDim()].push_back(surfEl);
        nSurfaces++;
    }

717
718
719
720
721
722
    if (lineCnt != nElements * (m_mesh->m_expDim * 2))
    {
        cerr << "Warning: boundary conditions may not have been correctly read "
             << "from Nek5000 input file." << endl;
    }

Dave Moxey's avatar
Dave Moxey committed
723
724
725
726
727
    if (perIn != perOut)
    {
        cerr << "Warning: number of periodic faces does not match." << endl;
    }

728
    m_mshFile.reset();
729
730
731
732
733
734

    // -- Process rest of mesh.
    ProcessEdges();
    ProcessFaces();
    ProcessElements();
    ProcessComposites();
Dave Moxey's avatar
Dave Moxey committed
735
736
737
738
739
740
741
742
743

    // -- Set periodic composites to not be reordered.
    if (periodicInId != -1)
    {
        m_mesh->m_composite[m_mesh->m_condition[periodicInId]
                            ->m_composite[0]]->m_reorder = false;
        m_mesh->m_composite[m_mesh->m_condition[periodicOutId]
                            ->m_composite[0]]->m_reorder = false;
    }
744
745
746
747
}

}
}