-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add VTX Temperature Export #950
base: fenicsx
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Kaelyn, again very much needed. Can you update your branch with fenicsx
?
git fetch upstream
git merge upstream/main
git push
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1) | ||
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why create a unit square mesh everytime??? what if it's a 1D simulation?
You can use the mesh of the simulation directly:
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1) | |
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1)) | |
V = dolfinx.fem.FunctionSpace(self.mesh, ("CG", 1)) |
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1) | ||
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1)) | ||
temperature_field = dolfinx.fem.Function(V) | ||
temperature_field.interpolate(lambda x: np.full(x.shape[1], self.temperature_fenics)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why x.shape[1]
?
@@ -786,6 +805,8 @@ def update_time_dependent_values(self): | |||
if source.temperature_dependent: | |||
source.update(t=t) | |||
|
|||
surface_temp_processed = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
else: | ||
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 1, 1) | ||
V = dolfinx.fem.FunctionSpace(mesh, ("CG", 1)) | ||
temperature_field = dolfinx.fem.Function(V) | ||
temperature_field.interpolate(lambda x: np.full(x.shape[1], self.temperature_fenics)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand that this handles the case where self.temperature_fenics
is a fem.Constant
. What if this constant is updated in time? Then the newly created fem.Function
will not be updated, correct? can we test this?
If that's the case, we probably need to add something to post_processing
to update it in time
Proposed changes
Add VTX Temperature Export for HydrogenTransportProblem Class.
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...