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

Merge_beast #122

Open
wants to merge 130 commits into
base: master
Choose a base branch
from
Open

Merge_beast #122

wants to merge 130 commits into from

Conversation

PaulOlyslager
Copy link
Contributor

  • added example for vppmchwt udsing composed operators
  • made it possible to redefine the geometry of a basis, this is necesarry to get the trace mesh into the basis.
  • added the posibility to use a general function as excitation
  • added dof_permutation for ndrefspace
  • corrected the ncross for rt and nd spaces.
  • added the possibility to construct general kernels (see composed operators, if other green functions are needed they can be added in a simple way (see implementation hh3dgreen))
    -Traces are taken automatically with a geometric argument.
    -Geometric support for traces added
    -made sauterschwab momintegrals independent of normal by using permute_vertices
  • added a quadfunction argument to assemble and a kwargs argument to pass argements to lowest level of assembly. This makes it possible to add quadstrat functions for diffeertn type of operators. Programs using the original form will not fail.
    -added linear combination of functionals
  • made it possible to set lhs to zero in equation
  • made the identity integrand more similar to the double integral integrands. (needed for composdoperator )
  • both test and trial cell are passed in local operator. This because in advance it is not known what the normals on both test and trial chart are.
  • made sure that sparsedict, densestorage and bandedstorage return exactly the same number
  • assembe_local_matched cannot be used for composed operators (see infinitely thin structures) (this needs to be wokred on further in the future)
  • added a zero element for the operator type, called ZeroOperator. multiplication with zero yields a zero operator.
  • added the possibility to write your operator in matrix form and to map it to a bilform
  • added the posibility to multiply a bilform with a diagonal matrix. to rescale the rows or colums in the matrix representaiton of this bilform.
  • replaced .vertices with verticeslist() because chart can be wrapped in tracechart or some other type of chart.
  • wrote function that assembly of equation can be done in two steps.
    -test included for composed operator.
    -corrected tests that use nxrt

PaulOlyslager and others added 30 commits September 7, 2023 11:30
test compare by taking limit (use two triangles)
a more general trace describtion is needed
implemented operators and trace, more general description needed
multi-trace approach
overwritten meshpoint to add normals
@@ -3,6 +3,7 @@ mutable struct BDM3DBasis{T,M,P} <: Space{T}
fns::Vector{Vector{Shape{T}}}
pos::Vector{P}
end
redefine_geometrie(basis::BDM3DBasis{T,M,P},geo::F) where {T,M,P,F}= BDM3DBasis{T,F,P}(geo,basis.fns,basis.pos)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, to add the trace mesh to already defined bases, because the infinitisimal translation of the test function is done in the assembly

@@ -150,7 +150,7 @@ function restrict(f::LagrangeRefSpace{T,1}, dom1, dom2) where T

# for each point of the new domain
for i in 1:D
v = dom2.vertices[i]
v = verticeslist(dom2)[i]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets rename to vertices. Users might make assumptions on the return data structure if we add list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

verticeslist returns a list of vertices, the function vertices in compsciencemshes exists but it does an extra hcat to create a matrix, is this more expensive?

@@ -56,14 +55,36 @@ function restrict(ϕ::NDRefSpace{T}, dom1, dom2) where T

u = carttobary(dom1, c)
x = neighborhood(dom1, u)

σ = sign(dot(normalize(tangents(dom2,1)×tangents(dom2,2)),normal(dom2)))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a function orientation for charts that returns +/-1 so that this potentially expensive and definitely ugly line can go.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totaly agree

end
end

return Q
end

const _vert_perms_nd = [
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you synchronise with upstram and make your fork use the more general way of dealing with vertex permutations?

TraceSimplex(simplex,direction::SVector)
simplex plus infinitesimal direction d, for each point p on the simplex, the trace is taken in the p-d direction
"""
struct TraceSimplex{T,U}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe ShiftedSimplex or TranslatedSimplex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In essence they are shifted over an infinitisimal distance, maybe add this property in the name? for example InfTransSimplex ?

@@ -35,7 +35,7 @@ end

function assemble!(biop::DyadicOp, tfs::Space, bfs::Space, store,
threading::Type{BEAST.Threading{:multi}};
quadstrat=defaultquadstrat(biop, tfs, bfs))
kwargs...)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want further in the assemble! tree to add an argument, even for assembling one specific operator, we dont have to change all assemble functions. I think in a tree it is a good practise to always pas the kwargs argument, enabling us to add extra arguments for specific functions. in the leaves a kwargs argument is needed to catch unused argements intended for other leaves

@@ -91,8 +91,8 @@ function LinearAlgebra.mul!(y::AbstractVecOrMat, solver::GMRESSolver, x::Abstrac
return y
end

LinearAlgebra.adjoint(A::GMRESSolver) = GMRESSolver(adjoint(A.linear_operator), A.maxiter, A.restart, A.abstol, A.reltol, A.verbose)
LinearAlgebra.transpose(A::GMRESSolver) = GMRESSolver(transpose(A.linear_operator), A.maxiter, A.restart, A.abstol, A.reltol, A.verbose)
LinearAlgebra.adjoint(A::GMRESSolver) = GMRESSolver(adjoint(A.linear_operator); A.left_preconditioner, A.maxiter, A.restart, A.abstol, A.reltol, A.verbose)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added some arguments because the function errored, I assume the function GMRESSolver was changed in the past

out.coeff *= a
return out
end
function *(a::Union{Matrix,SMatrix},b::BilForm)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too confusing I think. Users may expect pointwise multiplication.

end


struct ZeroBilForm end
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think even the zero bilinear form needs to specify its domain Hilbert spaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants