Comments (7)
I don't think it makes sense for QuadratureSpace
to have a vdim
. It's common to need many different vdim
quantities at the same quadrature points. For example, you might have matrices, vectors, and scalars all living at the same quadrature points — it's convenient for all of these to share the same QuadratureSpace
. The main purpose for QuadratureSpace
is to associate to every element in the mesh a quadrature rule. The vdim
of the fields is orthogonal to this concept.
While some of the same reasoning also applied to FiniteElementSpace
, that case is also a little bit different (it makes sense for the space to have vdim
as part of the space so you can easily create operators with the correct dimensions, etc.).
from mfem.
Both QuadratureFunction
and GridFunction
have access to the vdim
-- isn't that sufficient? Can you elaborate how the current state "prevents a general interface"?
I intentionally did not include vdim
in the QuadratureSpace
-- that way QuadratureFunction
s with different vdim
can reuse the same QuadratureSpace
. Changing this for FinitelElementSpace
and GridFunction
will break backward compatibility. Maybe something to consider for v5.0.
from mfem.
One option that will be backward compatible is to introduce VectorQuadratureSpace
-- it will contain a pointer to QuadratureSpace
and variable vdim
. Then we can add convenience constructors and other methods in QuadratureFunction
that take VectorQuadratureSpace
instead of QuadratureSpace
and vdim
. This way QuadratureSpace
can still be reused for different vdim
and we have one object that combines QuadratureSpace
and vdim
.
from mfem.
One option that will be backward compatible is to introduce
VectorQuadratureSpace
-- it will contain a pointer toQuadratureSpace
and variablevdim
. Then we can add convenience constructors and other methods inQuadratureFunction
that takeVectorQuadratureSpace
instead ofQuadratureSpace
andvdim
. This wayQuadratureSpace
can still be reused for differentvdim
and we have one object that combinesQuadratureSpace
andvdim
.
This would feel more confusing to me. We don't have a "VectorFunctionSpace" anywhere else.
Changing this for FinitelElementSpace and GridFunction will break backward compatibility. Maybe something to consider for v5.0.
I was thinking to change QuadratureSpace
, not the other spaces.
Both QuadratureFunction and GridFunction have access to the vdim -- isn't that sufficient? Can you elaborate how the current state "prevents a general interface"?
When I create an interface based on spaces, e.g. using std::variant
all other spaces can access the vdim
.
Here's a specific example
int GetVDim(const FieldDescriptor &f)
{
return std::visit([](auto && arg)
{
using T = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<T, const FiniteElementSpace *>)
{
return arg->GetVDim();
}
else if constexpr (std::is_same_v<T, const ParFiniteElementSpace *>)
{
return arg->GetVDim();
}
else if constexpr (std::is_same_v<T, const QuadratureSpace *>)
{
// return arg->GetVDim();
return 1;
}
else
{
static_assert(always_false<T>, "can't use GetVDim on type");
}
}, f.data);
}
from mfem.
Changing QuadratureSpace
to have vdim
is not going to be backward compatible.
VectorQuadratureSpace
is one option for the name -- we can call it something else. If you just don't like having this additional class, then I don't know -- do you have any other ideas?
By the way, we already have multiple "QuadratureSpace" classes: one base class,QuadratureSpaceBase
, and two derived classes: QuadratureSpace
and FaceQuadratureSpace
. We probably want a class combining QuadratureSpaceBase
pointer/reference with vdim
.
Another option will be if you can change your GetVDim()
function to take {Grid,ParGrid,Quadrature}Function
as input argument.
from mfem.
Another option will be if you can change your
GetVDim()
function to take{Grid,ParGrid,Quadrature}Function
as input argument.
That's what I tried to get rid of because it communicates wrong semantics in my interface. It could make the impression that data from these is being used whereas it only serves as a description for dimensions.
from mfem.
If we were to re-design the FiniteElementSpace
-- I'd probably split it into two classes similar to what I suggested above for QuadratureSpace
and VectorQuadratureSpace
. The new "FiniteElementSpace" will be just scalar and the "VectorFiniteElementSpace", in addition to "FiniteElementSpace" pointer/reference and vdim
, will have the "ordering" parameter.
We can even generalize this to "TensorFiniteElementSpace" where there are multiple dimensions (not just one vdim
) and more general layouts for the tensor dofs ordering.
from mfem.
Related Issues (20)
- Evaluating integrals of shape functions in neighboring elements HOT 13
- 【VectorDomainLFIntegrator does not provided enough constructors】 HOT 3
- Changes to `socketbuf` result in `SocketStream` objects returning true even if not connected (e.g., to GLVis) HOT 5
- 【Is PWFunctionCoefficient possible?】 HOT 1
- Strange failure in LOBPCG::Solve() HOT 5
- Coefficient Projection for IGA Spaces HOT 5
- Apply double cross of a function by normal vector for Nedelec space. HOT 1
- Fix the FMS unit test and the FMS example file `data/star-q3.fms`
- 3D electromagnetic proximity effect
- Implement AssemblePABoundary for VectorFEMassIntegrator HOT 3
- Suggested added feature: OptionsParser taking input from file
- HypreBoomerAMG preconditioner memory leaks HOT 7
- Error calling CUDA mfem::forall() with MFEM as a third party library HOT 3
- Maybe inconsistence of "domain_integes_marker" when construct a bilinearform with existed one
- Unit test "LOR AMS" failure with Umpire HOT 1
- parallel install error! HOT 9
- MFEM for helmoltz equation HOT 21
- MFEM for wave equation HOT 2
- Suggestion : Adding safe versions of `Operator` functions.
- Inline Mesh Generation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mfem.