Comments (2)
To update, A = max_value(small_number, A)
is not sufficient to fix this--it seems like it will put a floor on nodal values, but the function overall can take negative values at intermediate points (although maybe that is less of an issue depending on the function space of the velocity).
MWE follows--in this one, the problem is solved for vertical degree greater than 4, but that is not true in the general case.
import numpy as np
import icepack
from scipy.interpolate import RegularGridInterpolator
from matplotlib import pyplot as plt
res = 250
Lx = 1000
nx = Lx // res
mesh1d = firedrake.IntervalMesh(nx, Lx)
mesh = firedrake.ExtrudedMesh(mesh1d, layers=1)
x, ΞΆ = firedrake.SpatialCoordinate(mesh)
QT = firedrake.FunctionSpace(mesh, "CG", 2, vfamily="CG", vdegree=4)
meshT = QT.mesh()
element = QT.ufl_element()
MV = firedrake.VectorFunctionSpace(meshT, element)
coordsT = firedrake.interpolate(meshT.coordinates, MV).dat.data_ro[:]
T = firedrake.Function(QT)
z_T = np.linspace(0, 1, 101)
x_T = np.array([-1, Lx + 1])
T_z = 240.0 + (z_T - 0.66) ** 2.0 * 74.0
T_arr = np.repeat(T_z, 2).reshape((101, 2))
T.dat.data[:] = RegularGridInterpolator((x_T, z_T), T_arr.T)(coordsT)
cmT = firedrake.tripcolor(T, num_sample_points=100)
plt.colorbar(cmT, label='T')
A = firedrake.project(firedrake.max_value(icepack.rate_factor(T), 1.0e-8), QT)
cmA = firedrake.tripcolor(A, num_sample_points=100, vmin=-5, vmax=5, cmap='bwr')
plt.colorbar(cmA, label='A')
plt.show()
from icepack.
Thanks for catching this! I suspect the problem is happening because the temperature crosses the slope break at -10C. That could certainly cause the interpolated or projected fluidity field to do something wrong. We might be able to work around this by interpolating with Bernstein polynomials. I'll see what I can figure out and get back to you.
I've run into similar (but not as severe) problems before and it has me wondering if I should implement a 2- or multi-layer model. Clearly using a single layer and high-degree polynomials can cause problems like what you're seeing or other ringing artifacts.
from icepack.
Related Issues (20)
- No changes when running diagnostic_solve HOT 3
- Parallelism in icepack and Firedrake HOT 3
- flush needed to output "ICEPACK COMPLETE" on OSX gnu compiler HOT 1
- Questions about the exact equation in the Synthetic ice stream (xy) case HOT 1
- Passing rate factor calculated from temperature back into 2D flow solver HOT 2
- Managing data interpolation onto extruded meshes HOT 3
- pip3 fails to install ROL HOT 5
- Unexpected differences with Hybrid model compared to Elmer/Ice with Cuffey and Paterson A HOT 8
- Zero regularization in 05-ice-shelf-inverse tutorial HOT 3
- Evaluating velocities at depth with the hybrid model HOT 4
- Error with multi-parameter optimization
- more specific errors
- Error when running Lid Driven Cavity demo HOT 3
- update to using new version of pygmsh HOT 2
- rate_factor calculated using temperature output of HeatTransportSolver HOT 3
- import fails without ROL HOT 2
- Interpolating raster data onto 3D mesh
- Functions for surface/bed value extraction HOT 2
- Requirements not installed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icepack.