Skip to content
Snippets Groups Projects
Commit b22ee5a3 authored by Denis Louis's avatar Denis Louis
Browse files

cleaning FEM code + comments

parent 4f0d41b0
No related branches found
No related tags found
No related merge requests found
......@@ -5,12 +5,12 @@ Ly = 2;
nx = 250;
ny = 100;
Point(1) = {0, 0, 0, 0.1}; //4th number is mesh density
Point(2) = {Lx, 0, 0, 0.2};
Point(3) = {Lx, Ly, 0, 0.2};
Point(4) = {0, Ly, 0, 0.1};
Point(5) = {Lx/2, 0, 0, 0.15};
Point(6) = {Lx/2, Ly, 0, 0.15};
Point(1) = {0, 0, 0, 0.05}; //4th number is mesh density
Point(2) = {Lx, 0, 0, 0.1};
Point(3) = {Lx, Ly, 0, 0.1};
Point(4) = {0, Ly, 0, 0.05};
Point(5) = {Lx/2, 0, 0, 0.075};
Point(6) = {Lx/2, Ly, 0, 0.075};
Line(1) = {1, 5};
Line(2) = {2, 5};
Line(3) = {3, 2};
......@@ -56,4 +56,4 @@ SetNumber("Boundary Conditions/fixed_node/uy",2);
Physical Curve("BEM_FEM_boundary", 10) = {1,2,3,4,5,6};
SetNumber("Non_linear_solver", 1);
\ No newline at end of file
SetNumber("Non_linear_solver", 0);
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -2,7 +2,7 @@
h = 1;
H = 10;
n = 48;
n = 16;
Point(1) = {0, 0, 0, 0.5};
Point(2) = {0.9*H, 0, 0, 0.5};
......
......@@ -4,6 +4,8 @@
#include <iostream>
#include <omp.h>
// this program implements a FEM solver, either linear or non-linear (by taking large displacements into account)
// to choose the linear solver, please add: SetNumber("Non_linear_solver",0); in the .geo file.
int main(int argc, char **argv)
{
if (argc < 2)
......@@ -28,18 +30,19 @@ int main(int argc, char **argv)
// determine if non linear solver must be set
bool nonLinearSolver = getNonLinearParameter();
// maps the elementTags to a corresponding electrostaticPressure (only useful for coupled solver)
std::map<int, double> electrostaticPressure;
int nbViews = 0;
int nbViews = 0; // number of views passed to the BEM solver (only useful for coupled solver)
if(nonLinearSolver)
{
std::map<int,std::pair<double,double>> boundaryDisplacementMap;
std::map<int,std::pair<double,double>> boundaryDisplacementMap; //(only useful for coupled solver)
int viewTagU = gmsh::view::add("u"); // à modifier plus tard
int viewTagF = gmsh::view::add("f");
int viewTagU = gmsh::view::add("u"); //viewtag of the displacement view
int viewTagF = gmsh::view::add("f"); //viewtag of the nodal forces view
solverFEMnonLinear(electrostaticPressure, boundaryDisplacementMap, nbViews, true, 1, viewTagU, viewTagF, false); //iteration randomly set to 1
solverFEMnonLinear(electrostaticPressure, boundaryDisplacementMap, nbViews, true, 1, viewTagU, viewTagF, false);
}
else
{
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment