Commit 40635d32 authored by Praetorius, Simon's avatar Praetorius, Simon

new example added for parametrized surfaces

parent 10dac592
......@@ -7,4 +7,4 @@ Version: 0.1
Maintainer: simon.praetorius@tu-dresden.de
Depends: amdis
# Suggests: # add additional optional dune modules here
Suggests: dune-curvedsurfacegrid dune-foamgrid
mesh->macro file name: ./macro/sphere_macro.3d
mesh->global refinements: 3
surface->mesh: mesh
kappa: 1.0
surface->solver: bcgs
surface->solver->maxit: 10000
surface->solver->rtol: 1.e-6
surface->solver->info: 1
surface->solver->pc: ilu
surface->output[0]->format: vtk
surface->output[0]->filename: surface.2d
surface->output[0]->name: u
surface->output[0]->output directory: ./output
surface->output[0]->subdivision: 1
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
DIM: 2
DIM_OF_WORLD: 3
number of vertices: 8
number of elements: 12
vertex coordinates:
-1.0 1.0 -1.0
1.0 1.0 -1.0
1.0 1.0 1.0
-1.0 1.0 1.0
-1.0 -1.0 -1.0
1.0 -1.0 -1.0
1.0 -1.0 1.0
-1.0 -1.0 1.0
element vertices:
3 1 0
1 3 2
2 5 1
5 2 6
6 4 5
4 6 7
7 0 4
0 7 3
2 7 6
7 2 3
1 4 0
4 1 5
element boundaries:
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
......@@ -2,3 +2,8 @@ add_amdis_executable(
NAME "navier-stokes"
SOURCES navier-stokes.cpp
DIM 2 DOW 2)
add_amdis_executable(
NAME "surface"
SOURCES surface.cpp
DIM 2 DOW 3 ALBERTA_GRID)
......@@ -13,11 +13,12 @@ int main(int argc, char** argv)
Environment env(argc, argv);
// square structured grid with 4x4 initial elements
Dune::YaspGrid<2> grid({1.0, 1.0}, {4,4});
Dune::YaspGrid<2> hostGrid({1.0, 1.0}, {4,4});
AdaptiveGrid<Dune::YaspGrid<2>> grid(hostGrid);
// the Taylor-Hood basis
using namespace Dune::Functions::BasisFactory;
auto basis = makeBasis(grid.leafGridView(),
auto basis = makeGlobalBasis(grid.leafGridView(),
composite(
power<2>(lagrange<2>(), flatInterleaved()),
lagrange<1>(),
......@@ -99,4 +100,4 @@ int main(int argc, char** argv)
adapt.adapt();
return 0;
}
\ No newline at end of file
}
#include <amdis/AMDiS.hpp>
#include <amdis/LocalOperators.hpp>
#include <amdis/ProblemStat.hpp>
#include <dune/foamgrid/foamgrid.hh>
#include <dune/curvedsurfacegrid/curvedsurfacegrid.hh>
using namespace AMDiS;
// solve the equation -laplace(u) - k^2 u = f on the sphere
int main(int argc, char** argv)
{
Environment env(argc, argv);
using HostGrid = Dune::FoamGrid<2,3>;
auto hostGrid = MeshCreator<HostGrid>("mesh").create();
Dune::SphereCoordFunction sphere({0.0, 0.0, 0.0}, 1.0);
using Grid = Dune::CurvedSurfaceGrid<HostGrid, Dune::SphereCoordFunction, 2>;
auto grid = Grid{*hostGrid, sphere};
ProblemStat<LagrangeBasis<Grid,2>> prob("surface", grid);
prob.initialize(INIT_ALL);
auto opL = makeOperator(tag::gradtest_gradtrial{}, 1.0);
prob.addMatrixOperator(opL, 0, 0);
double kappa = Parameters::get<double>("kappa").value_or(1.0);
auto opM = makeOperator(tag::test_trial{}, -kappa*kappa);
prob.addMatrixOperator(opM, 0, 0);
auto opForce = makeOperator(tag::test{}, X(0) + X(1) + X(2));
prob.addVectorOperator(opForce, 0);
AdaptInfo adaptInfo("adapt");
prob.assemble(adaptInfo);
prob.solve(adaptInfo);
prob.writeFiles(adaptInfo);
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment