|
From: | Andriy Andreykiv |
Subject: | Re: [Getfem-users] Question about the function 'add_normal_Dirichlet_condition_with_penalization' |
Date: | Tue, 3 Mar 2015 13:47:42 +0100 |
const size_type degree = 1; const bgeot::dim_type qdimPenlaty = 1; auto &mfPenalty = getfem::classical_mesh_fem(mesh, degree, qdimPenlaty); getfem::add_normal_Dirichlet_condition_with_penalization(model, mim, "u", dirichlet_coefficient_cyl, CYLINDER_BOUNDARY_NUM ,"CylinderData", &mfPenalty);
Dear Andriy,thank you so much for your support. I perfectly understand that it's not easy to fix the problem without having the complete code.Anyway, mf_u.qdim() = 2. Do you have other questions that can help to understand the problem?The type of element I used for mf_u is FEM_PK(2,2). I also tried to use a FEM_PK(2,1) element instead, but this does not fix the problem.As you suggested, I tried to not specify the dataname "CylinderData" and let Getfem take the default value, but the same error 'Non matrix field' still appears.Without specifying "CylinderData" the call of the function becomes:add_normal_Dirichlet_condition_with_penalization(model,mim,"u",coefficient_penalization, region_id);So I don't understand which one of the 5 inputs has something wrong. As I said, in the same code I succeeded to use the similar function 'add_Dirichlet_condition_with_penalization', and I thought that the use of 'add_normal_Dirichlet_condition_with_penalization' would have been almost identical.Again, thank you so much for your very helpful support.Best regards,Dominique2015-03-02 9:45 GMT+01:00 Andriy Andreykiv <address@hidden>:Dear Dominique,It's hard to be completely sure about the cause, as your code is not complete so we can't see, for instance, how you create mf_u.Is it's qdim > 1?Nonetheless, I suspect the error comes from incompatibility of the mf_u dimension and the dimension of "CylinderData".The fact that it expects matrix field to me implies thatThe simplest remedy would be to try take into account that you don't really need to specify "CylinderData" as it's zero and then let Getfemtake the default.Best regards,AndriyOn 28 February 2015 at 15:03, Dominique Fratantonio <address@hidden> wrote:Hi,I wanted to be sure that my last email answer did not cause any misunderstanding.I still have the same problem with the function 'add_normal_Dirichlet_boundary_condition_with_penalization'.I report here again the extract of my code://--------------------------------------------------------------------------------------------------------------------------------------------------//// Main unknown of the problem:model.add_fem_variable("u", mf_u);// Viscous term// Linearized elasticity brick:model.add_initialized_fixed_size_data("lambda", plain_vector(1, 0.0)); // Second viscosity coefficientmodel.add_initialized_fixed_size_data("nu", plain_vector(1, 1/(pd.Re)));getfem::add_isotropic_linearized_elasticity_brick(model, mim, "u", "lambda", "nu");// Incompressible constraint// p used as Lagrange multiplier, but it doesn't need to be// add_multiplier as for the Dirichlet boundary conditions// Linearized incompressibility condition brick:model.add_fem_variable("p", mf_p);getfem::add_linear_incompressibility(model, mim, "u", "p");// Dirichlet condition on inflow:std::vector<scalar_type> F(mf_u.nb_dof());gmm::clear(F);getfem::interpolation_function(mf_u, F, u_exact);model.add_initialized_fem_data("InflowData", mf_u, F);if (PENALIZATION_INFLOW && act_DNS) {// With penalizationscalar_type dirichlet_coefficient_inflow = 1e8;getfem::add_Dirichlet_condition_with_penalization(model,mim,"u",dirichlet_coefficient_inflow,INFLOW_BOUNDARY_NUM,"InflowData");} else {// With multipliersmodel.add_multiplier("Inflow", mf_mult_inflow, "u", mim, INFLOW_BOUNDARY_NUM);getfem::add_Dirichlet_condition_with_multipliers(model, mim, "u","Inflow",INFLOW_BOUNDARY_NUM,"InflowData");}// Dirichlet condition on cylinder:bgeot::base_vector no_penetration(1); no_penetration[0]=0;model.add_initialized_fixed_size_data("CylinderData",no_penetration);if (PENALIZATION_CYL && act_DNS) {// With penalizationscalar_type dirichlet_coefficient_cyl = 1e8;getfem::add_normal_Dirichlet_condition_with_penalization(model,mim,"u",dirichlet_coefficient_cyl,CYLINDER_BOUNDARY_NUM,"CylinderData");} else {// With multipliersmodel.add_multiplier("Cylinder", mf_mult_cyl, "u", mim, CYLINDER_BOUNDARY_NUM);getfem::add_normal_Dirichlet_condition_with_multipliers(model,mim,"u","Cylinder",CYLINDER_BOUNDARY_NUM,"CylinderData");}// Build matricesmodel.assembly(getfem::model::BUILD_ALL);//------------------------------------------------------------------------------------------------------------------------------------------------------//Moreover, I'm completely out of idea about what the following error means://------------------------------------------------------------------------------------------------------------------------------------------------------//Trace 2 in getfem_models.cc, line 5667: Stiffness matrix assembly for isotropic linearized elasticityTrace 2 in getfem_models.cc, line 5931: Stokes term assemblyTrace 2 in getfem_models.cc, line 3157: Mass term assembly for Dirichlet conditionTrace 2 in getfem_models.cc, line 3201: Source term assembly for Dirichlet conditionTrace 2 in getfem_models.cc, line 3157: Mass term assembly for Dirichlet condition============================================| An error has been detected !!! |============================================Error in getfem_assembling_tensors.cc, line 488 :Non matrix field//------------------------------------------------------------------------------------------------------------------------------------------------------//Again, I just wanted to be sure that you know that I still have the same problem.Thank you very much in advance.2015-02-23 10:17 GMT+01:00 Yves Renard <address@hidden>:
Dear Kostas,
There is no release 4.3.2. I incremented the patch number in configure.ac to produce some archives and it as been automatically ported to the web site but this is an artefact. I will correct this.
Yves.
Le 23/02/2015 09:56, Konstantinos Poulios a écrit :
KostasBest regardsAm I missing something?Hi, I am wondering where is the link for 4.3.2 (or even 4.3.1) here:I can only see the tarball for 4.3.
http://download.gna.org/getfem/stable/
On Sun, Feb 22, 2015 at 5:54 PM, Dominique Fratantonio <address@hidden> wrote:
Hi,
I'm using getfem-4.3.2 and I am having some problem with the function 'add_normal_Dirichlet_condition_with_penalization'.Here an extract of how I am implementing it:
//--------------------------------------------------------------------------------------------------------------------------------------------------//
// Main unknown of the problem:model.add_fem_variable("u", mf_u);
// Viscous term// Linearized elasticity brick:model.add_initialized_fixed_size_data("lambda", plain_vector(1, 0.0)); // Second viscosity coefficientmodel.add_initialized_fixed_size_data("nu", plain_vector(1, 1/(pd.Re)));getfem::add_isotropic_linearized_elasticity_brick(model, mim, "u", "lambda", "nu");
// Incompressible constraint// p used as Lagrange multiplier, but it doesn't need to be// add_multiplier as for the Dirichlet boundary conditions// Linearized incompressibility condition brick:model.add_fem_variable("p", mf_p);getfem::add_linear_incompressibility(model, mim, "u", "p");
// Dirichlet condition on inflow:std::vector<scalar_type> F(mf_u.nb_dof());gmm::clear(F);getfem::interpolation_function(mf_u, F, u_exact);model.add_initialized_fem_data("InflowData", mf_u, F);
if (PENALIZATION_INFLOW && act_DNS) {// With penalizationscalar_type dirichlet_coefficient_inflow = 1e8;getfem::add_Dirichlet_condition_with_penalization(model,mim,"u",dirichlet_coefficient_inflow,INFLOW_BOUNDARY_NUM,"InflowData");} else {// With multipliersmodel.add_multiplier("Inflow", mf_mult_inflow, "u", mim, INFLOW_BOUNDARY_NUM);getfem::add_Dirichlet_condition_with_multipliers(model, mim, "u","Inflow",INFLOW_BOUNDARY_NUM,"InflowData");}
// Dirichlet condition on cylinder:bgeot::base_vector no_penetration(1); no_penetration[0]=0;model.add_initialized_fixed_size_data("CylinderData",no_penetration);
if (PENALIZATION_CYL && act_DNS) {// With penalizationscalar_type dirichlet_coefficient_cyl = 1e8;getfem::add_normal_Dirichlet_condition_with_penalization(model,mim,"u",dirichlet_coefficient_cyl,CYLINDER_BOUNDARY_NUM,"CylinderData");} else {// With multipliersmodel.add_multiplier("Cylinder", mf_mult_cyl, "u", mim, CYLINDER_BOUNDARY_NUM);getfem::add_normal_Dirichlet_condition_with_multipliers(model,mim,"u","Cylinder",CYLINDER_BOUNDARY_NUM,"CylinderData");}
// Build matricesmodel.assembly(getfem::model::BUILD_ALL);
//------------------------------------------------------------------------------------------------------------------------------------------------------//
In the above extract of the code, everything works fine except when I try to use 'add_normal_Dirichlet_condition_with_penalization'.The similar function 'add_Dirichlet_condition_with_penalization' works fine as well.Altought I succeed in compiling the code, when 'add_normal_Dirichlet_condition_with_penalization' runs, I obtain the following error:
//------------------------------------------------------------------------------------------------------------------------------------------------------//
Trace 2 in getfem_models.cc, line 5667: Stiffness matrix assembly for isotropic linearized elasticityTrace 2 in getfem_models.cc, line 5931: Stokes term assemblyTrace 2 in getfem_models.cc, line 3157: Mass term assembly for Dirichlet conditionTrace 2 in getfem_models.cc, line 3201: Source term assembly for Dirichlet conditionTrace 2 in getfem_models.cc, line 3157: Mass term assembly for Dirichlet condition============================================| An error has been detected !!! |============================================Error in getfem_assembling_tensors.cc, line 488 :Non matrix field
//------------------------------------------------------------------------------------------------------------------------------------------------------//
I really do not understand how to fix this problem and what it means.
Thank you in advance.Cheers.
_______________________________________________
Getfem-users mailing list
address@hidden
https://mail.gna.org/listinfo/getfem-users
_______________________________________________ Getfem-users mailing list address@hidden https://mail.gna.org/listinfo/getfem-users
-- Yves Renard (address@hidden) tel : (33) 04.72.43.87.08 Pole de Mathematiques, INSA-Lyon fax : (33) 04.72.43.85.29 20, rue Albert Einstein 69621 Villeurbanne Cedex, FRANCE http://math.univ-lyon1.fr/~renard ---------
_______________________________________________
Getfem-users mailing list
address@hidden
https://mail.gna.org/listinfo/getfem-users
_______________________________________________
Getfem-users mailing list
address@hidden
https://mail.gna.org/listinfo/getfem-users
[Prev in Thread] | Current Thread | [Next in Thread] |