Hello DuMuXers,

The grid geometry I want to create is attached as .jpg-file. I want to create a 
sub domain Omega1 as depicted. Here is my code from the coupled problem:

    void initializeGrid()
    {
        MDGrid& mdGrid = this->mdGrid();
        mdGrid.startSubDomainMarking();

        // subdivide grid into three subdomains
        ElementIterator eendit = mdGrid.template leafend<0>();
        for (ElementIterator elementIt = mdGrid.template leafbegin<0>();
             elementIt != eendit; ++elementIt)
        {
            // this is required for parallelization
            // checks if element is within a partition
            if (elementIt->partitionType() != Dune::InteriorEntity)
                continue;

            GlobalPosition globalPos = elementIt->geometry().center();

            if (globalPos[0] < interface12_)
            {
                if(globalPos[0] < anodeChannelGDLInterface_) // add everything
                    mdGrid.addToSubDomain(anode_,*elementIt);
                else
                    if(globalPos[1] < noPEMUpper_ && globalPos[1] > 
noPEMLower_) // add only the middle part
                        mdGrid.addToSubDomain(anode_,*elementIt);
            }
            else{
                if (globalPos[0] > interface23_)
                    mdGrid.addToSubDomain(cathode_,*elementIt);
                else
                {
                    if (globalPos[1] < noPEMUpper_ && globalPos[1] > 
noPEMLower_)
                        mdGrid.addToSubDomain(pem_,*elementIt);
                }
            }
        }
        mdGrid.preUpdateSubDomains();
        mdGrid.updateSubDomains();
        mdGrid.postUpdateSubDomains();

        gridinfo(this->sdGrid1());
        gridinfo(this->sdGrid2());
        gridinfo(this->sdGrid3());
    }

What I obtain is a rectangular Omega1 bounded by noPEMUpper_, noPEMLower_ and 
interface12_. The upper and lower part left of anodeChannelGDLInterface_ are 
not part of the grid. Anyone has a clue why this is not working?

Best regards

Georg Futter

--------------------------
German Aerospace Center (DLR)
Institute of Engineering Thermodynamics | Computational Electrochemistry | 
Pfaffenwaldring 38-40 | 70569 Stuttgart

Dipl.-Ing. Georg Futter | Ph.D. student
Telefon 0711/6862-8135 | [email protected]<mailto:[email protected]>
www.DLR.de<http://www.dlr.de/>


_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux

Reply via email to