From: Min Xu <minxu@sc...>  20050913 17:17:04

I am thinking to attach two system to one equationsystem like: EquationSystems equation_systems (mesh); // The real system for diffusion equation TransientLinearImplicitSystem & system = equation_systems.add_system<TransientLinearImplicitSystem>("Diffusion"); system.add_variable ("u", FIRST); // The dummy system for the coefficient alpha LinearImplicitSystem & dummy = equation_systems.add_system<LinearImplicitSystem>("Dummy"); system.add_variable ("alpha", FIRST); The procedure follows: (1) assign a coarse mesh and initialize the systems, mesh_psi = mesh_alpha = mesh0. keep a copy of the mesh as mesh_coarse. (2) solve the diffusion system and allow mesh_psi to be refined in its solution. obtain the update dalpha defined on mesh_psi_refined. (3) project dalpha to mesh_coarse which is the parent mesh of mesh_psi_refined. (4) Update alpha to alpha+dalpha, and refine the mesh for the dummy system to mesh_new_coarse. (5) Set mesh_psi=mesh_alpha=mesh_coarse=mesh_new_coarse and return to (2). My questions are: On Tuesday 13 September 2005 00:36, Roy Stogner wrote: > On Mon, 12 Sep 2005, Min Xu wrote: > > Can I just define a dummy EquationSystems to hold this parameter alpha > > and treat it as "solution", so all the operations on solution (mesh > > refinement and projection) can be used for alpha and then mapped to the > > diffusion equationSystems? Is there better ways to achieve it? > > This will work, but you'll have to have a separate mesh for each of > the two EquationSystems objects and you'll have to have some efficient > way of mapping between cells of one mesh and cells of the other. This > map could be two vectors, alpha_to_psi and psi_to_alpha, which each > are indexed by element ids from one mesh and return as data element > ids from the other. > > Unfortunately these ids are renumbered every time the mesh is changed. > So, after every EquationSystems::reinit() you'd need to regenerate > your map vectors from scratch, which could be an expensive process > unless you have a very coarse initial grid. Ideally the MeshData > class could be used to preserve enough data through refinement to make > this regeneration O(N), but like John I don't use MeshData myself. >  (1) If the two meshes are strictly that one is a refined version of the another (maybe refined multiple times), is there a relative cheap way to use alpha defined on the coarser mesh in the assemble routine for the equation system? Any example for coefficients defined on a mesh? (2) Can project_vector work in a reverse direction, i.e., map a vector defined on a finer mesh to a coarser mesh? If not, any suggestion to implement such a projection? Thanks! Min 