ExplicitSystem has read_header() and read_parallel_data() functions,
but I'm not sure how the format is read in.
1) The functions above take "Xdr", but do they in fact take the ascii
form Xda? I tried looking at the Xdr class, but didn't see Xda
anywhere
2) I looked at the pdf file that explains the xda/xdr format, and they
do a good job explainig what a xda file looks like for a mesh. I'm
trying to read in some values of a field associated with the nodes for
use as the RHS of a LinearInplicitSystem, and I'm completely lost as
to how I would do that... For example, after I add some variables to
my ExplicitSystem:
equation_systems.add_system<ExplicitSystem> ("VarSystem");
equation_systems.get_system("VarSystem").add_variable("rhoV", FIRST);
equation_systems.get_system("VarSystem").add_variable("epsV", FIRST);
equation_systems.get_system("VarSystem").add_variable("inBrainv", FIRST);
How does the program know that the fields read in (assuming I know how
to do that) are associated with these variables?
3) How would I acutally put them into the RHS? When I was using MeshData, I had:
DenseVector<Number> rho, eps; (fields), and for each element, I
interpolate the field at quadrature points as follows:
for (unsigned int qp=0; qp<qrule.n_points(); qp++) {
rho(qp) = eps(qp) = 0;
// Note: the following code assumes linear element functions
to interpolate node data!
for (unsigned int i=0; i<phi.size(); i++) {
const std::vector<Number>& data = mesh_data.get_data(elem->get_node(i\
));
eps(qp) += data[1] * phi[i][qp];
rho(qp) += data[0] * phi[i][qp];
}
for (unsigned int i=0; i<phi.size(); i++)
{
for (unsigned int j=0; j<phi.size(); j++)
{
Ke(i,j) += JxW[qp]*(dphi[i][qp]*dphi[j][qp])*eps(qp);
}
Fe(i) += JxW[qp]*phi[i][qp]*rho(qp);
//printf("Ke(i) = %4.5f",Ke(i,i));
}
}
Not sure how I would achieve this function using ExplicitSystems...
Thanks,
Karen
>
> On Thu, Apr 7, 2011 at 3:39 PM, Karen Lee <[email protected]> wrote:
>> So my code with MeshData worked fine, but is not parallelizable. So
>> I'm trying to get some help of understanding how to use
>> ExplicitSystem.
>>
>> The only example I found from the examples that contain ExplicitSystem
>> is Example 2, and being a newbie to C++ does not help me understand
>> how I can give values to and access the variables from ExplicitSystem.
>>
>> 1. What is the format of the input to
>>
>> void read_parallel_data (Xdr &io, const bool read_additional_data)
>>
>> ? I would like to put my data for all the nodes in .xdr (or is it
>> .xda?) form. I have .xda files of meshes from previous runs where I
>> output the .xda files, but I'm not sure what the format of .xdr is. If
>> I have a single field of 5's (5 nodes), do I just do the following?
>>
>> 5
>> 1
>> 1
>> 1
>> 1
>> 1
>>
>> I have this code within a loop that goes through all the elements
>> from my previous program that uses MeshData, which I now wanna get rid
>> of using:
>>
>> for (unsigned int i=0; i<phi.size(); i++) {
>> const std::vector<Number>& data =
>> mesh_data.get_data(elem->get_node(i));
>> eps(qp) += data[1] * phi[i][qp];
>> rho(qp) += data[0] * phi[i][qp];
>> }
>>
>> I guess I just need a function that takes the place of
>> mesh_data.get_data(elem->get_node(i)) and takes the
>> "elem->get_node(i)"th item from the explicit system.(I would like to
>> have 3 of such variables, and just be able to access the ith element
>> of each of them.)
>>
>> Any help will be deeply appreciated.
>>
>> Thanks,
>> Karen
>>
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Roy Stogner <[email protected]>
>> Date: Wed, Mar 30, 2011 at 1:17 AM
>> Subject: Re: [Libmesh-users] Adaptive Mesh: how to update data values?
>> To: Karen Lee <[email protected]>
>> Cc: libmesh-users <[email protected]>
>>
>>
>>
>> On Wed, 30 Mar 2011, Karen Lee wrote:
>>
>>> HOWEVER, now that I'm trying to do adaptive refinement, it doesn't
>>> look like these data values are refined.
>>
>> Nope. The short answer: don't use MeshData. In this case, the
>> primary reason is that there's no good way for the library to know how
>> you want it interpreted and interpolated. Use a separate
>> ExplicitSystem with a finite element data field instead, and then the
>> data will be projected from mesh to mesh in as consistent a way as
>> possible.
>> ---
>> Roy
>>
>
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users