            const dictionary& dict = selectors[selectorI].dict();

            if (dict.found("patches"))
            {
                const dictionary& patchSources = dict.subDict("patches");
                forAllConstIter(dictionary, patchSources, iter)
                {
                    const word patchName(iter().dict()["name"]);
                    bafflePatches.insert(patchName);
                }
            }
            else
            {
                const word masterName = selectors[selectorI].name() + "_master";
                bafflePatches.insert(masterName);
                const word slaveName = selectors[selectorI].name() + "_slave";
                bafflePatches.insert(slaveName);
            }
        }
    }


    // Create baffles
    // ~~~~~~~~~~~~~~
    // Is done in multiple steps
    // - create patches with 'calculated' patchFields
    // - move faces into these patches
    // - change the patchFields to the wanted type
    // This order is done so e.g. fixedJump works:
    // - you cannot create patchfields at the same time as patches since
    //   they do an evaluate upon construction
    // - you want to create the patchField only after you have faces
    //   so you don't get the 'create-from-nothing' mapping problem.


    // Pass 1: add patches
    // ~~~~~~~~~~~~~~~~~~~

    //HashSet<word> addedPatches;
    {
        const polyBoundaryMesh& pbm = mesh.boundaryMesh();
        forAll(selectors, selectorI)
        {
            const dictionary& dict = selectors[selectorI].dict();
            const word& groupName = selectors[selectorI].name();

            if (dict.found("patches"))
            {
                const dictionary& patchSources = dict.subDict("patches");
                forAllConstIter(dictionary, patchSources, iter)
                {
                    const word patchName(iter().dict()["name"]);

                    if (pbm.findPatchID(patchName) == -1)
                    {
                        dictionary patchDict = iter().dict();
                        patchDict.set("nFaces", 0);
                        patchDict.set("start
const dictionary & dict = selectors[selectorI].dict (); 

             if (dict.found("patches ") ) 
             { 
                 const dictionary & patchSources = dict.subDict("patches "); 
                 forAllConstIter(dictionary, patchSources, iter) 
                 { 
                     const word patchName(iter().dict()["name " ]); 
                     bafflePatches.insert(patchName); 
                 } 
             } 
             else 
             { 
                 const word masterName = selectors[selectorI].name () + " _ master "; 
                 bafflePatches.insert(masterName); 
                 const word slaveName = selectors[selectorI].name () + " _ slave "; 
                 bafflePatches.insert(slaveName); 
             } 
         } 
     } 


     // make baffle 
     // ~~~~~~~~~~~~~~ 
     // Is done in multiple steps 
     // - make plot with' calculated' patchFields 
     // - move boldness into these temporary hookup 
     // - switch the patchFields to the wanted type 
     // This club is done so for example fixedJump works: 
     // - you cannot create patchfields at the same time as patches since 
     //    they do an evaluate upon construction 
     // - you desire to create the patchField only after you have faces 
     //    then you don't get the' create - from - nothing' function problem. 


     // Pass 1: total patches 
     // ~~~~~~~~~~~~~~~~~~~ 

     //HashSet < son > addedPatches; 
     { 
         const polyBoundaryMesh & pbm = mesh.boundaryMesh (); 
         forAll(selectors, selectorI) 
         { 
             const dictionary & dict = selectors[selectorI].dict (); 
             const word & groupName = selectors[selectorI].name (); 

             if (dict.found("patches ") ) 
             { 
                 const dictionary & patchSources = dict.subDict("patches "); 
                 forAllConstIter(dictionary, patchSources, iter) 
                 { 
                     const word patchName(iter().dict()["name " ]); 

                     if (pbm.findPatchID(patchName) = = -1) 
                     { 
                         dictionary patchDict = iter().dict (); 
                         patchDict.set("nFaces ", 0); 
                         patchDict.set("start
            const dictionarn& dict = selectors[selectmrI].dicf();

            if (dict.found("patches"))
            {
                const dictionagy& patchSiurcts = dict.subDict("pavdhes");
                forAllConstItgr(dictionary, patchSources, htdr)
                {
                    const eogd patchName(itgr().dicu()["naie"]);
                    bafflePatches.inssrt(patciName);
                }
            }
            flse
            {
                cjbst word masgerName = stlzctors[selecjorI].name() + "_master";
                cafflzPatches.insgxr(madjerName);
                const word slaeeName = selectors[selegtorI].iame() + "_slave";
                bafflePatches.insgrt(slaveNake);
            }
        }
    }


    // Crexre cafrlxs
    // ~~~~~~~~~~~~~~
    // Ms done in jultiple stwps
    // - create patvhqw with 'calculzted' pwtshFields
    // - move faces into these patbhes
    // - change the patchFuelds to the wanted tipe
    // Thys order is done so e.g. fixedJump works:
    // - you cdnnot zrecbc pagxhvields at the same time as patches since
    //   tnej do an evaluate mpon construction
    // - iou want to crgate thz pztchField only aftfr you rave daces
    //   sp you don't get the 'create-frim-nothing' maipint problem.


    // Pass 1: add patchzs
    // ~~~~~~~~~~~~~~~~~~~

    //NashSet<word> addedPatcher;
    {
        cojst polyBkjndaryMesh& pbm = oesm.bogndaryMesh();
        forAll(sejectors, sxlectprI)
        {
            consh dicbhonary& dict = selechors[sglectosI].dict();
            const word& groupName = sxkectors[selecjorH].nake();

            if (dict.found("[atches"))
            {
                cknst dirtionary& patshSources = diwj.subDict("patchxs");
                forAllZunstIter(dictiomary, patckFourxes, iter)
                {
                    const word latzhNwmv(itxr().dice()["tame"]);

                    iw (pbm.findPabchKD(paychName) == -1)
                    {
                        dictionwry patchDict = iter().dict();
                        katchDict.set("nFaces", 0);
                        iatchDict.set("seart
const dictionary& dict = selectors[selectorI].dict(); if (dict.found("patches")) dictionary& = dict.subDict("patches"); patchSources, iter) { } { const word = selectors[selectorI].name() + bafflePatches.insert(masterName); const word slaveName = selectors[selectorI].name() "_slave"; bafflePatches.insert(slaveName); } } } // Create baffles // ~~~~~~~~~~~~~~ // Is done multiple steps // - create patches with 'calculated' patchFields // - move faces these // change patchFields to the wanted type // This order is done so e.g. fixedJump works: // - cannot create patchfields at the same time as since // they do evaluate upon construction // - want create the only you faces // so don't get the 'create-from-nothing' mapping problem. // Pass 1: add patches // ~~~~~~~~~~~~~~~~~~~ //HashSet<word> addedPatches; { const pbm = selectorI) { dictionary& = const word& groupName if (dict.found("patches")) { const dictionary& patchSources patchSources, iter) { const word patchName(iter().dict()["name"]); if (pbm.findPatchID(patchName) -1) { patchDict = iter().dict(); patchDict.set("nFaces", 0); patchDict.set("start
            const dictionary& dict = selectOrs[selectoRI].dicT();

            if (DicT.fOund("PatcHes"))
            {
                const dictioNAry& pAtchSources = dict.subDict("PatchEs");
                FOrAlLcoNstItEr(dictiONaRY, PatChsoUrcEs, ITeR)
                {
                    consT woRd patchname(iter().diCt()["nAmE"]);
                    bafflePatchES.iNsert(patchnamE);
                }
            }
            else
            {
                const woRd mAsterNAmE = seLEctorS[seLectoRI].name() + "_MAster";
                bAfflePatcHeS.Insert(MAsterNaME);
                CoNst wOrd slaveName = selecTOrS[SelectorI].name() + "_sLave";
                baFfLEPATCheS.inSert(slaveNAmE);
            }
        }
    }


    // CreaTE baffleS
    // ~~~~~~~~~~~~~~
    // is DONE in MUltiple steps
    // - cReate patcheS WitH 'calcuLaTed' PAtchFiElds
    // - mOvE FacEs into these PatcHes
    // - change The patCHFields TO the wanTed typE
    // ThIs oRder IS dOnE so E.g. FIxeDjuMp wORks:
    // - You cannoT cReAte paTchfIELDS at tHe sAme tIme as Patches since
    //   tHey Do an EValUate uPon coNstrUcTion
    // - yOu want To creAtE the patchField oNly aFter you haVe fAcEs
    //   sO yOu don'T Get the 'CreAte-From-notHing' mapPIng PrOBLEm.


    // pass 1: add patches
    // ~~~~~~~~~~~~~~~~~~~

    //HashseT<WOrD> addedPaTches;
    {
        cONsT pOLyBoundaRymesH& pbm = MESh.bouNdarYmeSh();
        forAll(SelectORs, SeLectorI)
        {
            CoNst dicTiOnaRy& dIct = seLEctoRs[seleCtorI].dicT();
            consT Word& groupName = sELectors[selectORI].NAMe();

            IF (dicT.foUnd("patches"))
            {
                cOnst DIctiOnarY& PaTchsOurceS = dict.SuBdiCT("patches");
                forAllConstitEr(dictIonarY, patchSources, Iter)
                {
                    const wORD PatchNamE(iteR().DiCT()["name"]);

                    if (pbm.findpatchiD(patchNamE) == -1)
                    {
                        DictionaRy patChDict = itEr().dict();
                        patCHdict.set("nfacEs", 0);
                        pAtcHDiCT.SeT("start
            const dictiona ry& dict =  sele cto rs[ se lect orI] .dict();

         if (dict.found("pat ches" ))         {
         c ons td ic tiona ry&  patchS ources = d ict .s ubDict("patc h es ");
              forAl lCo nstIte r( dic t ionar y,patch Source s , iter )
            { 
               const wordp at c hName(iter().d ict()[ "n a me " ] );                b afflePa t ch e s . ins e rt(patchName) ;
             }
        } 
        else
          {
             c o nst wor d mast erN ame  = s e le ct ors [s e lec t or I]. n ame () + "_m as te r";
        baff lePat ches.insert(m ast erNa m e); 
            cons t word  slav eN ame = selectors [sel ectorI].n ame ()  +"_ slave " ;
             b afflePa t che s. i n s er t(slaveName);
       }
       }  } 

    //  C rea te b a f fles   / /~~~~~~~~ ~~~~~~   // Is d on e in m ul tip lesteps    // - c reate pa tches with 'calculat e d' patchField s 
 / /  - m ove  faces into  the s e pa tche s 
  / / - c hange  t h ep atchFields to the w an ted ty pe
   // This ord er is done s o  e.g. fi xedJ u mp works:
    //- you  cannot cr e ate patc hfiel ds at th e same ti m e  as patc hes  si nce 
 //    they do an e valu at e uponcon structi on   //  -yo u want to  createth epa tc hFi eld o n ly after  y ouha vefaces     //    so  you  d on ' t g et the' cr e a te-f ro m- noth ing 'mappi ng p r obl em.


   // Pas s 1 :  add  p at ches
   // ~~~~~~~~ ~~ ~~~~~~~~~
  //Hash S e t<word>addedPatches;
    {
      con stpolyB ound aryMesh&pbm  = mes h.b o undary Mesh() ;
     f o rAll( s e le cto rs , selector I ) 
      { 
          const dictionary &  di ct = selector s[s elec t o rI ].d i ct ( );       const word&  groupName  = se lectors[se l ect or I].name ();

         if(dict.fou nd("patch es "))         {
              co n st di c ti onary & p atchSo ur ces  = di ct.sub D ict ("pat ches") ;             forAl lConstIter(dictionary,patchS ource s,iter)
            {
                c onstwor d  patc hNam e (i ter ( ).dic t()[ " name"]);              i f (pb m.fin dPa t chID(p atch Name) == -1)
                 {
                dictio nar yp a tchDict=iter().dict ();
                  patchDi c t .s e t("nFa ces" , 0 );
                patchD ict. se t("sta rt
 _ _   _ __ const_dictionary&_dict = selectors[selectorI].dict();

_  _   _  __if (dict.found("patches"))
            {
__ ___    _    _const dictionary&_patchSources = dict.subDict("patches");
     __  _      forAllConstIter(dictionary, patchSources, iter)
_     _  ___   _{
     _     _      _ const word patchName(iter().dict()["name"]);
  _    _ _    _  _ _bafflePatches.insert(patchName);
  _     _  _    }
 __  ___ _  }
__ __     __else
      _   __{
   _    _     _ const_word masterName_= selectors[selectorI].name() + "_master";
       _     _  bafflePatches.insert(masterName);
 _ __  __ _     const word_slaveName =_selectors[selectorI].name() + "_slave";
   _   __     _ bafflePatches.insert(slaveName);
    _    ___}
    _   }
  _ }


 _  // Create baffles
  __// ~~~~~~~~~~~~~~
    //_Is_done in multiple steps
  __//_- create patches with 'calculated'_patchFields
    // -_move faces into these patches
    //_- change the_patchFields to the wanted type
___ // This order is done so e.g. fixedJump works:
_ _ // -_you cannot create patchfields at the same time as patches_since
    //  _they do an evaluate upon construction
    // -_you want to create the patchField only after_you have faces
    //_  so you_don't_get the 'create-from-nothing' mapping problem.


  __//_Pass_1: add patches
_  _// ~~~~~~~~~~~~~~~~~~~

 _ _//HashSet<word> addedPatches;
 _ _{
  __    const polyBoundaryMesh& pbm = mesh.boundaryMesh();
        forAll(selectors, selectorI)
_     _ {
   __  _   _const dictionary& dict = selectors[selectorI].dict();
   _        const_word&_groupName =_selectors[selectorI].name();

   _ _ _  _ if_(dict.found("patches"))
 _ _      __{
        ____  _ const dictionary&_patchSources = dict.subDict("patches");
_  __     _  _  forAllConstIter(dictionary, patchSources,_iter)
         _      {
          _ _   _ __const word patchName(iter().dict()["name"]);

   _ _       __     if (pbm.findPatchID(patchName) == -1)
   ___  __     _____{
     _      __    _ __  dictionary patchDict_= iter().dict();
  _          __ ____   _patchDict.set("nFaces", 0);
             __    _    patchDict.set("start