From: Tobias M. <tob...@un...> - 2021-05-12 21:57:56
|
On 5/12/21 11:41 PM, John Peterson wrote: > > > On Wed, May 12, 2021 at 4:25 PM Tobias Moehle > <tob...@un... <mailto:tob...@un...>> > wrote: > > Dear all, > > I hope that someone has experience or some good ideas to help me > out: I > am using a setup where the finite element basis is augmented by a > function which contains the most rapidly changing features of the > solution to allow for a considerably coarser grid. > > However, when it comes to printing of the solution, I am stuck: > - In best case, I'd like to use a refined mesh for printing. To > represent the solution reasonably good, I have tried to copy the mesh > into another one which I refine. My initial idea was to use a child > class to MeshFunction to project the original solution with the > augmentation function onto the finer grid; but since the > "MeshFunction::operator()" is not virtual, one cannot overload it. > > > It looks like those operator() functions aren't explicitly marked > virtual, but they definitely are! (Also, they are marked "override", > which is another clue that they are virtual.) So your approach of > subclassing MeshFunction sounds like a reasonable one to me... I will > push a commit adding the virtual keyword where it's missing. > Oh, that sounds very good! I actually had the impression that it is rather a case as discussed here: https://stackoverflow.com/questions/21075922/function-overriding-in-c-works-without-virtual/21076030#21076030 just that the base-class will be called because here indirection is used!? Than I will follow this route and hopefully also get the refinement-part going. Many thanks for the fast answer! > -- > John |