Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Jigyasa Watwani
/
growth-pattern-control
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
43c1d1e3
authored
Dec 17, 2023
by
Jigyasa Watwani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small bug
parent
cb5f1fc5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
simple_extend_code/extend_for_diffusion.py
simple_extend_code/extend_for_diffusion.py
View file @
43c1d1e3
...
...
@@ -26,7 +26,7 @@ class diffusion(object):
self
.
c0
.
interpolate
(
df
.
Expression
(
'1 + 0.2 * cos(pi*x[0]/L)'
,
pi
=
np
.
pi
,
L
=
self
.
L
,
degree
=
1
))
else
:
self
.
c0
=
df
.
project
(
initc
,
self
.
function_space
)
#
print('c0=', self.c0.compute_vertex_values(self.mesh))
print
(
'c0='
,
self
.
c0
.
compute_vertex_values
(
self
.
mesh
))
def
setup_weak_forms
(
self
):
self
.
form
=
(
df
.
inner
((
self
.
c
-
self
.
c0
)
/
self
.
timestep
,
self
.
tc
)
...
...
@@ -38,7 +38,7 @@ class diffusion(object):
self
.
cFile
=
df
.
XDMFFile
(
'
%
s_concentration.xdmf'
%
self
.
timestamp
)
# time-variables
self
.
time
=
round
(
initTime
,
1
)
self
.
time
=
initTime
# print('time=', self.time)
maxsteps
=
round
(
self
.
maxtime
/
self
.
timestep
)
...
...
@@ -51,7 +51,7 @@ class diffusion(object):
for
steps
in
progressbar
.
progressbar
(
range
(
1
,
maxsteps
+
1
)):
self
.
time
+=
self
.
timestep
# print('time='
, self.time
)
# print('time='
self.time)
)
df
.
solve
(
self
.
form
==
0
,
self
.
c
)
self
.
cFile
.
write_checkpoint
(
self
.
c
,
'concentration'
,
self
.
time
,
append
=
True
)
# print('c=', self.c.compute_vertex_values(self.mesh))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment