diff --git a/domainPatch.py b/domainPatch.py index f03d84ea0f05dc961623558a0390be6c669eeff3..41e8e6cfa7ed28a42b9741e098206ce4bd7c7725 100644 --- a/domainPatch.py +++ b/domainPatch.py @@ -69,6 +69,19 @@ class DomainPatch(df.SubDomain): ## Public Variables + self.isRichards #type bool set by input, see above + self.mesh #type df.Mesh set by input, see above + self.porosity #type float set by input, see above + self.viscosity #type tp.List[float] set by input, see above + self.has_interface #type tp.List[int] set by input, see above + self.L #type tp.List[float] set by input, see above + self.lambda_param #type tp.List[float] set by input, see above + self.function_space #type tp.Dict[str: df.Function] function space + used for wetting + and nonwetting + pressures. This is + set by + self._init_function_space() ## Public Methods @@ -100,9 +113,26 @@ class DomainPatch(df.SubDomain): self.L = L self.lambda_param = lambda_param + self._init_function_space() + # END constructor #### PUBLIC METHODS + + #### PRIVATE METHODS + def _init_function_space(self) -> None: + """ create function space for solution and trial functions + + Note that P1 FEM is hard coded here, as it is assumed in other methods + aswell. + """ + if self.isRichards: + self.function_space = {'wetting': df.FunctionSpace(self.mesh, 'P', 1)} + else: + self.function_space = {# + 'wetting' : df.FunctionSpace(self.mesh, 'P', 1),# + 'nonwetting' : df.FunctionSpace(self.mesh, 'P', 1)# + } # END is_Richards # END OF CLASS DomainPatch