コード例 #1
0
ファイル: main.cpp プロジェクト: B-Rich/hermes-legacy
int main(int argc, char* argv[])
{
  // Load the mesh.
  Mesh mesh;
  H2DReader mloader;
  mloader.load("../square.mesh", &mesh);

  // Initial mesh refinement.
  for (int i = 0; i < INIT_REF_NUM; i++) mesh.refine_all_elements();

  HcurlSpace space(&mesh, P_INIT);

  // Visualize FE basis.
  VectorBaseView bview("VectorBaseView", new WinGeom(0, 0, 700, 600));

  // View::wait(H2DV_WAIT_KEYPRESS);

  bool success = true;

  if (success == true) {
    printf("Success!\n");
    return ERR_SUCCESS;
  }
  else {
    printf("Failure!\n");
    return ERR_FAILURE;
  }
}
コード例 #2
0
ファイル: main.cpp プロジェクト: B-Rich/hermes-legacy
int main(int argc, char* argv[])
{
  // Load the mesh.
  Mesh mesh;
  H2DReader mloader;
  mloader.load("../square.mesh", &mesh);

  // Initial mesh refinement.
  for (int i = 0; i < INIT_REF_NUM; i++) mesh.refine_all_elements();

  // Create an Hdiv space with default shapeset.
  // (BC types and essential BC values not relevant.)
  HdivSpace space(&mesh, P_INIT);

  // Visualise the FE basis.
  VectorBaseView bview("VectorBaseView", new WinGeom(0, 0, 700, 600));

  bool success = true;

  if (success == true) {
    printf("Success!\n");
    return ERR_SUCCESS;
  }
  else {
    printf("Failure!\n");
    return ERR_FAILURE;
  }
}
コード例 #3
0
ファイル: main.cpp プロジェクト: aurelioarranz/hermes
int main(int argc, char* argv[])
{
  // Load the mesh.
  Mesh mesh;
  H2DReader mloader;
  mloader.load("square.mesh", &mesh);

  // Perform uniform mesh refinements.
  for (int i=0; i<INIT_REF_NUM; i++) mesh.refine_all_elements();

  // Create an L2 space with default shapeset.
  L2Space space(&mesh, P_INIT);

  // View basis functions.
  BaseView bview("BaseView", 0, 0, 600, 500);

  // Assemble and solve the finite element problem.
  WeakForm wf_dummy;

  // Initialize the exact and projected solution.
  Solution sln;
  Solution sln_exact(&mesh, F);

  OGProjection::project_global(&space, &sln_exact, &sln, matrix_solver, HERMES_L2_NORM);

  // Visualize the solution.
  ScalarView view1("Projection", 610, 0, 600, 500);

  // It will "Exception: SegFault" if we do not use View::wait() or View::close(). 
  view1.close();

  bool success = true;

#define ERROR_SUCCESS                               0
#define ERROR_FAILURE                               -1
  if (success == true) {
    printf("Success!\n");
    return ERROR_SUCCESS;
  }
  else {
    printf("Failure!\n");
    return ERROR_FAILURE;
  }
}
コード例 #4
0
ファイル: main.cpp プロジェクト: FranzGrenvicht/hermes
int main(int argc, char* argv[])
{
  // Load the mesh.
  Mesh mesh;
  H2DReader mloader;
  mloader.load("square.mesh", &mesh);

  // Initial mesh refinement.
  for (int i = 0; i < INIT_REF_NUM; i++) mesh.refine_all_elements();

  // Create an Hcurl space with default shapeset.
  // (BC types and essential BC values not relevant.)
  HcurlSpace space(&mesh, NULL, NULL, P_INIT);

  // Visualize FE basis.
  VectorBaseView bview("VectorBaseView", new WinGeom(0, 0, 700, 600));
  bview.show(&space);

  // Wait for all views to be closed.
  View::wait();
  return 0;
}