Giter Site home page Giter Site logo

Comments (4)

andcarl1364 avatar andcarl1364 commented on July 23, 2024

so we can easily get the vec_dim using this->_system_vars.size() as already implemented, however which specific vector vars are we counting to calculate n_vector_vars and the same for scaler vars with n_scalar_vars?

from libmesh.

roystgnr avatar roystgnr commented on July 23, 2024

vec_dim isn't _system_vars.size(); it would be the dimensionality of the vector variables, not the total number of variables.

_system_vars is a vector of variable indices; vector variables with any of those indices would be included in n_vector_vars and scalar variables with any of those indices would be included in n_scalar_vars.

from libmesh.

andcarl1364 avatar andcarl1364 commented on July 23, 2024

thank you! I guess what i'm confused about is which specific variables am I checking for having those indices, are they in the mesh_function.C file? and is there some sort of map of vector variables and their dimensionality in order to calculate vec_dim?

from libmesh.

roystgnr avatar roystgnr commented on July 23, 2024

Variables are added dynamically to a System; DofMap::n_variables() returns the total count of them for its associated system. Each variable's information is available from DofMap::variable(i); that information includes a FEType, and FEInterface::n_vec_dim(mesh, fe_type) indicates how many dimensions a particular non-SCALAR variable has.

You might want to consider looking through some of the libMesh example programs; e.g. the distinction between variables in the C++ (might be named in a library .C file) context versus variables in the mathematical (added and named by an application) context is shown in introduction_ex2.C; later introduction_ex4.C is the first to use the returned index of a newly-added variable.

from libmesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.