Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.0.1] Wrong stress projection to points #94

Closed
6 tasks done
adtzlr opened this issue Oct 23, 2021 · 10 comments · Fixed by #107
Closed
6 tasks done

[v1.0.1] Wrong stress projection to points #94

adtzlr opened this issue Oct 23, 2021 · 10 comments · Fixed by #107
Labels
bug Something isn't working

Comments

@adtzlr
Copy link
Owner

adtzlr commented Oct 23, 2021

Quadrature points are indexed differently compared to the cell connectivity (due to the usage of quadpy). Thus, stress projection delivers wrong results.

A collection of tasks:

  • For linear quadratures the point ordering should be permuted in order to match cell ordering.
  • add a tools.project function for the stress projection to mesh-points (basically the code-snippet above)
  • argument to average results
  • add tools.project() to Getting Started Example (see tests)
  • check axisymmetric stress result
  • add permute for Gauss-Legendre order=2 dim=3
@adtzlr adtzlr added the bug Something isn't working label Oct 23, 2021
@adtzlr adtzlr changed the title Wrong stress projection to points [v1.0.1] Wrong stress projection to points Oct 23, 2021
@adtzlr
Copy link
Owner Author

adtzlr commented Oct 27, 2021

Gauss-Legendre points and weights are now calculated by numpy (#96). Two improvements should be made:

  • check if cell_type is Quad or Hexahedron, else raise NotImplementError
  • for linear quadratures the point ordering should be permuted in order to match cell ordering.

The first point is probably not a good idea because this also works for higher order elements if a permuted quadrature is applied,

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 27, 2021

permutations are

  • Quad permute = [0, 1, 3, 2]
  • Hexahedron permute = [0, 1, 3, 2, 4, 5, 7, 6]

set them as default for order=1 and dim=2 or 3

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 27, 2021

Fixed for line, quad and hexahedron by #97 . For all other types, projection is still wrong. Probably add a warning or something else.

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 28, 2021

Another method is to use discontinous stress fields. This involves a disconnected mesh (see #101 and #102 ) as well as an inverse quadrature rule (see #103 and #104). Further work has to be done on modified regions, fields.

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 28, 2021

There was a typo in tovoigt which affected all versions <= 1.0.1. fixed; see #105 and #106

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 28, 2021

Another method is to use discontinous stress fields. This involves a disconnected mesh (see #101 and #102 ) as well as an inverse quadrature rule (see #103 and #104). Further work has to be done on modified regions, fields.

this code does the job (getting started example):

# ...
from felupe.math import dot, det, transpose, tovoigt

s = dot(P(F), transpose(F)) / det(F)

s2 = tovoigt(s).T.reshape(-1, 6)
m2 = mesh.as_discontinous()
q2 = quadrature.inv()
r2 = felupe.Region(m2, element, q2, grad=False)
f2 = felupe.Field(r2, dim=6, values=s2)

cauchy2 = f2.interpolate().T.reshape(-1, 6)

v2 = displacement.values[mesh.cells].reshape(-1, 3)
u2 = felupe.Field(r2, dim=3, values=v2)

felupe.tools.save(
    r2,
    u2,
    filename="result_with_cauchy_dg.vtk",
    point_data={"CauchyStress": cauchy2},
)

image

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 28, 2021

and this is the result from tools.topoints() (stress values translated from quadrature to mesh points; averaged), same colormap as above.

image

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 28, 2021

What is missing:

  • add a tools.project function for the stress projection to mesh-points (basically the code-snippet above)
  • argument to average results
  • check how to handle mixed field problems

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 29, 2021

  • add tools.project() to Getting Started Example (see tests)

@adtzlr
Copy link
Owner Author

adtzlr commented Oct 30, 2021

What about axisymmetric analyses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant