Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

marker are not preserved by operatorLagrangeP1 #334

Closed
Doyeux opened this issue Apr 11, 2014 · 5 comments
Closed

marker are not preserved by operatorLagrangeP1 #334

Doyeux opened this issue Apr 11, 2014 · 5 comments
Milestone

Comments

@Doyeux
Copy link
Contributor

Doyeux commented Apr 11, 2014

When creating a P1 mesh with operatorLagrangeP1, the markers are not transmitted to the P1 mesh.
Could it be done ? The elements coming from a marked element could have the same marker (at least for marker1).

@vincentchabannes
Copy link
Member

It's strange, I looked quickly the code and normally it's done.

@Doyeux
Copy link
Contributor Author

Doyeux commented Apr 12, 2014

The following code reproduces the problem

#include <feel/feelfilters/exporter.hpp>
#include <feel/feeldiscr/pch.hpp>
#include <feel/feelfilters/unithypercube.hpp>
#include <feel/feeldiscr/operatorinterpolation.hpp>
#include <feel/feeldiscr/operatorlagrangep1.hpp>

using namespace Feel;
using namespace Feel::vf;

int main( int argc, char** argv )
{

  const int dim = 2;
  const int order = 2;

  Feel::Environment env( argc, argv );

  // mesh and high order space
  auto mesh = unitHypercube<dim>();
  auto Xh = Pch<order>(mesh);

  // operator lagrange P1 and associated space
  auto opLagP1 = lagrangeP1( Xh );
  auto XhP1 = Pch<1>( opLagP1->mesh() );

  // interpolation operator
  auto opIntHoToP1 = opInterpolation(_domainSpace = Xh, _imageSpace = XhP1, _type=InterpolationNonConforme(false) );
  auto opIntP1ToHo = opInterpolation(_domainSpace = XhP1, _imageSpace = Xh, _type=InterpolationNonConforme(false) );

  auto markerOrderN = Xh->element();
  auto markerP1 = XhP1->element();

  for (int i=1; i<5; ++i)
      {
          markerOrderN += vf::project(Xh, markedfaces(mesh, i),
                                      cst(i) );

          markerP1+= vf::project(XhP1, markedfaces(opLagP1->mesh(), i),
                                 cst(i) );

          double a = integrate( markedfaces(mesh, i), cst(1.) ).evaluate()(0,0);
          double b = integrate( markedfaces(opLagP1->mesh(), i), cst(1.) ).evaluate()(0,0);

          LOG(INFO)<< "integrate on the face number " << i << "\n"
                   << "on Pn mesh " << a << "\n"
                   << "on P1 mesh " << b << "\n";
      }

  auto expP1 = exporter(_mesh=opLagP1->mesh(), _name="markerP1_exp");
  expP1->step(0)->add("markerP1", markerP1);
  expP1->save();

  auto expPN = exporter(_mesh=mesh, _name="markerPN_exp");
  expPN->step(0)->add("markerOrderN", markerOrderN);
  expPN->save();

  return 0;
} 

@vincentchabannes
Copy link
Member

Ah, it's for the faces, not elements. I didn't well understand.
I will try to fix that.

vincentchabannes added a commit that referenced this issue Apr 14, 2014
@vincentchabannes
Copy link
Member

@Doyeux Now, it's work for me. You can close the issue if it's also OK for you

@Doyeux
Copy link
Contributor Author

Doyeux commented Apr 14, 2014

Ok, sounds good. I close the issue!

@Doyeux Doyeux closed this as completed Apr 14, 2014
@prudhomm prudhomm modified the milestone: v0.99.0 Aug 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants