141 if ~isempty(which(
" KerMor "))
143 initialdir = getpref(a.getPrefTag,
" LASTDIR ",
" . ");
145 folder = uigetdir(initialdir);
146 if ~isempty(which(
" KerMor "))
147 setpref(a.getPrefTag,
" LASTDIR ",folder);
152 if exist(folder,
" dir ") ~= 7
156 mexc = MException(
" JaRMoSExport:nodir ",
" Directory '%s' did not exist and could not be created. ", folder);
163 f = fopen(fullfile(folder,
" model.xml "),
" w+ ");
164 fprintf(f,
" <?xml version='1.0' encoding='utf-8'?>\n ");
165 fprintf(f,
" <model type='%s' machformat='be'>\n ",this.
ModelType);
166 fprintf(f,
" \t<description>\n ");
167 fprintf(f,
" \t\t<short>%s</short>\n ",this.
Short);
168 fprintf(f,
" \t\t<created>%s</created>\n ",datestr(now,
" yyyy-mm-dd "));
173 fprintf(f,
" \t</description>\n ");
178 if ~isempty(sourcefiles)
179 if isempty(sourcebase)
180 error(
" No project java sources directory set. Aborting. ");
183 j.TargetFolder= folder;
185 j.JProjectSource= sourcebase;
187 j.Sources= sourcefiles;
188 j.CreateAndroid=
true;
192 fprintf(f,
" <numDoFfields>%d</numDoFfields>\n ",this.
DoFFields);
196 fprintf(f,
" <geometry>\n ");
198 fprintf(f,
" </geometry>\n ");
203 fprintf(f,
" <visual><fields>\n ");
205 mapping =
" VERTEX ";
206 if isfield(fi(idx),
" Mapping ") && ~isempty(fi(idx).Mapping)
207 mapping = fi(idx).Mapping;
209 if ~isempty(fi(idx).Name)
210 fprintf(f,
" \t<field type='%s' mapping='%s'>%s</field>\n ",...
211 fi(idx).Type,mapping,fi(idx).Name);
213 fprintf(f,
" \t<field type='%s' mapping='%s'/>\n ",...
214 fi(idx).Type,mapping);
217 fprintf(f,
" </fields></visual>\n ");
222 fprintf(f,
" </model>\n ");
function exportModel(models.ReducedModel model,char folder)
Exports the given model for use in JaRMoS to the given folder.
char JaRMoSBaseSource
The JaRMoSBase java sources directory. Required if any java classes are to by compiled.
The base class for any KerMor detailed model.
integer DoFFields
The number of degrees of freedom-fields this system computes as output.
char ModelType
The model type according to the jarmos.ModelType enum.
The KerMor reduced model class.
A MatLab function handle.
Matlab's base handle class (documentation generation substitute)
JaRMoSExport: Export base class for JaRMoS Models.
virtual function [ sourcebase , sourcefiles ] = typeSpecificExport(f,models.BaseFullModel model, settings, folder)
char Short
Short description for the model.
function_handle GeometryExportCallback
A callback for geometry export of the JaRMoS-Model.
struct LogicalFields
Returns the field descriptions for each logical solution field.
char JavaExportPackage
The package of any java classes associated with this model when exported to JaRMoS.
Global configuration class for all KerMor run-time settings.
static function KerMor theinstance = App()
The singleton KerMor instance.
A MatLab character array.