I used this code to read in a fine grid mesh and solution I had written to
an xda file, for comparison to the computed solution. I think you should be
able to adapt it or your purposes:
%%%%%%%%%%%%%%% Code starts %%%%%%%%%%%%%%%%%%%%%%%%%%
Mesh mesh_fine_primal (param.dimension);
EquationSystems equation_systems_fine_primal (mesh_fine_primal);
std::cout<<"Reading in fine mesh for primal comparisons"<<std::endl;
// We are comparing to a super fine reference solution, we declare a mesh
object and equation systems object for it
mesh_fine_primal.read(param.fine_mesh_file_primal);
mesh_fine_primal.print_info();
std::cout<<"Reading in super fine primal solution"<<std::endl;
// The stored solution
equation_systems_fine_primal.read(param.fine_mesh_soln_primal,
libMeshEnums::READ,
EquationSystems::READ_HEADER |
EquationSystems::READ_DATA |
EquationSystems::READ_ADDITIONAL_DATA);
equation_systems_fine_primal.print_info();
%%%%%%%%%%%%%%%%%%%%%%% Code ends %%%%%%%%%%%%%%%%%%%%%
You will read the solution into your equation_systems object, and then use
the usual interior_value and interior_gradient functions to access its
values at quadrature points for the assembly.
Thanks.
On Sun, Nov 30, 2014 at 4:25 PM, Kameeko Kiwi <[email protected]> wrote:
> Hello,
>
> Is there a way to read in the solution from one libMesh run into another?
> I'd like to linearize about the solution to problem A in order to solve
> another problem B; the solution to A currently stored in an .exo file
> (though other formats are possible...).
>
> My current thinking is to read the Exodus file using
> ExodusII_IO::copy_elemental_solution into an FEMSystem object, but then I
> can't seem to figure out how to store this information so that I may access
> the solution at any points while I'm constructing the residual and jacobian
> for problem B.
>
> Thanks,
> Harriet
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
--
Vikram Garg
Postdoctoral Associate
Predictive Engineering and Computational Science (PECOS)
The University of Texas at Austin
http://web.mit.edu/vikramvg/www/
http://www.runforindia.org/runners/vikramg
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users