Dear Libmesh developers and users,

I have this program that reads in a mesh with extra data values (in a
MeshData object associated with the mesh):

assert (dim == 3);
Mesh mesh(dim);
MeshData mesh_data(mesh);
mesh_data.activate();
mesh.read (mesh_file, &mesh_data);
mesh_data.read(mesh_file);

I've had no probem getting the values of the data in my assemble function:

DenseVector<Number> rho, eps;
 for ( ; el != end_el ; ++el)
    {
      num_el++;
      const Elem* elem = *el;
      Node* nn = elem->get_node(0);
      nn->print_info();

      dof_map.dof_indices (elem, dof_indices);
      fe->reinit (elem);

      Ke.resize (dof_indices.size(),
                 dof_indices.size());
      Fe.resize (dof_indices.size());

      rho.resize(qrule.n_points());
      eps.resize(qrule.n_points());

      for (unsigned int qp=0; qp<qrule.n_points(); qp++) {
        rho(qp) = eps(qp) = 0;

        printf("Inner loop2, qp = %d\n", qp);
        // 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)); //this line gets into trouble
when doing adaptive refinement, since mesh_data.has_data() returns
false
            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);
          }

......etc


HOWEVER, now that I'm trying to do adaptive refinement, it doesn't
look like these data values are refined. In fact,
mesh_data.has_data(elem->get_node(i)) returns false fo all elems in
the new mesh. I'm wondering if there's a straightforward way to
interpolate these data values that I use as the RHS to solve Poisson's
equations.

Any help will be deeply appreciated. Thanks!
Karen

P.S. I wonder if "insert_node_data ()" is somehow involved, although
with the new mesh having different numbers of nodes and elements as
the old mesh, I'm not sure how I would do this...

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to