Description
Hi, I'm encountering issues related to random field mesh element values being evaluated exclusively at the centroid, where this value isn't representative for larger elements.
I've implemented a solution in my script like the one below: srf calculates the values at the nodes, and srf_centroid calculates it at the centroid. The result is then a weighted average (50% centroid, 50% element nodes). The problem is it's not very generalised for different distributions, for example a lognormal random field should use the geometric average rather than arithmetic average.
X1 = srf(seed=seed, store=False)[self.connectivity] # get field values at nodes
X2 = np.atleast_2d(srf_centroid(seed=seed, store=False)).T # get field values at centroids
X = np.hstack((X1, X2*X1.shape[1])).sum(1)/(X1.shape[1]*2) # get weighted average, with weights depending on the number of element nodes
I was wondering if something like this could be implemented in a more robust and generalised way in the package itself? It's fairly efficient in that a lot of elements share nodes. I imagine there wouldn't be much need for a point_volume input since there's already some variance reduction through local averaging occuring?