Commit b40575c9 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#525 Update XCode template of VariationalFormulation.

parent 3a386a29
......@@ -18,13 +18,16 @@ namespace HappyHeart
VariationalFormulation::VariationalFormulation(const Wrappers::Mpi& mpi,
const NumberingSubset& numbering_subset,
const NumberingSubset& numbering_subset1,
const NumberingSubset& numbering_subset2,
const TransientParameters& transient_parameters,
const GodOfDof& god_of_dof)
: Parent(mpi,
numbering_subset,
transient_parameters,
god_of_dof)
god_of_dof),
numbering_subset1_(numbering_subset1), // TODO just to illustrate here: it's up to you to create attributes of type
numbering_subset2_(numbering_subset2), // const NumberingSubset& in the place indicated in the hpp file.
{ }
......@@ -35,16 +38,32 @@ namespace HappyHeart
}
void VariationalFormulation::SupplAllocateMatricesAndVectors()
void VariationalFormulation::AllocateMatricesAndVectors()
{
// TODO Set here the pattern of all global matrices and vectors introduced specifically for
// the current variational formulation. GetSystemMatrix() and GetSystemRhs() are already related to
// a pattern, so if the pattern of the new operators is the same the command for each of them is simply:
// TODO Set here the pattern of all global matrices and vectors.
// Typically it should be something like:
//
// \code
// const auto& system_matrix = GetSystemMatrix();
// GetNonCstXXX().CompleteCopy(system_matrix, __FILE__, __LINE__);
// const auto& numbering_subset1 = GetNumberingSubset1(); // accessor you have to defined in new class; name it as appropriate!
// const auto& numbering_subset2 = GetNumberingSubset2();
//
// // Allocate the relevant block matrix. Below an example for Stokes model, in which only upper blocks
// // in the matrix need to be allocated.
// Parent::AllocateGlobalMatrix(numbering_subset1, numbering_subset1);
// Parent::AllocateGlobalMatrix(numbering_subset1, numbering_subset2);
//
// // Same for vector; system_rhs and system_solution are allocated here.
// Parent::AllocateGlobalVector(numbering_subset);
//
// Access to the newly allocated matrix and vectors.
// const auto& system_matrix = GetSystemMatrix(numbering_subset1, numbering_subset1);
// const auto& system_rhs = GetSystemRhs(numbering_subset1);
//
// // Allocate your problem specific matrices and vectors, by coping structure of the ones allocated above.
// GetNonCstVectorCurrentVolumicSource().CompleteCopy(system_rhs, __FILE__, __LINE__);
// ...
//
// \endcode
// where GetNonCstXXX() is a non-constant accessor to matrix XXX.
}
......
......@@ -53,7 +53,8 @@ namespace HappyHeart
//! Constructor.
explicit VariationalFormulation(const Wrappers::Mpi& mpi,
const NumberingSubset& numbering_subset,
const NumberingSubset& numbering_subset1,
const NumberingSubset& numbering_subset2, // TODO and more if needed...
const TransientParameters& transient_parameters,
const GodOfDof& god_of_dof);
......@@ -98,9 +99,9 @@ namespace HappyHeart
void SupplInit(const InputParameterDataT& input_parameter_data);
/*!
* \brief Allocate the global matrices and vectors specific to the considered problem.
* \brief Allocate the global matrices and vectors.
*/
void SupplAllocateMatricesAndVectors();
void AllocateMatricesAndVectors();
//! Define the pointer function required to calculate the function required by the non-linear problem.
Wrappers::Petsc::Snes::SNESFunction ImplementSnesFunction() const;
......@@ -135,6 +136,18 @@ namespace HappyHeart
// assembled.
///@}
private:
/// \name NUmbering subsets used in the formulation.
///@{
// \TODO Define here one or several attributes of the type const NumberingSubset&.
///@}
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment