Hi all, AFAIK firedrake-install does not work with anaconda python, because anaconda does not support virtualenv. Anaconda comes with conda environment manager instead. Perhaps an easy solution would be to optionally skip the creation of a virtualenv in the firedrake-install script. In this case, the installer assumes that the user has already created and activated an virtual environment, conda for instance, and just pip installs all the packages. - Tuomas
Hi all, is there a way to project a function defined on a fine mesh onto a functionspace with a coarse mesh? Look at the following exemplary setup: from firedrake import * import numpy as np mesh_fine = UnitSquareMesh(20,20) mesh_coarse = UnitSquareMesh(10,10) fs_fine = FunctionSpace(mesh_fine, 'CG', 1) fs_coarse = FunctionSpace(mesh_coarse, 'CG', 1) fun_fine = Function(fs_fine) fun_fine.dat.data[:] = np.random.normal(0, 1, len(fun_fine.dat.data)) fun_coarse = ? In this case, perhaps one could inherit overlapping nodes from fine to coarse mesh? All the best, Tobias
Hi Tobias, Yes but the meshes have to be part of a MeshHierarchy. Make mesh=UnitSquareMesh(10,10) And then mesh_hierarchy=MeshHierarchy(mesh,1). You can set mesh_coarse=mesh_hierarchy[0] and mesh_fine=mesh_hierarchy[1] and proceed like that. One can do inject(fun_fine, fun_coarse) to carry out the projection. Many Thanks, Ali Sent from my iPhone On 11 Jan 2017, at 12:52, Schwedes, Tobias <t.schwedes14@imperial.ac.uk<mailto:t.schwedes14@imperial.ac.uk>> wrote: Hi all, is there a way to project a function defined on a fine mesh onto a functionspace with a coarse mesh? Look at the following exemplary setup: from firedrake import * import numpy as np mesh_fine = UnitSquareMesh(20,20) mesh_coarse = UnitSquareMesh(10,10) fs_fine = FunctionSpace(mesh_fine, 'CG', 1) fs_coarse = FunctionSpace(mesh_coarse, 'CG', 1) fun_fine = Function(fs_fine) fun_fine.dat.data[:] = np.random.normal(0, 1, len(fun_fine.dat.data)) fun_coarse = ? In this case, perhaps one could inherit overlapping nodes from fine to coarse mesh? All the best, Tobias _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
Hi Alistair, yes thanks that's what was searching for! One just has to make sure to call the corresponding function space from the common hierarchy directly, as in: mesh=UnitSquareMesh(10,10) mesh_hierarchy=MeshHierarchy(mesh,1) fs_hierarchy = tuple([FunctionSpace(m, 'CG', 1) for m in mesh_hierarchy]) fun_fine = Function(fs_hierarchy[1]) fun_fine.dat.data[:] = np.random.normal(0, 1, len(fun_fine.dat.data)) fun_coarse = Function(fs_hierarchy[0]) inject(fun_fine, fun_coarse) Thanks again, Tobias ________________________________ Von: firedrake-bounces@imperial.ac.uk <firedrake-bounces@imperial.ac.uk> im Auftrag von Gregory, Alastair C A <a.gregory14@imperial.ac.uk> Gesendet: Mittwoch, 11. Januar 2017 13:04 An: firedrake Betreff: Re: [firedrake] project between mismatching meshes Hi Tobias, Yes but the meshes have to be part of a MeshHierarchy. Make mesh=UnitSquareMesh(10,10) And then mesh_hierarchy=MeshHierarchy(mesh,1). You can set mesh_coarse=mesh_hierarchy[0] and mesh_fine=mesh_hierarchy[1] and proceed like that. One can do inject(fun_fine, fun_coarse) to carry out the projection. Many Thanks, Ali Sent from my iPhone On 11 Jan 2017, at 12:52, Schwedes, Tobias <t.schwedes14@imperial.ac.uk<mailto:t.schwedes14@imperial.ac.uk>> wrote: Hi all, is there a way to project a function defined on a fine mesh onto a functionspace with a coarse mesh? Look at the following exemplary setup: from firedrake import * import numpy as np mesh_fine = UnitSquareMesh(20,20) mesh_coarse = UnitSquareMesh(10,10) fs_fine = FunctionSpace(mesh_fine, 'CG', 1) fs_coarse = FunctionSpace(mesh_coarse, 'CG', 1) fun_fine = Function(fs_fine) fun_fine.dat.data[:] = np.random.normal(0, 1, len(fun_fine.dat.data)) fun_coarse = ? In this case, perhaps one could inherit overlapping nodes from fine to coarse mesh? All the best, Tobias _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk<mailto:firedrake@imperial.ac.uk> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
participants (3)
- 
                
                Gregory, Alastair C A
- 
                
                Schwedes, Tobias
- 
                
                Tuomas Karna