This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* --------------------------------------------------------------------- | |
* | |
* Copyright (C) 2013 - 2020 by the deal.II authors | |
* | |
* This file is part of the deal.II library. | |
* | |
* The deal.II library is free software; you can use it, redistribute | |
* it, and/or modify it under the terms of the GNU Lesser General | |
* Public License as published by the Free Software Foundation; either | |
* version 2.1 of the License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
-Laplace(u) = 0 in [-1/2,+1/2] x [0,1] | |
u = (1/pi)*atan2(y,x) on boundary | |
Experiments to try: | |
0) Run test_adapt.py to see the effect of refining a triangle | |
1) Set nstep=5 and refine_type='uniform' and run the code. See the solution | |
using paraview. Copy conv.dat to conv1.dat | |
2) Set nstep=20 and refine_type='adaptive' and run the code. See the solution | |
using paraview. Copy conv.dat to conv2.dat | |
3) Start matlab and run the matlab code conv.m to see the convergence of L2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Solve | |
Laplace(u) = 0 in unit circle | |
with | |
u = -y on the boundary | |
We use Lagrange multipliers to implement dirichlet bc. The stress on the boundary is computed by a post-processing step in the end. The scheme is explained in | |
Gunzburger and Hou | |
TREATING INHOMOGENEOUS ESSENTIAL BOUNDARY CONDITIONS IN FINITE ELEMENT METHODS AND THE CALCULATION OF BOUNDARY STRESSES | |
SIAM J. Num. Anal., vol. 20, no. 2, pp. 390-424, April 1992 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <deal.II/base/quadrature_lib.h> | |
#include <deal.II/grid/tria.h> | |
#include <deal.II/grid/tria_iterator.h> | |
#include <deal.II/grid/tria_accessor.h> | |
#include <deal.II/grid/grid_generator.h> | |
#include <deal.II/grid/grid_in.h> | |
#include <deal.II/grid/grid_out.h> | |
#include <deal.II/grid/tria_boundary_lib.h> | |
#include <deal.II/grid/grid_generator.h> | |
#include <deal.II/grid/grid_tools.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __PROBLEM_H__ | |
#define __PROBLEM_H__ | |
namespace SWM | |
{ | |
using namespace dealii; | |
// Base class to define problem initial condition, etc. | |
template <int dim> |