|
From: | Konstantinos Poulios |
Subject: | Re: defining a field on the mesh dofs |
Date: | Thu, 2 Dec 2021 09:09:21 +0100 |
import numpy as np
from scipy.spatial import KDTree
file = open("pfield.txt", "r") # assuming it contains 4 columns: x,y,z,value
pdata = np.loadtxt(file,dtype=float)
tree = KDTree(pdata[:,0:3])dd,ii = tree.query(
mfp.basic_dof_nodes
())
md.add_fem_data("pc", mfp)
md.set_variable("pc", pdata[ii,3])
Dear all
I would like to define a non-constant pressure field on the mesh dofs
I would like to read the value from an ascii file
I am thinking of using the following python scripting
import numpy as np
file = open('pfield.txt', 'r') # 'r' = read
pfield = np.loadtxt(file,dtype=fload)
md.add_fem_data(“pc”,mfp)
md.set_variable("pc", pfield)
Will it be correct to use pc in building a week form?
Thank you
Regards
Anne-Cecile
The information contained in this e-mail message may be privileged, confidential, and/or protected from disclosure. This e-mail message may contain protected health information (PHI); dissemination of PHI should comply with applicable federal and state laws. If you are not the intended recipient, or an authorized representative of the intended recipient, any further review, disclosure, use, dissemination, distribution, or copying of this message or any attachment (or the information contained therein) is strictly prohibited. If you think that you have received this e-mail message in error, please notify the sender by return e-mail and delete all references to it and its contents from your systems.
[Prev in Thread] | Current Thread | [Next in Thread] |