Skip to content
Snippets Groups Projects
Commit c47aa6e7 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

New parameter and initial-value files for curve shortening flow

parent 137e3fe9
No related branches found
No related tags found
No related merge requests found
Pipeline #
#############################################
# Grid parameters
#############################################
structuredGrid = true
lower = 0
upper = 1
elements = 1
# Number of grid levels
numLevels = 1
#############################################
# Solver parameters
#############################################
# Tolerance of the trust region solver
tolerance = 1e-12
# Max number of steps of the trust region solver
maxTrustRegionSteps = 0
# Initial trust-region radius
initialTrustRegionRadius = 1
# Number of multigrid iterations per trust-region step
numIt = 200
# Number of presmoothing steps
nu1 = 3
# Number of postsmoothing steps
nu2 = 3
# Number of coarse grid corrections
mu = 1
# Number of base solver iterations
baseIt = 100
# Tolerance of the multigrid solver
mgTolerance = 1e-10
# Tolerance of the base grid solver
baseTolerance = 1e-8
############################
# Problem specifications
############################
# Type of energy we are minimizing
energy = harmonic
# Inverse stereographic projection
initialIterate = initial-curve
import math
# Wiggly initial curve on the sphere in R^3 for a curve-shortening flow simulation
def f(x):
return [math.sin(0.5*math.pi*x[0]), math.cos(0.5*math.pi*x[0]), 0]
...@@ -152,10 +152,10 @@ int main (int argc, char *argv[]) try ...@@ -152,10 +152,10 @@ int main (int argc, char *argv[]) try
//////////////////////////// ////////////////////////////
// Read initial iterate into a PythonFunction // Read initial iterate into a PythonFunction
typedef VirtualDifferentiableFunction<FieldVector<double, dim>, TargetSpace::CoordinateType> FBase; typedef PythonFunction<FieldVector<double, dim>, TargetSpace::CoordinateType> FBase;
Python::Module module = Python::import(parameterSet.get<std::string>("initialIterate")); Python::Module module = Python::import(parameterSet.get<std::string>("initialIterate"));
auto pythonInitialIterate = module.get("fdf").toC<std::shared_ptr<FBase>>(); auto pythonInitialIterate = module.get("f").toC<std::shared_ptr<FBase>>();
std::vector<TargetSpace::CoordinateType> v; std::vector<TargetSpace::CoordinateType> v;
::Functions::interpolate(fufemFeBasis, v, *pythonInitialIterate); ::Functions::interpolate(fufemFeBasis, v, *pythonInitialIterate);
...@@ -219,7 +219,6 @@ int main (int argc, char *argv[]) try ...@@ -219,7 +219,6 @@ int main (int argc, char *argv[]) try
TypeTree::hybridTreePath(), TypeTree::hybridTreePath(),
xEmbedded); xEmbedded);
SubsamplingVTKWriter<GridType::LeafGridView> vtkWriter(grid->leafGridView(),0); SubsamplingVTKWriter<GridType::LeafGridView> vtkWriter(grid->leafGridView(),0);
vtkWriter.addVertexData(xFunction, VTK::FieldInfo("orientation", VTK::FieldInfo::Type::scalar, xEmbedded[0].size())); vtkWriter.addVertexData(xFunction, VTK::FieldInfo("orientation", VTK::FieldInfo::Type::scalar, xEmbedded[0].size()));
vtkWriter.write("gradientflow_result"); vtkWriter.write("gradientflow_result");
......
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