Hi Bernd, Indeed the value anodeChannelGDLInterface_ was assigned after initialize Grid() was called. Problem solved.
Thanks alot Georg Von: Dumux [mailto:[email protected]] Im Auftrag von Bernd Flemisch Gesendet: Donnerstag, 28. Mai 2015 10:29 An: DuMuX User Forum Betreff: Re: [DuMuX] creation of multidomain grids Hi Georg, the piece of code looks fine to me. Assuming that it really is, the problem has to be outside: - the value of anodeChannelGDLInterface_ might be wrong - the mdGrid does not contain the upper and lower parts Kind regards Bernd On 05/28/2015 10:13 AM, [email protected]<mailto:[email protected]> wrote: 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]<mailto:[email protected]> https://listserv.uni-stuttgart.de/mailman/listinfo/dumux -- _______________________________________________________________ Bernd Flemisch phone: +49 711 685 69162 IWS, Universität Stuttgart fax: +49 711 685 60430 Pfaffenwaldring 61 email: [email protected]<mailto:[email protected]> D-70569 Stuttgart url: www.hydrosys.uni-stuttgart.de<http://www.hydrosys.uni-stuttgart.de> _______________________________________________________________
_______________________________________________ Dumux mailing list [email protected] https://listserv.uni-stuttgart.de/mailman/listinfo/dumux
