<jupyter_start><jupyter_text>Visualization of nodal and element patchesThis program visualizes differently sized patches around a certain node or element of a mesh. For this purpose, we simply mark the elements in different colors.<jupyter_code>import os
import sys
import numpy as np

%matplotlib notebook
import matplotlib.pyplot as plt
from visualize import drawPatches<jupyter_output><empty_output><jupyter_text>Element patches<jupyter_code>#coarse World
NWorldCoarse = np.array([11,11])
NpCoarse = np.prod(NWorldCoarse+1)

#ratio between Fine and Coarse
A = np.zeros(NWorldCoarse)
A[5][5] = 2
ABase = A.flatten()   

fig = plt.figure('1')                                                               
ax = fig.add_subplot(1,3,1)     
ax.set_title('$U_{0}(T)$')                                                 
drawPatches(NWorldCoarse, ABase, fig, ax, 11)

A[4][4:7] = 1.5
A[6][4:7] = 1.5
A[5,4:8:2] = 1.5
ABase = A.flatten()
ax = fig.add_subplot(1,3,2)  
ax.set_title('$U_{1}(T)$')                                                    
drawPatches(NWorldCoarse, ABase, fig, ax, 11)

A[3][3:8] = 1
A[7][3:8] = 1
A[3:7,3] = 1
A[3:7,7] = 1
ABase = A.flatten()
ax = fig.add_subplot(1,3,3) 
ax.set_title('$U_{2}(T)$')                                                     
drawPatches(NWorldCoarse, ABase, fig, ax, 11)

plt.show()<jupyter_output><empty_output><jupyter_text>Nodal patches<jupyter_code>#coarse World
NWorldCoarse = np.array([10,10])
NpCoarse = np.prod(NWorldCoarse+1)

#ratio between Fine and Coarse
A = np.zeros(NWorldCoarse)
A[4:6,4:6] = 2
ABase = A.flatten()   

fig = plt.figure('2')                                                               
ax = fig.add_subplot(1,3,1)     
ax.set_title('$\omega_{x,1}$')                                                 
drawPatches(NWorldCoarse, ABase,fig, ax, 10)

A[3][3:7] = 1.5
A[6][3:7] = 1.5
A[4:6,3] = 1.5
A[4:6,6] = 1.5
ABase = A.flatten()
ax = fig.add_subplot(1,3,2)  
ax.set_title('$\omega_{x,2}$')                                                    
drawPatches(NWorldCoarse, ABase,fig,ax, 10)

A[2][2:8] = 1
A[7][2:8] = 1
A[3:6,2] = 1
A[3:7,7] = 1
A[6][2] = 1
ABase = A.flatten()
ax = fig.add_subplot(1,3,3) 
ax.set_title('$\omega_{x,3}$')                                                     
drawPatches(NWorldCoarse, ABase,fig,ax, 10)

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15083084789092457, 'fraction_numerical': 0.054111631870472944, 'mean_word_length': 2.2747559274755926, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '558974', 'license': 'Apache-2.0', 'n_tokens_mistral': 937, 'n_tokens_neox': 899, 'n_words': 171, 'path': 'notebooks/Figure_3.2_PrintPatch.ipynb', 'repo_name': 'TiKeil/Masterthesis-LOD', 'size': '2347'}