diff options
author | eug-vs <eugene@eug-vs.xyz> | 2022-05-19 04:57:52 +0400 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2022-05-19 04:57:52 +0400 |
commit | e031b6708ce491976e28d76e5ea81c3ea0c92bed (patch) | |
tree | 0e440bcf72c351d0d4191534385ade69b5019020 | |
parent | 9f6331b437f32ae9422a190aad27bb1fc92f9bfc (diff) | |
download | CFD-SIMPLE-e031b6708ce491976e28d76e5ea81c3ea0c92bed.tar.gz |
feat: provide default density when plotting
-rw-r--r-- | src/simple.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/simple.py b/src/simple.py index 524e6fb..5ffe690 100644 --- a/src/simple.py +++ b/src/simple.py @@ -174,7 +174,7 @@ class SIMPLE: def avg_error(self): return np.absolute(self.b).sum() - def plot(self, normalize=False, density=1): + def plot(self, normalize=False, density=False): if self.patch: self.patch.remove() if self.colorbar: @@ -194,6 +194,8 @@ class SIMPLE: u = u / factor v = v / factor + density = density or int((max(self.domain_size) / self.step) / 40) + self.plt = plt.quiver( self.x[::density, ::density], self.y[::density, ::density], |