mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 09:20:34 +05:00
MGAdapt: allow using float field. Fixes test 13.
This commit is contained in:
parent
7aedadbe42
commit
06613d617e
@ -450,7 +450,7 @@ if __name__ == "__main__" :
|
|||||||
L_OPTIONS.append("05")
|
L_OPTIONS.append("05")
|
||||||
L_OPTIONS.append("06")
|
L_OPTIONS.append("06")
|
||||||
L_OPTIONS.append("08")
|
L_OPTIONS.append("08")
|
||||||
#L_OPTIONS.append("13")
|
L_OPTIONS.append("13")
|
||||||
|
|
||||||
# 2. Lancement de la classe
|
# 2. Lancement de la classe
|
||||||
|
|
||||||
|
@ -1381,8 +1381,17 @@ void MgAdapt::convertMedFile(std::string& meshFormatMeshFileName, std::string& s
|
|||||||
checkTimeStepRank(medFileIn) ;
|
checkTimeStepRank(medFileIn) ;
|
||||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileAnyTypeFieldMultiTS> fts( mfd->getFields()->getFieldWithName(fieldName) );
|
MEDCoupling::MCAuto<MEDCoupling::MEDFileAnyTypeFieldMultiTS> fts( mfd->getFields()->getFieldWithName(fieldName) );
|
||||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileAnyTypeField1TS> f = fts->getTimeStep(timeStep, rank);
|
MEDCoupling::MCAuto<MEDCoupling::MEDFileAnyTypeField1TS> f = fts->getTimeStep(timeStep, rank);
|
||||||
MEDCoupling::MCAuto<MEDCoupling::MEDFileFieldMultiTS> tmFts = MEDCoupling::MEDFileFieldMultiTS::New();
|
MEDCoupling::MCAuto<MEDCoupling::MEDFileFieldMultiTS> tmFts = MEDCoupling::DynamicCast<MEDCoupling::MEDFileAnyTypeFieldMultiTS,MEDCoupling::MEDFileFieldMultiTS>(fts);
|
||||||
tmFts->pushBackTimeStep(f);
|
|
||||||
|
// if not able to cast to double field, try float field
|
||||||
|
if (!tmFts)
|
||||||
|
{
|
||||||
|
MEDCoupling::MCAuto<MEDCoupling::MEDFileFloatFieldMultiTS> tmFtsFloat = MEDCoupling::DynamicCast<MEDCoupling::MEDFileAnyTypeFieldMultiTS,MEDCoupling::MEDFileFloatFieldMultiTS>(fts);
|
||||||
|
if (!tmFtsFloat)
|
||||||
|
THROW_SALOME_EXCEPTION("\nUnexpected field type.\n");
|
||||||
|
// convert float field to double
|
||||||
|
tmFts = tmFtsFloat->convertToDouble();
|
||||||
|
}
|
||||||
|
|
||||||
fields->pushField(tmFts);
|
fields->pushField(tmFts);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user