Draft
Conversation
| self.cov_name = cov_name # name of covariance function to use | ||
| self.cov = getattr(self, "cov_" + cov_name) # select the right function | ||
| self.mean = mean # mean of random field | ||
| # self.rho = rho # correlation length |
Collaborator
Author
There was a problem hiding this comment.
There should be a way of indicate the dimensionality of the GRF
| return str(self) | ||
|
|
||
| def cov_exp(self, r): | ||
| """ |
Collaborator
Author
There was a problem hiding this comment.
Would it be more convenient to use scikit-learn native kernels instead of implementing ours?
| return self.sigma2 * np.exp(-1 / self.rho * r) | ||
|
|
||
| def cov_squared_exp(self, r1, r2): | ||
| """ |
Collaborator
Author
There was a problem hiding this comment.
This should be either available for 1-2-3D or accept the dimension as a parameter
| self.pv_nugrf_file = Path(pv_path) / (pv_name + "nugrf.xdmf") | ||
|
|
||
| def setup(self) -> None: | ||
| self.field_function_space = df.fem.FunctionSpace(self.experiment.mesh, ("CG", 1)) |
Collaborator
Author
There was a problem hiding this comment.
Is the degree 1 compulsory or should it accept any?
src/fenicsxconcrete/finite_element_problem/linear_elasticity_grf.py
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I needed the Gaussian Random Field implementation for my project, so I generated some minimum working code translated from @div-tyg implementation. Currently only 2D GRFs for E and nu in a linear elastic problem are possible, as some parts of the code need work to properly handle any case. It supposes that #108 has been implemented, as I needed it for my use cases. I make some comments on things that I noticed that should be adapted. Additionally I did not prepare any new tests or really considered where the GRF generator should be located, this is supposed to be just a starting point for the final implementation.