Commit 743bd581 authored by GILLES Sebastien's avatar GILLES Sebastien

#1367 XCode: update XCode templates to reflect the current state of the...

#1367 XCode: update XCode templates to reflect the current state of the library (done only for the basic ones used in model: Model, VariationalFormulation, (renamed) InputData and main).
parent f04bed50
......@@ -7,7 +7,7 @@
<string>public.c-plus-plus-header</string>
</array>
<key>DefaultCompletionName</key>
<string>InputParameterList</string>
<string>InputData</string>
<key>Description</key>
<string>The header file that defines all input parameters.</string>
<key>Kind</key>
......@@ -16,19 +16,19 @@
<string>___FILEBASENAME___.hpp</string>
<key>SortOrder</key>
<string>2</string>
<key>Options</key>
<array>
<dict>
<key>Identifier</key>
<string>problemName</string>
<key>Name</key>
<string>ProblemName</string>
<key>Description</key>
<string>The name of the problem considered (without spaces).</string>
<key>Type</key>
<string>text</string>
</dict>
</array>
<key>Options</key>
<array>
<dict>
<key>Identifier</key>
<string>problemName</string>
<key>Name</key>
<string>ProblemName</string>
<key>Description</key>
<string>The name of the problem considered (without spaces).</string>
<key>Type</key>
<string>text</string>
</dict>
</array>
<key>Summary</key>
<string>The header file that defines all input parameters.</string>
</dict>
......
......@@ -19,8 +19,7 @@
# include "Core/InputParameter/FElt/Unknown.hpp"
# include "Core/InputParameter/FElt/NumberingSubset.hpp"
# include "Core/InputParameter/DirichletBoundaryCondition/DirichletBoundaryCondition.hpp"
# include "FormulationSolver/Crtp/VolumicAndSurfacicSource.hpp" // TODO Remove it if not relevant!
# include "Core/InputParameter/Parameter/Source/VectorialTransientSource.hpp"
namespace MoReFEM
......@@ -32,35 +31,36 @@ namespace MoReFEM
//! \copydoc doxygen_hide_mesh_enum
enum class MeshIndex
enum class MeshIndex
{
mesh = 1
};
//! \copydoc doxygen_hide_domain_enum
enum class DomainIndex
enum class DomainIndex
{
/* TODO Complete with something like:
highest_dimension = 1,
neumann = 2
neumann = 2,
dirichlet = 3,
full_mesh = 4
*/
};
//! \copydoc doxygen_hide_felt_space_enum
enum class FEltSpaceIndex
enum class FEltSpaceIndex
{
/* TODO Complete with something like:
highest_dimension = 1,
neumann = 2,
numbering_subset_test = 3
*/
};
//! \copydoc doxygen_hide_unknown_enum
enum class UnknownIndex
enum class UnknownIndex
{
/* TODO Complete with something like:
velocity = 1,
......@@ -81,18 +81,17 @@ namespace MoReFEM
//! \copydoc doxygen_hide_solver_enum
enum class SolverIndex
enum class SolverIndex
{
solver = 1
};
//! \copydoc doxygen_hide_numbering_subset_enum
enum class NumberingSubsetIndex
enum class NumberingSubsetIndex
{
/* TODO Complete with something like:
monolithic =
monolithic = 1
*/
};
......@@ -118,7 +117,7 @@ namespace MoReFEM
InputParameter::Petsc<EnumUnderlyingType(SolverIndex::/* one such line for each item defined earlier */)>,
InputParameter::Result::OutputDirectory
InputParameter::Result
// TODO: Add the problem-specific input parameters here!
>;
......@@ -128,6 +127,9 @@ namespace MoReFEM
//! \copydoc doxygen_hide_morefem_data_type
using morefem_data_type = MoReFEMData<InputParameterList>;
//! \copydoc doxygen_hide_input_data_type
using input_data_type = typename morefem_data_type::input_data_type;
} // namespace ___VARIABLE_problemName:identifier___NS
......
......@@ -13,7 +13,7 @@
#include "Core/MoReFEMData/MoReFEMData.hpp"
#include "ModelInstances/___VARIABLE_groupName:identifier___/Model.hpp"
#include "ModelInstances/___VARIABLE_groupName:identifier___/InputParameterList.hpp"
#include "ModelInstances/___VARIABLE_groupName:identifier___/InputData.hpp"
using namespace MoReFEM;
......@@ -21,16 +21,14 @@ using namespace MoReFEM;
int main(int argc, char** argv)
{
//! \copydoc doxygen_hide_model_specific_input_parameter_list
using InputParameterList = ___VARIABLE_problemName:identifier___NS::InputParameterList;
using InputParameterList = ___VARIABLE_problemName:identifier___NS::InputParameterList;
try
{
MoReFEMData<InputParameterList> morefem_data(argc, argv);
const auto& input_data = morefem_data.GetInputParameterList();
const auto& mpi = morefem_data.GetMpi();
decltype(auto) input_data = morefem_data.GetInputParameterList();
decltype(auto) mpi = morefem_data.GetMpi();
try
{
......
......@@ -22,10 +22,8 @@ namespace MoReFEM
Model::Model::Model(const morefem_data_type& morefem_data)
: parent(morefem_data)
{ }
: parent(mpi_ptr, input_data)
{ }
void Model::SupplInitialize()
{
// TODO: Fill the content with whatever initialization is required by the problem.
......
......@@ -16,7 +16,7 @@
# include "Model/Model.hpp"
# include "ModelInstances/___VARIABLE_groupName:identifier___/InputParameterList.hpp"
# include "ModelInstances/___VARIABLE_groupName:identifier___/InputData.hpp"
namespace MoReFEM
......@@ -27,7 +27,7 @@ namespace MoReFEM
{
class Model : public MoReFEM::Model<Model, morefem_data_type, DoConsiderProcessorWiseLocal2Global::/* choose your value among yes or no */>
class Model : public MoReFEM::Model<Model, morefem_data_type, DoConsiderProcessorWiseLocal2Global::no>
{
private:
......@@ -37,7 +37,7 @@ namespace MoReFEM
using self = Model;
//! Convenient alias.
using parent = MoReFEM::Model<Model, morefem_data_type, DoConsiderProcessorWiseLocal2Global::/* choose your value among yes or no */>;
using parent = MoReFEM::Model<Model, morefem_data_type, DoConsiderProcessorWiseLocal2Global::no>;
public:
......
......@@ -20,20 +20,24 @@ namespace MoReFEM
VariationalFormulation::VariationalFormulation(const morefem_data_type& morefem_data,
const NumberingSubset& numbering_subset1,
const NumberingSubset& numbering_subset2,
const TimeManager& time_manager,
const GodOfDof& god_of_dof,
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list)
: parent(mpi,
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list,
TimeManager& time_manager)
: parent(morefem_data,
time_manager,
god_of_dof,
std::move(boundary_condition_list)),
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.
std::move(boundary_condition_list))
{ }
void VariationalFormulation::SupplInit(const input_data_type& input_data)
{
// TODO: Put here the initialization operations specific to the variational formulation at hand.
// This encompass the reading of the input file: if for instance your problem needs the volumic mass,
// you need to set it here by consulting its value in the input parameter file.
// The definition of the operators in particular is expected here.
}
void VariationalFormulation::AllocateMatricesAndVectors()
{
......
......@@ -20,7 +20,7 @@
# include "FormulationSolver/VariationalFormulation.hpp"
# include "ModelInstances/___VARIABLE_relativePath___/InputParameterList.hpp"
# include "ModelInstances/___VARIABLE_relativePath___/InputData.hpp"
namespace MoReFEM
......@@ -36,10 +36,8 @@ namespace MoReFEM
: public MoReFEM::VariationalFormulation
<
VariationalFormulation,
EnumUnderlyingType(/* put the enum class value that indicates which solver is used */)
EnumUnderlyingType(SolverIndex::solver)
>
// TODO If there are sources involved, add the following line:
// ,public Crtp::VolumicAndSurfacicSource<VariationalFormulation>
{
private:
......@@ -51,7 +49,7 @@ namespace MoReFEM
using parent = MoReFEM::VariationalFormulation
<
self,
EnumUnderlyingType(/* put the enum class value that indicates which solver is used */)
EnumUnderlyingType(SolverIndex::solver)
>;
......@@ -70,11 +68,9 @@ namespace MoReFEM
//! copydoc doxygen_hide_varf_constructor
explicit VariationalFormulation(const morefem_data_type& morefem_data,
const NumberingSubset& numbering_subset1,
const NumberingSubset& numbering_subset2, // TODO and more if needed...
TimeManager& time_manager,
const GodOfDof& god_of_dof,
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list);
DirichletBoundaryCondition::vector_shared_ptr&& boundary_condition_list,
TimeManager& time_manager);
//! Destructor.
~VariationalFormulation() = default;
......@@ -100,9 +96,7 @@ namespace MoReFEM
///@{
//! \copydoc doxygen_hide_varf_suppl_init
// TODO: InputParameterDataT might probably be replaced by the actual InputParameterList used in the Model.
template<class InputParameterDataT>
void SupplInit(const InputParameterDataT& input_data);
void SupplInit(const input_data_type& input_data);
/*!
* \brief Allocate the global matrices and vectors.
......@@ -149,19 +143,7 @@ namespace MoReFEM
private:
/// \name Numbering subsets used in the formulation.
///@{
// \TODO Define here one or several attributes of the type const NumberingSubset&.
const NumberingSubset& numbering_subset1_;
const NumberingSubset& numbering_subset2_;
// \TODO ...
///@}
};
......
......@@ -19,34 +19,27 @@ namespace MoReFEM
namespace ___VARIABLE_problemName:identifier___NS
{
template<class InputParameterDataT>
void VariationalFormulation::SupplInit(const InputParameterDataT& input_data)
{
// TODO: Put here the initialization operations specific to the variational formulation at hand.
// This encompass the reading of the input file: if for instance your problem needs the volumic mass,
// you need to set it here by consulting its value in the input parameter file.
// The definition of the operators in particular is expected here.
}
inline Wrappers::Petsc::Snes::SNESFunction VariationalFormulation::ImplementSnesFunction() const
{
// TODO: The three ImplementSnesXXX() methods are there to tell Petsc SNES (Newton) algorithm
// how to proceed. They must be meaningfully filled if SolveNonLinear() is called.
// If you do a direct solve and don't want to bother with Newton solve, simply return nullptr.
// If you do a direct solve and don't want to bother with Newton solve, simply return nullptr.
return nullptr;
}
inline Wrappers::Petsc::Snes::SNESJacobian VariationalFormulation::ImplementSnesJacobian() const
{
// TODO: Same comment as in ImplementSnesFunction().
return nullptr;
}
inline Wrappers::Petsc::Snes::SNESViewer VariationalFormulation::ImplementSnesViewer() const
{
// TODO: Same comment as in ImplementSnesFunction().
return nullptr;
}
......@@ -54,6 +47,7 @@ namespace MoReFEM
{
// TODO: Same comment as in ImplementSnesFunction().
// However, this one might be nullptr even if others above are not.
return nullptr;
}
......
Markdown is supported
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