mesh-adaptation / goalie

Goal-oriented error estimation and mesh adaptation for finite element problems solved using Firedrake
Other
2 stars 0 forks source link

Get function_data by label for steady state case #146

Closed acse-ej321 closed 5 months ago

acse-ej321 commented 6 months ago

There was an issue when calling .extract(layout = 'label') as well as .extract(layout='subinterval') for a steady state case where the label variable included extra labels associated with the unsteady case.

https://github.com/pyroteus/goalie/blob/5d25f2be48d839675fd8435b89017cc86d5574ee/goalie/function_data.py#L88 https://github.com/pyroteus/goalie/blob/5d25f2be48d839675fd8435b89017cc86d5574ee/goalie/function_data.py#L108

Is there a unit test for both steady and unsteady cases?

ddundo commented 6 months ago

Maybe connected to this (?), in the point_discharge2d.py demo we need to define c_old even though it's never used.

acse-ej321 commented 6 months ago

@ddundo - I think this is more to do with how self.label is being populated in the FunctionData base class. For the steady state demo, you pass c_old to satisfy the general formatting for form(), but forward_old is not populated in the output SolutionData object. For the default .extract(layout='field') the label to build the dictionary is parsed from the self._label_dict by time_partition.field_types. Whereas, for .extract(layout='label') and .extract(layout='subinterval') it is directly parsed from self.label, which includes the combination of all labels for both steady and unsteady cases. When the SolutionData only contains steady state labels, there is an issue.

ddundo commented 6 months ago

Thanks! Makes sense :)

jwallwork23 commented 6 months ago

Sorry, I missed this. For some reason I wasn't watching 'all activity' on this repo so didn't get an alert when issues were opened. I've turned this on now so shouldn't be a problem in the future.